Koji Noguchi created PIG-5381:
---------------------------------

             Summary: Extra foreach in nested-foreach preventing Accumulator 
usage
                 Key: PIG-5381
                 URL: https://issues.apache.org/jira/browse/PIG-5381
             Project: Pig
          Issue Type: Bug
            Reporter: Koji Noguchi
            Assignee: Koji Noguchi


{code}
A = LOAD 'test.input1' AS (a1:int, a2:chararray, a3:int);
B = GROUP A by a1;
C = FOREACH B {
    C2 = FOREACH A generate a2, a3;
    GENERATE group, org.apache.pig.test.utils.AccumulatorBagCount(C2);
}

dump C;
{code} 

This simple code fails with 
{noformat}
Caused by: java.io.IOException: exec() should not be called.
        at 
org.apache.pig.test.utils.AccumulatorBagCount.exec(AccumulatorBagCount.java:56)
        at 
org.apache.pig.test.utils.AccumulatorBagCount.exec(AccumulatorBagCount.java:28)
        at 
org.apache.pig.backend.hadoop.executionengine.physicalLayer.expressionOperators.POUserFunc.getNext(POUserFunc.java:332)
        ... 17 more
{noformat}

Somehow pig decides not to enable Accumulator in this case.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to