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/04/28 18:14:03 UTC

[jira] [Created] (PIG-2020) Valid query fails to validate

Valid query fails to validate
-----------------------------

                 Key: PIG-2020
                 URL: https://issues.apache.org/jira/browse/PIG-2020
             Project: Pig
          Issue Type: Bug
    Affects Versions: 0.8.0, 0.9.0
            Reporter: Xuefu Zhang
            Assignee: Xuefu Zhang
             Fix For: 0.9.0


The following query seems valid:

A = load 'x';
B = foreach A { T = filter $0 by $1 > $2; generate T; };
Store B into 'y';

However, the query fails due to validation error in 0.8:

2011-04-28 09:08:06,846 [main] ERROR org.apache.pig.tools.grunt.Grunt - ERROR 1026: Attempt to fetch field 1 from schema of size 1

Similar error is given in 0.9.


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

[jira] [Updated] (PIG-2020) Valid query fails to validate

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

Xuefu Zhang updated PIG-2020:
-----------------------------

    Fix Version/s:     (was: 0.9.0)

Since this is there even in 0.8, there is no rush to fix it in 0.9. Thus, I suggest we push this forward.

> Valid query fails to validate
> -----------------------------
>
>                 Key: PIG-2020
>                 URL: https://issues.apache.org/jira/browse/PIG-2020
>             Project: Pig
>          Issue Type: Bug
>    Affects Versions: 0.8.0, 0.9.0
>            Reporter: Xuefu Zhang
>            Assignee: Xuefu Zhang
>
> The following query seems valid:
> A = load 'x';
> B = foreach A { T = filter $0 by $1 > $2; generate T; };
> Store B into 'y';
> However, the query fails due to validation error in 0.8:
> 2011-04-28 09:08:06,846 [main] ERROR org.apache.pig.tools.grunt.Grunt - ERROR 1026: Attempt to fetch field 1 from schema of size 1
> Similar error is given in 0.9.

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

[jira] [Commented] (PIG-2020) Valid query fails to validate

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

Olga Natkovich commented on PIG-2020:
-------------------------------------

I am not even sure why this is a valid script. Can somebody explain?

> Valid query fails to validate
> -----------------------------
>
>                 Key: PIG-2020
>                 URL: https://issues.apache.org/jira/browse/PIG-2020
>             Project: Pig
>          Issue Type: Bug
>    Affects Versions: 0.8.0, 0.9.0
>            Reporter: Xuefu Zhang
>            Assignee: Xuefu Zhang
>
> The following query seems valid:
> A = load 'x';
> B = foreach A { T = filter $0 by $1 > $2; generate T; };
> Store B into 'y';
> However, the query fails due to validation error in 0.8:
> 2011-04-28 09:08:06,846 [main] ERROR org.apache.pig.tools.grunt.Grunt - ERROR 1026: Attempt to fetch field 1 from schema of size 1
> Similar error is given in 0.9.

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

[jira] [Commented] (PIG-2020) Valid query fails to validate

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

Xuefu Zhang commented on PIG-2020:
----------------------------------

I reported it, and thus need to explain.

$0 should be cast to a bag because it's used as the input to a nested filter. $1 and $2 are referring to the columns in the bag. This usage seems reasonable: user doesn't have to explicitly cast $0 to a bag, as it's the case if the type were long or int.

If the load statement becomes: A = load 'x' as (b:{}), pig doesn't complain any more. The point is, Pig should detect the need of inserting a cast in this case.


> Valid query fails to validate
> -----------------------------
>
>                 Key: PIG-2020
>                 URL: https://issues.apache.org/jira/browse/PIG-2020
>             Project: Pig
>          Issue Type: Bug
>    Affects Versions: 0.8.0, 0.9.0
>            Reporter: Xuefu Zhang
>            Assignee: Xuefu Zhang
>
> The following query seems valid:
> A = load 'x';
> B = foreach A { T = filter $0 by $1 > $2; generate T; };
> Store B into 'y';
> However, the query fails due to validation error in 0.8:
> 2011-04-28 09:08:06,846 [main] ERROR org.apache.pig.tools.grunt.Grunt - ERROR 1026: Attempt to fetch field 1 from schema of size 1
> Similar error is given in 0.9.

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

[jira] [Commented] (PIG-2020) Valid query fails to validate

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

Xuefu Zhang commented on PIG-2020:
----------------------------------

After some discussion, it's found that the real problem is that Pig didn't automatically cast $0 to a bag type, which it should. $1 and $2 are referring to fields in the bag.

This behavior is inconsistent with other types because we insert type casting for other types.

The error message is confusing too, because the bag's schema is unknown rather than of size 1.

> Valid query fails to validate
> -----------------------------
>
>                 Key: PIG-2020
>                 URL: https://issues.apache.org/jira/browse/PIG-2020
>             Project: Pig
>          Issue Type: Bug
>    Affects Versions: 0.8.0, 0.9.0
>            Reporter: Xuefu Zhang
>            Assignee: Xuefu Zhang
>             Fix For: 0.9.0
>
>
> The following query seems valid:
> A = load 'x';
> B = foreach A { T = filter $0 by $1 > $2; generate T; };
> Store B into 'y';
> However, the query fails due to validation error in 0.8:
> 2011-04-28 09:08:06,846 [main] ERROR org.apache.pig.tools.grunt.Grunt - ERROR 1026: Attempt to fetch field 1 from schema of size 1
> Similar error is given in 0.9.

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