[ 
https://issues.apache.org/jira/browse/PIG-5224?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15971298#comment-15971298
 ] 

Koji Noguchi commented on PIG-5224:
-----------------------------------

{quote}
If this is a problem of extra foreach after LOCogroup, why not adding the same 
check in ColumnPruneVisitor.visit(LOCogroup cg) instead of 
addForEachIfNecessary?
{quote}
That would work.
I followed the logic in LOLoad where we had 
{code}
                  // if there is already a LOForEach after load, we don't need 
to
                  // add another LOForEach
                  if (next instanceof LOForEach) {
                      return;
                  }
{code}
and assumed this would apply to all other foreach insertion cases. 


> Extra foreach from ColumnPrune preventing Accumulator usage
> -----------------------------------------------------------
>
>                 Key: PIG-5224
>                 URL: https://issues.apache.org/jira/browse/PIG-5224
>             Project: Pig
>          Issue Type: Improvement
>            Reporter: Koji Noguchi
>            Assignee: Koji Noguchi
>         Attachments: pig-5224-v0-testonly.patch, pig-5224-v1.patch
>
>
> {code}
> A = load 'input' as (id:int, fruit);
> B = foreach A generate id; -- to enable columnprune
> C = group B by id;
> D = foreach C {
>     o = order B by id;
>     generate org.apache.pig.test.utils.AccumulatorBagCount(o);
> }
> STORE D into ...
> {code}
> Pig fails to use Accumulator interface for this UDF.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to