I have a relation like this :
R1 : a:chararray,b:chararray,c:bag{t:tuple(c1:chararray,c2:chararray)}
so the data look like :
(a,b,{(aa,bb),(cc,dd)})
(e,f,{(gg,hh),(ii,jj)})
And i want to get that :
R2 : c:bag{t:tuple(c1:chararray,c2:chararray,b:chararray,a:chararray,)}
So :
{(aa,bb,b,a),(cc,dd,b,a)})
{(gg,hh,f,e),(ii,jj,f,e)}
I tried several solution with nested foreach and flatten the bag, i tried cross join ... but there isn't any good solution.
Especially I expected this should work :
FOREACH R1 {
flatC= FOREACH R1 GENERATE FLATTEN(c) as c1,c2,c3;
GENERATE
a,
b,
c1,
c2,
c3;
};
Does anyone have an idea ?
thanks