1
votes

I have a relation which is being grouped. How can i access the grouped value like a map ?

data = load 'log.txt' as (id:chararray,name:chararray);
grouped = group data by id;
foreach data {
filtered = filter group by group.id=data.id;
};

one way I was trying to iterate the group and filter the resultant bag. But my scenario is I have to iterate an outer tuple and then with those result have to get the corresponding bag from the grouped value. I tried nested foreach but I am getting the below exception,

 expression is not a project expression: (Name: ScalarExpression) Type: null Uid: null)

tried several combinations of no use.

1
Please show your actual scenario, not a simpler one in which you have already found a solution.reo katoa
its not clear what are you trying to achieve. what are you filtering on? why do you need to filter inside the foreach and not outside foreach?Gaurav Phapale

1 Answers

0
votes

As per this, Seems like it's bug as reported at PIG-1798.