Filter inside foreach is broken
-------------------------------

                 Key: PIG-1465
                 URL: https://issues.apache.org/jira/browse/PIG-1465
             Project: Pig
          Issue Type: Bug
    Affects Versions: 0.7.0
            Reporter: hc busy


{quote}
% cat data.txt
x,a,1,a
x,a,2,a
x,a,3,b
x,a,4,b
y,a,1,a
y,a,2,a
y,a,3,b
y,a,4,b
% cat script.pig
a = load 'data' as (ind:chararray, f1:chararray, num:int, f2:chararray);
b = group a by ind;
describe b;
f = foreach b{
    all_total = SUM(a.num);
    fed  = filter a by (f1==f2);
    some_total = (int)SUM(fed.num);
    generate group as ind, all_total, some_total;
}
describe f;
dump f;
% pig -f script.pig
(x,a,1,a,,)
(x,a,2,a,,)
(x,a,3,b,,)
(x,a,4,b,,)
(y,a,1,a,,)
(y,a,2,a,,)
(y,a,3,b,,)
(y,a,4,b,,)
% cat what_I_expected
(x,10,3)
(y,10,3)
{quote}


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to