You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pig.apache.org by "Xuefu Zhang (JIRA)" <ji...@apache.org> on 2011/03/10 01:43:59 UTC

[jira] Commented: (PIG-1152) bincond operator throws parser error

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

Xuefu Zhang commented on PIG-1152:
----------------------------------

Actually the problem is not caused by either bincond operator or parser, but by pig's grammar limitation. Data fields in a literal bag can only have literals. By Pig's grammar, -1 is not a literal, but an expression.

Thus, parser is happy with C = foreach B generate group, flatten(((COUNT(A) < 1L) ? {(1)} : A.x));.

To solve the problem, Pig grammar needs to be extended.

> bincond operator throws parser error
> ------------------------------------
>
>                 Key: PIG-1152
>                 URL: https://issues.apache.org/jira/browse/PIG-1152
>             Project: Pig
>          Issue Type: Bug
>    Affects Versions: 0.6.0
>            Reporter: Ankur
>            Assignee: Xuefu Zhang
>             Fix For: 0.9.0
>
>
> Bincond operator throws parser error when true condition contains a constant bag with 1 tuple containing a single field of int type with -ve value. 
> Here is the script to reproduce the issue
> A = load 'A' as (s: chararray, x: int, y: int);
> B = group A by s;
> C = foreach B generate group, flatten(((COUNT(A) < 1L) ? {(-1)} : A.x));
> dump C;

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira