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/21 18:11:05 UTC

[jira] [Created] (PIG-1925) Parser error message doesn't show location of the error or show it as Line 0:0

Parser error message doesn't show location of the error or show it as Line 0:0
------------------------------------------------------------------------------

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


When Parser emits an error from one of the tree parsers (like AST validation or plan generation), Line number is missing or printed as Line 0:0. Further investigation shows that Antlr 3.2 isn't able to report the correct line number and line offset. We need to address it in Pig code.

The following is an example.

grunt> A = load 'x' as (u, v, u, w);
2011-03-21 10:04:44,486 [main] ERROR org.apache.pig.tools.grunt.Grunt - ERROR 0: Duplicated alias in schema: u


It's desirable to have line number/offset in such kind of error messages.




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

[jira] [Commented] (PIG-1925) Parser error message doesn't show location of the error or show it as Line 0:0

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

Xuefu Zhang commented on PIG-1925:
----------------------------------

For PIG-1925-1.patch, unit test passed. Test-patch run (additional javacc warnings due to generated code):

     [exec] -1 overall.
     [exec]
     [exec]     +1 @author.  The patch does not contain any @author tags.
     [exec]
     [exec]     +1 tests included.  The patch appears to include 6 new or modified tests.
     [exec]
     [exec]     +1 javadoc.  The javadoc tool did not generate any warning messages.
     [exec]
     [exec]     -1 javac.  The applied patch generated 890 javac compiler warnings (more than the trunk's current 877 warnings).
     [exec]
     [exec]     +1 findbugs.  The patch does not introduce any new Findbugs warnings.
     [exec]
     [exec]     +1 release audit.  The applied patch does not increase the total number of release audit warnings.


> Parser error message doesn't show location of the error or show it as Line 0:0
> ------------------------------------------------------------------------------
>
>                 Key: PIG-1925
>                 URL: https://issues.apache.org/jira/browse/PIG-1925
>             Project: Pig
>          Issue Type: Bug
>    Affects Versions: 0.9.0
>            Reporter: Xuefu Zhang
>            Assignee: Xuefu Zhang
>             Fix For: 0.9.0
>
>         Attachments: PIG-1925-1.patch, PIG-1925.patch
>
>
> When Parser emits an error from one of the tree parsers (like AST validation or plan generation), Line number is missing or printed as Line 0:0. Further investigation shows that Antlr 3.2 isn't able to report the correct line number and line offset. We need to address it in Pig code.
> The following is an example.
> grunt> A = load 'x' as (u, v, u, w);
> 2011-03-21 10:04:44,486 [main] ERROR org.apache.pig.tools.grunt.Grunt - ERROR 0: Duplicated alias in schema: u
> It's desirable to have line number/offset in such kind of error messages.

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

[jira] [Commented] (PIG-1925) Parser error message doesn't show location of the error or show it as Line 0:0

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

Alan Gates commented on PIG-1925:
---------------------------------

A couple of comments.  One, 1:9.  I assume this means line 1 column 9.  It would be better to spell that out.

I think for parser errors it would be good to explicitly say "Syntax error, unexpected symbol at or near 'A'".  This way people explicitly know it's in their syntax.

> Parser error message doesn't show location of the error or show it as Line 0:0
> ------------------------------------------------------------------------------
>
>                 Key: PIG-1925
>                 URL: https://issues.apache.org/jira/browse/PIG-1925
>             Project: Pig
>          Issue Type: Bug
>    Affects Versions: 0.9.0
>            Reporter: Xuefu Zhang
>            Assignee: Xuefu Zhang
>             Fix For: 0.9.0
>
>         Attachments: PIG-1925.patch
>
>
> When Parser emits an error from one of the tree parsers (like AST validation or plan generation), Line number is missing or printed as Line 0:0. Further investigation shows that Antlr 3.2 isn't able to report the correct line number and line offset. We need to address it in Pig code.
> The following is an example.
> grunt> A = load 'x' as (u, v, u, w);
> 2011-03-21 10:04:44,486 [main] ERROR org.apache.pig.tools.grunt.Grunt - ERROR 0: Duplicated alias in schema: u
> It's desirable to have line number/offset in such kind of error messages.

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

[jira] [Updated] (PIG-1925) Parser error message doesn't show location of the error or show it as Line 0:0

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

Xuefu Zhang updated PIG-1925:
-----------------------------

    Attachment: PIG-1925-1.patch

Patch is updated based on Alan's comment above. Unit test and test-patch run are in progress.

> Parser error message doesn't show location of the error or show it as Line 0:0
> ------------------------------------------------------------------------------
>
>                 Key: PIG-1925
>                 URL: https://issues.apache.org/jira/browse/PIG-1925
>             Project: Pig
>          Issue Type: Bug
>    Affects Versions: 0.9.0
>            Reporter: Xuefu Zhang
>            Assignee: Xuefu Zhang
>             Fix For: 0.9.0
>
>         Attachments: PIG-1925-1.patch, PIG-1925.patch
>
>
> When Parser emits an error from one of the tree parsers (like AST validation or plan generation), Line number is missing or printed as Line 0:0. Further investigation shows that Antlr 3.2 isn't able to report the correct line number and line offset. We need to address it in Pig code.
> The following is an example.
> grunt> A = load 'x' as (u, v, u, w);
> 2011-03-21 10:04:44,486 [main] ERROR org.apache.pig.tools.grunt.Grunt - ERROR 0: Duplicated alias in schema: u
> It's desirable to have line number/offset in such kind of error messages.

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

[jira] [Resolved] (PIG-1925) Parser error message doesn't show location of the error or show it as Line 0:0

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

Alan Gates resolved PIG-1925.
-----------------------------

    Resolution: Fixed

Patch 1925-1 checked in.

> Parser error message doesn't show location of the error or show it as Line 0:0
> ------------------------------------------------------------------------------
>
>                 Key: PIG-1925
>                 URL: https://issues.apache.org/jira/browse/PIG-1925
>             Project: Pig
>          Issue Type: Bug
>    Affects Versions: 0.9.0
>            Reporter: Xuefu Zhang
>            Assignee: Xuefu Zhang
>             Fix For: 0.9.0
>
>         Attachments: PIG-1925-1.patch, PIG-1925.patch
>
>
> When Parser emits an error from one of the tree parsers (like AST validation or plan generation), Line number is missing or printed as Line 0:0. Further investigation shows that Antlr 3.2 isn't able to report the correct line number and line offset. We need to address it in Pig code.
> The following is an example.
> grunt> A = load 'x' as (u, v, u, w);
> 2011-03-21 10:04:44,486 [main] ERROR org.apache.pig.tools.grunt.Grunt - ERROR 0: Duplicated alias in schema: u
> It's desirable to have line number/offset in such kind of error messages.

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

[jira] [Updated] (PIG-1925) Parser error message doesn't show location of the error or show it as Line 0:0

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

Xuefu Zhang updated PIG-1925:
-----------------------------

    Attachment: PIG-1925.patch

With the patch, the error message is emitted as:

grunt> A = load 'x' as (u, v, u, w);
2011-03-21 10:10:27,067 [main] ERROR org.apache.pig.tools.grunt.Grunt - ERROR 0: Line 1:23 duplicated alias in schema: u

Unit test passed.
Test-patch run result (Additional JAVACC warnings due to generated code):

     [exec] -1 overall.
     [exec]
     [exec]     +1 @author.  The patch does not contain any @author tags.
     [exec]
     [exec]     +1 tests included.  The patch appears to include 6 new or modified tests.
     [exec]
     [exec]     +1 javadoc.  The javadoc tool did not generate any warning messages.
     [exec]
     [exec]     -1 javac.  The applied patch generated 888 javac compiler warnings (more than the trunk's current 877 warnings).
     [exec]
     [exec]     +1 findbugs.  The patch does not introduce any new Findbugs warnings.
     [exec]
     [exec]     +1 release audit.  The applied patch does not increase the total number of release audit warnings.


> Parser error message doesn't show location of the error or show it as Line 0:0
> ------------------------------------------------------------------------------
>
>                 Key: PIG-1925
>                 URL: https://issues.apache.org/jira/browse/PIG-1925
>             Project: Pig
>          Issue Type: Bug
>    Affects Versions: 0.9.0
>            Reporter: Xuefu Zhang
>            Assignee: Xuefu Zhang
>             Fix For: 0.9.0
>
>         Attachments: PIG-1925.patch
>
>
> When Parser emits an error from one of the tree parsers (like AST validation or plan generation), Line number is missing or printed as Line 0:0. Further investigation shows that Antlr 3.2 isn't able to report the correct line number and line offset. We need to address it in Pig code.
> The following is an example.
> grunt> A = load 'x' as (u, v, u, w);
> 2011-03-21 10:04:44,486 [main] ERROR org.apache.pig.tools.grunt.Grunt - ERROR 0: Duplicated alias in schema: u
> It's desirable to have line number/offset in such kind of error messages.

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

[jira] [Commented] (PIG-1925) Parser error message doesn't show location of the error or show it as Line 0:0

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

Xuefu Zhang commented on PIG-1925:
----------------------------------

Patch also includes fixes for default error messages generated by Antlr, "no viable alternative at input ...". Now the error messages are show as:

1. for lexer

grunt> A = load ^ as (u, v, w);
line 1:9 Unexpected character '^'
2011-03-21 10:21:04,147 [main] ERROR org.apache.pig.tools.grunt.Grunt - ERROR 0: line 1:9 Unexpected character '^'

2. for parser

grunt> A = laod 'x' as (u, v, w);
2011-03-21 10:21:53,517 [main] ERROR org.apache.pig.tools.grunt.Grunt - ERROR 0: line 1:0 Unexpected symbol at or near ['A']

(Please not that in the above case, parser isn't able to identify "load" is misspelled, but it's not what this fix is about. That case is tracked in a different JIRA.)



> Parser error message doesn't show location of the error or show it as Line 0:0
> ------------------------------------------------------------------------------
>
>                 Key: PIG-1925
>                 URL: https://issues.apache.org/jira/browse/PIG-1925
>             Project: Pig
>          Issue Type: Bug
>    Affects Versions: 0.9.0
>            Reporter: Xuefu Zhang
>            Assignee: Xuefu Zhang
>             Fix For: 0.9.0
>
>         Attachments: PIG-1925.patch
>
>
> When Parser emits an error from one of the tree parsers (like AST validation or plan generation), Line number is missing or printed as Line 0:0. Further investigation shows that Antlr 3.2 isn't able to report the correct line number and line offset. We need to address it in Pig code.
> The following is an example.
> grunt> A = load 'x' as (u, v, u, w);
> 2011-03-21 10:04:44,486 [main] ERROR org.apache.pig.tools.grunt.Grunt - ERROR 0: Duplicated alias in schema: u
> It's desirable to have line number/offset in such kind of error messages.

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