You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pig.apache.org by "Daniel Dai (JIRA)" <ji...@apache.org> on 2016/05/05 06:08:12 UTC

[jira] [Commented] (PIG-4724) GROUP ALL must create an output record in case there is no input

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

Daniel Dai commented on PIG-4724:
---------------------------------

This has to be done through PigGenericMapReduce.cleanup, since no input will feed to date pipeline. We shall maintain a flag indicating this is a group all query (refer to GroupByConstParallelSetter.java), and if there is no input (in PigGenericMapReduce.reduce), we shall generate a psudo record.

> GROUP ALL must create an output record in case there is no input
> ----------------------------------------------------------------
>
>                 Key: PIG-4724
>                 URL: https://issues.apache.org/jira/browse/PIG-4724
>             Project: Pig
>          Issue Type: Bug
>    Affects Versions: 0.16.0
>            Reporter: Prashant Kommireddi
>            Assignee: Prashant Kommireddi
>
> {code}
> A = load 'data';
> B = filter A by $0 == 'THIS_DOES_NOT_EXIST';
> C = group B ALL;
> D = foreach C generate group, COUNT(B);
> {code}
> Even if the filter did not output any rows, since we are grouping on ALL the expected output should probably be (ALL, 0). The implementation generates a pseudo key “all” for every input on map side, thus reduce side we can combine all input together. However, this does not work for 0 input since the reduce side does not get any input. If the input is empty, yield a pseudo “all, 0” to reduce



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)