pig-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Xuefu Zhang (JIRA)" <j...@apache.org>
Subject [jira] Commented: (PIG-1152) bincond operator throws parser error
Date Thu, 10 Mar 2011 00:43:59 GMT

    [ 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

Mime
View raw message