You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pig.apache.org by "Gianmarco De Francisci Morales (JIRA)" <ji...@apache.org> on 2011/03/29 11:17:05 UTC

[jira] [Created] (PIG-1941) Dumping a scalar launches ClassCastException

Dumping a scalar launches ClassCastException
--------------------------------------------

                 Key: PIG-1941
                 URL: https://issues.apache.org/jira/browse/PIG-1941
             Project: Pig
          Issue Type: Bug
          Components: impl
    Affects Versions: 0.8.0
            Reporter: Gianmarco De Francisci Morales


The following script fails launching a class cast exception:
java.lang.ClassCastException: java.lang.String cannot be cast to org.apache.pig.data.DataBag

a = LOAD 'a.txt' as (line:chararray);
b = GROUP a ALL;
c = FOREACH b GENERATE COUNT(*) AS sum;
DUMP c;

However, this other script works correctly:
a = LOAD 'a.txt' as (line:chararray);
b = GROUP a ALL;
c = FOREACH b GENERATE COUNT(*) AS sum;
d = ORDER a BY $0;
DUMP d;

So I assume there is something strange in the DUMP operator.

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

[jira] [Commented] (PIG-1941) Dumping a scalar launches ClassCastException

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

Daniel Dai commented on PIG-1941:
---------------------------------

COUNT(a) always works. For COUNT(*), 0.8 result a backend ClassCastException, and 0.9 result a frontend exception:

ERROR 1045: Could not infer the matching function for org.apache.pig.builtin.COUNT as multiple or none of them fit. Please use an explicit cast.
        at org.apache.pig.newplan.logical.visitor.TypeCheckingExpVisitor.visit(TypeCheckingExpVisitor.java:751)


> Dumping a scalar launches ClassCastException
> --------------------------------------------
>
>                 Key: PIG-1941
>                 URL: https://issues.apache.org/jira/browse/PIG-1941
>             Project: Pig
>          Issue Type: Bug
>          Components: impl
>    Affects Versions: 0.8.0
>            Reporter: Gianmarco De Francisci Morales
>             Fix For: 0.9.0
>
>
> The following script fails launching a class cast exception:
> java.lang.ClassCastException: java.lang.String cannot be cast to org.apache.pig.data.DataBag
> {code}
> a = LOAD 'a.txt' as (line:chararray);
> b = GROUP a ALL;
> c = FOREACH b GENERATE COUNT(*) AS sum;
> DUMP c;
> {code}
> However, this other script works correctly:
> {code}
> a = LOAD 'a.txt' as (line:chararray);
> b = GROUP a ALL;
> c = FOREACH b GENERATE COUNT(*) AS sum;
> d = ORDER a BY $0;
> DUMP d;
> {code}
> So I assume there is something strange in the DUMP operator.

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

[jira] [Commented] (PIG-1941) Dumping a scalar launches ClassCastException

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

Daniel Dai commented on PIG-1941:
---------------------------------

Here schema for b is (group, bag), if you say COUNT( * ), it will feed the whole schema b to COUNT, and COUNT get confused. You need to say COUNT(a).

> Dumping a scalar launches ClassCastException
> --------------------------------------------
>
>                 Key: PIG-1941
>                 URL: https://issues.apache.org/jira/browse/PIG-1941
>             Project: Pig
>          Issue Type: Bug
>          Components: impl
>    Affects Versions: 0.8.0
>            Reporter: Gianmarco De Francisci Morales
>             Fix For: 0.9.0
>
>
> The following script fails launching a class cast exception:
> java.lang.ClassCastException: java.lang.String cannot be cast to org.apache.pig.data.DataBag
> {code}
> a = LOAD 'a.txt' as (line:chararray);
> b = GROUP a ALL;
> c = FOREACH b GENERATE COUNT(*) AS sum;
> DUMP c;
> {code}
> However, this other script works correctly:
> {code}
> a = LOAD 'a.txt' as (line:chararray);
> b = GROUP a ALL;
> c = FOREACH b GENERATE COUNT(*) AS sum;
> d = ORDER a BY $0;
> DUMP d;
> {code}
> So I assume there is something strange in the DUMP operator.

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

[jira] [Updated] (PIG-1941) Dumping a scalar launches ClassCastException

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

Gianmarco De Francisci Morales updated PIG-1941:
------------------------------------------------

    Description: 
The following script fails launching a class cast exception:
java.lang.ClassCastException: java.lang.String cannot be cast to org.apache.pig.data.DataBag

{code}
a = LOAD 'a.txt' as (line:chararray);
b = GROUP a ALL;
c = FOREACH b GENERATE COUNT(*) AS sum;
DUMP c;
{code}


However, this other script works correctly:
{code}
a = LOAD 'a.txt' as (line:chararray);
b = GROUP a ALL;
c = FOREACH b GENERATE COUNT(*) AS sum;
d = ORDER a BY $0;
DUMP d;
{code}
So I assume there is something strange in the DUMP operator.

  was:
The following script fails launching a class cast exception:
java.lang.ClassCastException: java.lang.String cannot be cast to org.apache.pig.data.DataBag

a = LOAD 'a.txt' as (line:chararray);
b = GROUP a ALL;
c = FOREACH b GENERATE COUNT(*) AS sum;
DUMP c;

However, this other script works correctly:
a = LOAD 'a.txt' as (line:chararray);
b = GROUP a ALL;
c = FOREACH b GENERATE COUNT(*) AS sum;
d = ORDER a BY $0;
DUMP d;

So I assume there is something strange in the DUMP operator.


> Dumping a scalar launches ClassCastException
> --------------------------------------------
>
>                 Key: PIG-1941
>                 URL: https://issues.apache.org/jira/browse/PIG-1941
>             Project: Pig
>          Issue Type: Bug
>          Components: impl
>    Affects Versions: 0.8.0
>            Reporter: Gianmarco De Francisci Morales
>
> The following script fails launching a class cast exception:
> java.lang.ClassCastException: java.lang.String cannot be cast to org.apache.pig.data.DataBag
> {code}
> a = LOAD 'a.txt' as (line:chararray);
> b = GROUP a ALL;
> c = FOREACH b GENERATE COUNT(*) AS sum;
> DUMP c;
> {code}
> However, this other script works correctly:
> {code}
> a = LOAD 'a.txt' as (line:chararray);
> b = GROUP a ALL;
> c = FOREACH b GENERATE COUNT(*) AS sum;
> d = ORDER a BY $0;
> DUMP d;
> {code}
> So I assume there is something strange in the DUMP operator.

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

[jira] [Resolved] (PIG-1941) Dumping a scalar launches ClassCastException

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

Daniel Dai resolved PIG-1941.
-----------------------------

    Resolution: Invalid

> Dumping a scalar launches ClassCastException
> --------------------------------------------
>
>                 Key: PIG-1941
>                 URL: https://issues.apache.org/jira/browse/PIG-1941
>             Project: Pig
>          Issue Type: Bug
>          Components: impl
>    Affects Versions: 0.8.0
>            Reporter: Gianmarco De Francisci Morales
>             Fix For: 0.9.0
>
>
> The following script fails launching a class cast exception:
> java.lang.ClassCastException: java.lang.String cannot be cast to org.apache.pig.data.DataBag
> {code}
> a = LOAD 'a.txt' as (line:chararray);
> b = GROUP a ALL;
> c = FOREACH b GENERATE COUNT(*) AS sum;
> DUMP c;
> {code}
> However, this other script works correctly:
> {code}
> a = LOAD 'a.txt' as (line:chararray);
> b = GROUP a ALL;
> c = FOREACH b GENERATE COUNT(*) AS sum;
> d = ORDER a BY $0;
> DUMP d;
> {code}
> So I assume there is something strange in the DUMP operator.

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

[jira] [Updated] (PIG-1941) Dumping a scalar launches ClassCastException

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

Daniel Dai updated PIG-1941:
----------------------------

    Fix Version/s: 0.9.0

> Dumping a scalar launches ClassCastException
> --------------------------------------------
>
>                 Key: PIG-1941
>                 URL: https://issues.apache.org/jira/browse/PIG-1941
>             Project: Pig
>          Issue Type: Bug
>          Components: impl
>    Affects Versions: 0.8.0
>            Reporter: Gianmarco De Francisci Morales
>             Fix For: 0.9.0
>
>
> The following script fails launching a class cast exception:
> java.lang.ClassCastException: java.lang.String cannot be cast to org.apache.pig.data.DataBag
> {code}
> a = LOAD 'a.txt' as (line:chararray);
> b = GROUP a ALL;
> c = FOREACH b GENERATE COUNT(*) AS sum;
> DUMP c;
> {code}
> However, this other script works correctly:
> {code}
> a = LOAD 'a.txt' as (line:chararray);
> b = GROUP a ALL;
> c = FOREACH b GENERATE COUNT(*) AS sum;
> d = ORDER a BY $0;
> DUMP d;
> {code}
> So I assume there is something strange in the DUMP operator.

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