Details
-
Improvement
-
Status: Open
-
Minor
-
Resolution: Unresolved
-
None
-
None
-
None
-
None
Description
It would be nice to have the possibility to compute and use scalar relationship inside a nested foreach block.
As an example, the following code is not currently supported by Pig.
a = LOAD 'data.txt' AS (id:chararray, num:int); b = GROUP a BY id; c = FOREACH b { n = COUNT(a); d = FILTER a BY num == n; GENERATE d; };
This would be useful with LIMIT and SAMPLE as well.