You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pig.apache.org by "Vivek Padmanabhan (Created) (JIRA)" <ji...@apache.org> on 2012/02/21 12:41:34 UTC
[jira] [Created] (PIG-2544) ConstantExpression considers (-1.0) as
a tuple rather than double
ConstantExpression considers (-1.0) as a tuple rather than double
-----------------------------------------------------------------
Key: PIG-2544
URL: https://issues.apache.org/jira/browse/PIG-2544
Project: Pig
Issue Type: Bug
Affects Versions: 0.9.1, 0.10
Reporter: Vivek Padmanabhan
{code}
A = load 'i1' as (a,b,c:double);
B = foreach A generate ((a eq '')?((b eq '')? (-1.0) :(c/100.0)): (c/100.0)) ;
dump B;
{code}
In Pig 0.9 the above script fails with exception : "Unsupported input type for BinCond: left hand side: tuple; right hand side: double"
The same script works fine with Pig 0.8.
I think the issue is ConstantExpression uses Util.translateFieldSchema(DataType.determineFieldSchema(val))
which considers (-1.0) as a tuple rather than double in this case.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Resolved] (PIG-2544) ConstantExpression considers (-1.0) as
a tuple rather than double
Posted by "Daniel Dai (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/PIG-2544?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Daniel Dai resolved PIG-2544.
-----------------------------
Resolution: Won't Fix
This is by design. There is discussion on PIG-2082.
> ConstantExpression considers (-1.0) as a tuple rather than double
> -----------------------------------------------------------------
>
> Key: PIG-2544
> URL: https://issues.apache.org/jira/browse/PIG-2544
> Project: Pig
> Issue Type: Bug
> Affects Versions: 0.9.1, 0.10.0
> Reporter: Vivek Padmanabhan
>
> {code}
> A = load 'i1' as (a,b,c:double);
> B = foreach A generate ((a eq '')?((b eq '')? (-1.0) :(c/100.0)): (c/100.0)) ;
> dump B;
> {code}
> In Pig 0.9 the above script fails with exception : "Unsupported input type for BinCond: left hand side: tuple; right hand side: double"
> The same script works fine with Pig 0.8.
> I think the issue is ConstantExpression uses Util.translateFieldSchema(DataType.determineFieldSchema(val))
> which considers (-1.0) as a tuple rather than double in this case.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (PIG-2544) ConstantExpression considers (-1.0)
as a tuple rather than double
Posted by "Dmitriy V. Ryaboy (Commented) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/PIG-2544?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13258090#comment-13258090 ]
Dmitriy V. Ryaboy commented on PIG-2544:
----------------------------------------
() being syntactic sugar for "TOTUPLE" is a documented feature..
> ConstantExpression considers (-1.0) as a tuple rather than double
> -----------------------------------------------------------------
>
> Key: PIG-2544
> URL: https://issues.apache.org/jira/browse/PIG-2544
> Project: Pig
> Issue Type: Bug
> Affects Versions: 0.9.1, 0.10.0
> Reporter: Vivek Padmanabhan
>
> {code}
> A = load 'i1' as (a,b,c:double);
> B = foreach A generate ((a eq '')?((b eq '')? (-1.0) :(c/100.0)): (c/100.0)) ;
> dump B;
> {code}
> In Pig 0.9 the above script fails with exception : "Unsupported input type for BinCond: left hand side: tuple; right hand side: double"
> The same script works fine with Pig 0.8.
> I think the issue is ConstantExpression uses Util.translateFieldSchema(DataType.determineFieldSchema(val))
> which considers (-1.0) as a tuple rather than double in this case.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (PIG-2544) ConstantExpression considers (-1.0)
as a tuple rather than double
Posted by "Prashant Kommireddi (Commented) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/PIG-2544?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13258077#comment-13258077 ]
Prashant Kommireddi commented on PIG-2544:
------------------------------------------
Hi Vivek,
What should be the expected behavior here for something declared within parenthesis, (-1.0)? For a ConstantExpression -1.0 is different from (-1.0) and it seems like the right behavior in this case?
Another way of looking at it is, let's say we enclose empty string within ()
{code}
grunt> B = foreach A generate ((a eq (''))?((b eq '')? (-1.0) :(c/100.0)): (c/100.0)) ;
{code}
This would rightly error out too as ('') is a tuple, not a primitive chararray.
> ConstantExpression considers (-1.0) as a tuple rather than double
> -----------------------------------------------------------------
>
> Key: PIG-2544
> URL: https://issues.apache.org/jira/browse/PIG-2544
> Project: Pig
> Issue Type: Bug
> Affects Versions: 0.9.1, 0.10.0
> Reporter: Vivek Padmanabhan
>
> {code}
> A = load 'i1' as (a,b,c:double);
> B = foreach A generate ((a eq '')?((b eq '')? (-1.0) :(c/100.0)): (c/100.0)) ;
> dump B;
> {code}
> In Pig 0.9 the above script fails with exception : "Unsupported input type for BinCond: left hand side: tuple; right hand side: double"
> The same script works fine with Pig 0.8.
> I think the issue is ConstantExpression uses Util.translateFieldSchema(DataType.determineFieldSchema(val))
> which considers (-1.0) as a tuple rather than double in this case.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira