You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pig.apache.org by "Mark Liu (JIRA)" <ji...@apache.org> on 2012/06/15 11:25:42 UTC

[jira] [Created] (PIG-2754) pig can't sum with inner mutiply

Mark Liu created PIG-2754:
-----------------------------

             Summary: pig can't sum with inner mutiply
                 Key: PIG-2754
                 URL: https://issues.apache.org/jira/browse/PIG-2754
             Project: Pig
          Issue Type: Bug
          Components: internal-udfs
    Affects Versions: 0.10.0
         Environment: GNU bash, version 3.2.25(1)-release (x86_64-redhat-linux-gnu)
            Reporter: Mark Liu


sample code like that:

txns = LOAD '/test' USING PigStorage() AS (domain:chararray,amount:double);

txns_by_domain = GROUP txns BY domain;

test_txns = FOREACH txns_by_domain { domain = group;  test_out = SUM(txns.amount * txns.amount);}
...

it looks built-in function SUM did not support inner multiply and sum up.


--
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-2754) pig can't sum with inner mutiply

Posted by "Alan Gates (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PIG-2754?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13295811#comment-13295811 ] 

Alan Gates commented on PIG-2754:
---------------------------------

This is not a bug, it is the semantics of the language.  When you do txns.amount, the result is not a double, but a bag of tuples with one column which is a double.  This is an issue because by definition no order is guaranteed for records in a bag so in general there is no coherent way to resolve bag1.x * bag2.y.


                
> pig can't sum with inner mutiply
> --------------------------------
>
>                 Key: PIG-2754
>                 URL: https://issues.apache.org/jira/browse/PIG-2754
>             Project: Pig
>          Issue Type: Bug
>          Components: internal-udfs
>    Affects Versions: 0.10.0
>         Environment: GNU bash, version 3.2.25(1)-release (x86_64-redhat-linux-gnu)
>            Reporter: Mark Liu
>
> sample code like that:
> txns = LOAD '/test' USING PigStorage() AS (domain:chararray,amount:double);
> txns_by_domain = GROUP txns BY domain;
> test_txns = FOREACH txns_by_domain { domain = group;  test_out = SUM(txns.amount * txns.amount);}
> ...
> it looks built-in function SUM did not support inner multiply and sum up.

--
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-2754) pig can't sum with inner mutiply

Posted by "Alan Gates (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PIG-2754?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alan Gates resolved PIG-2754.
-----------------------------

    Resolution: Invalid
    
> pig can't sum with inner mutiply
> --------------------------------
>
>                 Key: PIG-2754
>                 URL: https://issues.apache.org/jira/browse/PIG-2754
>             Project: Pig
>          Issue Type: Bug
>          Components: internal-udfs
>    Affects Versions: 0.10.0
>         Environment: GNU bash, version 3.2.25(1)-release (x86_64-redhat-linux-gnu)
>            Reporter: Mark Liu
>
> sample code like that:
> txns = LOAD '/test' USING PigStorage() AS (domain:chararray,amount:double);
> txns_by_domain = GROUP txns BY domain;
> test_txns = FOREACH txns_by_domain { domain = group;  test_out = SUM(txns.amount * txns.amount);}
> ...
> it looks built-in function SUM did not support inner multiply and sum up.

--
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