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/31 19:11:05 UTC

[jira] [Commented] (PIG-1947) Incorrect line number is reported during parsing

    [ https://issues.apache.org/jira/browse/PIG-1947?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13014072#comment-13014072 ] 

Xuefu Zhang commented on PIG-1947:
----------------------------------

There were issues with previous release as well. For instance, for the following query,

A = load 'x' as ( u:int, v:chararray );
sh ls;
B = foreach A generate u , v; C = distinct 'xxx';
store C into 'y';

The error message:

2011-03-31 10:02:56,186 [main] ERROR org.apache.pig.tools.grunt.Grunt - ERROR 1000: Error during parsing. Encountered " <QUOTEDSTRING> "\'xxx\' "" at line 3, column 14.
Was expecting one of:
    <IDENTIFIER> ...
    "(" ...
    "(" ...

While correct line number is reported, 'xxx' is nowhere near column 14.

The point is that we need a better design to handle the error origin as the process of parsing happens in two different parsers.

> Incorrect line number is reported during parsing
> ------------------------------------------------
>
>                 Key: PIG-1947
>                 URL: https://issues.apache.org/jira/browse/PIG-1947
>             Project: Pig
>          Issue Type: Bug
>    Affects Versions: 0.9.0
>            Reporter: Xuefu Zhang
>            Assignee: Xuefu Zhang
>             Fix For: 0.9.0
>
>
> In case of errors in script, Pig parser doesn't report correct the line number always. For example:
> script:
> A = load 'x' as ( u:int, v:chararray );
> sh ls -l;
> B = foreach A generate u + v;
> store B into 'y';
> error reported:
> 2011-03-30 17:48:04,649 [main] ERROR org.apache.pig.tools.grunt.Grunt - ERROR 1039: <file line.pig, line 2, column 25> (Name: Add Type: int Uid: 7)incompatible types in Add Operator left hand side:Unknown right hand side:Unknown
> Incorrect line number is also reported when a single line contains multiple Pig statement, such as:
> A = load 'x' as( u:int, v:chararray); B = foreach A generate u + v;
> store B into 'y';

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