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/03/10 19:09:59 UTC

[jira] Resolved: (PIG-1499) Type error message does not include complex type

     [ https://issues.apache.org/jira/browse/PIG-1499?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Xuefu Zhang resolved PIG-1499.
------------------------------

    Resolution: Fixed

Better error message is given now:
grunt> A = LOAD 'input.txt' AS (f1:bag[T:tuple(t1, t2)]);
2011-03-10 10:07:23,532 [main] ERROR org.apache.pig.tools.grunt.Grunt - ERROR 0: line 2:31 mismatched input [@37,76:76='[',<108>,2:31] expecting LEFT_CURLY



> Type error message does not include complex type
> ------------------------------------------------
>
>                 Key: PIG-1499
>                 URL: https://issues.apache.org/jira/browse/PIG-1499
>             Project: Pig
>          Issue Type: Improvement
>          Components: impl
>    Affects Versions: 0.7.0
>         Environment: Hadoop 0.20.104.3.1007030707
> Apache Pig version 0.7.0.20.100.1.1006041903 (r951530)
>            Reporter: Sherry Chen
>            Assignee: Xuefu Zhang
>            Priority: Minor
>             Fix For: 0.9.0
>
>
> When loading data as a bag, if the schema specification is not correct, error message does not include useful information about bag.
> For example, input file as "input.txt", working script as "working.pig", non working as "not_working.pig" as following:
> input.txt
> {(2, 3)}
> {(4, 6)}
> {(5, 7)}
> not_working.pig
> A = LOAD 'input.txt' AS (f1:bag[T:tuple(t1, t2)]);
> describe A;
> dump A;
> working .pig
> A = LOAD 'input.txt' AS (f1:bag{T:tuple(t1, t2)});
> describe A;
> dump A;
> if run: " pig -latest -x local working.pig", we get result:
> ({(2, 3)})
> ({(4, 6)})
> ({(5, 7)})
> if run " pig -latest -x local not_working.pig", we get:
>  ERROR org.apache.pig.tools.grunt.Grunt - ERROR 1000: Error during parsing. Encountered " "bag" "bag "" at line 1, column 29.
> Was expecting one of:
>     "int" ...
>     "long" ...
>     "float" ...
>     "double" ...
>     "chararray" ...
>     "bytearray" ...
>     "int" ...
>     "long" ...
>     "float" ...
>     "double" ...
>     "chararray" ...
>     "bytearray" ...
> Please include bag{} map[] tuple() in Error message for better addressing the error.

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