Abinitio Interview Question 45
Abinitio Interview Question 45
Get the unique values from the input data
Input
code, country
1, India
2, Mumbai
1, USA
2, Newyork
1, UK
2, Edinburgh
2, London
output
code, countries
2, India,Mumbai
2, USA,Newyork
2, UK,Edinburgh,London
type temporary_type=
record
string(",") l_countries;
decimal("") cnt;
end;
temp::initialize(in)=
begin
temp.l_countries::in.country;
temp.cnt::0;
end;
out::key_change(in1,in2)=
begin
out::if(in1.code==1);
end;
out::rollup(temp,in)=
begin
out.l_countries::if(temp.cnt!=0) string_concat(temp.countries,',',in.country);
out.cnt::temp.cnt+1;
end;
out::finalize(temp,in)=
begin
out.code::in.code;
out.countries::temp.l_countries;
end;
For More Abinitio, AWS, Database content please visit my youTube channel.
https://www.youtube.com/@datapundit
@datapundit
Comments
Post a Comment