[
https://issues.apache.org/jira/browse/PIG-144?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13005755#comment-13005755
]
Xuefu Zhang commented on PIG-144:
---------------------------------
It's hard to give a good error message in case of typo. In this case, tream
will be treated as an IDENTIFIER and Pig doesn't have a syntax (in the new
parser) for Alias = IDENTIFIER. Thus, it actually complains at B where it gets
no way out. Here is what you will see with the new parser.
grunt> A = load 'x';
grunt> B = tream A through `cat`;
2011-03-11 10:02:32,431 [main] ERROR org.apache.pig.tools.grunt.Grunt - ERROR
0: line 2:0 [query, statement] no viable alt; token = [@9,14:14='B',<77>,2:0]
(decision=2 state 6) decision=<<>>
It will not be easy to give a really useful error message such as "Hey, 'tream'
is misspelled. do you mean 'stream'?" without significant effort (if possible
at all).
I assume for now the error message is okay for such a case, unless anyone
disagree or has an easy way out.
> The error message should be more meaningful when there is a typo in PIg script
> ------------------------------------------------------------------------------
>
> Key: PIG-144
> URL: https://issues.apache.org/jira/browse/PIG-144
> Project: Pig
> Issue Type: Bug
> Reporter: Xu Zhang
> Assignee: Xuefu Zhang
> Priority: Minor
> Fix For: 0.9.0
>
>
> When I ran the following Pig script on the command line {{"pig -c mycluster
> myscript.pig"}}, I got the error:
> 2008-03-07 16:31:45,992 [main] ERROR org.apache.pig.tools.grunt.Grunt -
>
> {code}
> A = load '/user/pig/tests/data/singlefile/fileexists';
> B = foreach A generate $2, $1, $0;
> C = strean B through `awk '{print $3 " " $4 "\t" $2 "\t" $1}'`;
> store C into '/user/pig/tests/data/singlefile/results1';
> {code}
> The error message is not quite meaningful, and it took me a while to find out
> what was wrong - the word "strean" should have been "stream".
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira