Abinitio Interview Questions 26
Watch my YouTube video for explanation :
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;
output
code, countries
2, India,Mumbai
2, USA,Newyork
2, UK,Edinburgh
For more Abinitio, AWS and data engineering videos please subscribe , view , like and share my YouTube channel
Click DataPundit
Comments
Post a Comment