You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pig.apache.org by "Benjamin Francisoud (JIRA)" <ji...@apache.org> on 2008/02/08 17:35:07 UTC

[jira] Created: (PIG-100) Tests: NullPointerException parser.QueryParser.Alias(QueryParser.java:471)

Tests: NullPointerException parser.QueryParser.Alias(QueryParser.java:471)
--------------------------------------------------------------------------

                 Key: PIG-100
                 URL: https://issues.apache.org/jira/browse/PIG-100
             Project: Pig
          Issue Type: Bug
          Components: impl
    Affects Versions: 0.1.0
            Reporter: Benjamin Francisoud
            Priority: Minor


I think the root problem was that I forget to specify the configuration using -Djunit.hadoop.conf=hadoop-site.xml while running the tests.
But the error could be clearer...

The logs are big so I will provide them in a separate file...

But the core problem is:
{noformat}
    [junit] java.lang.NullPointerException
    [junit] 	at org.apache.pig.impl.logicalLayer.parser.QueryParser.Alias(QueryParser.java:471)
    [junit] 	at org.apache.pig.impl.logicalLayer.parser.QueryParser.NestedExpr(QueryParser.java:411)
    [junit] 	at org.apache.pig.impl.logicalLayer.parser.QueryParser.NestedExpr(QueryParser.java:417)
    [junit] 	at org.apache.pig.impl.logicalLayer.parser.QueryParser.GroupItem(QueryParser.java:1027)
...
    [junit] org.apache.pig.impl.logicalLayer.parser.ParseException: Encountered "group" at line 1, column 9.
    [junit] Was expecting one of:
    [junit]     <IDENTIFIER> ...
    [junit]     "(" ...
    [junit]     
    [junit] 	at org.apache.pig.impl.logicalLayer.parser.QueryParser.generateParseException(QueryParser.java:4142)
...
    [junit] org.apache.pig.impl.logicalLayer.parser.ParseException: Encountered "generate" at line 1, column 1.
    [junit] Was expecting one of:
    [junit]     "load" ...
    [junit]     "filter" ...
{noformat}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (PIG-100) Tests: NullPointerException parser.QueryParser.Alias(QueryParser.java:471)

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

Olga Natkovich updated PIG-100:
-------------------------------

    Resolution: Fixed
        Status: Resolved  (was: Patch Available)

Patch committed. Thanks Benjamin for contributing! 

Also added some error hamdling to get more clear error message

> Tests: NullPointerException parser.QueryParser.Alias(QueryParser.java:471)
> --------------------------------------------------------------------------
>
>                 Key: PIG-100
>                 URL: https://issues.apache.org/jira/browse/PIG-100
>             Project: Pig
>          Issue Type: Bug
>          Components: impl
>    Affects Versions: 0.1.0
>            Reporter: Benjamin Francisoud
>            Priority: Minor
>         Attachments: PIG-100-tests.log, PIG-100-v01.patch, PIG-100-v02.patch, PIG-100-v03-spaces.patch, PIG-100-v03-tabs.patch
>
>
> I think the root problem was that I forget to specify the configuration using -Djunit.hadoop.conf=hadoop-site.xml while running the tests.
> But the error could be clearer...
> The logs are big so I will provide them in a separate file...
> But the core problem is:
> {noformat}
>     [junit] java.lang.NullPointerException
>     [junit] 	at org.apache.pig.impl.logicalLayer.parser.QueryParser.Alias(QueryParser.java:471)
>     [junit] 	at org.apache.pig.impl.logicalLayer.parser.QueryParser.NestedExpr(QueryParser.java:411)
>     [junit] 	at org.apache.pig.impl.logicalLayer.parser.QueryParser.NestedExpr(QueryParser.java:417)
>     [junit] 	at org.apache.pig.impl.logicalLayer.parser.QueryParser.GroupItem(QueryParser.java:1027)
> ...
>     [junit] org.apache.pig.impl.logicalLayer.parser.ParseException: Encountered "group" at line 1, column 9.
>     [junit] Was expecting one of:
>     [junit]     <IDENTIFIER> ...
>     [junit]     "(" ...
>     [junit]     
>     [junit] 	at org.apache.pig.impl.logicalLayer.parser.QueryParser.generateParseException(QueryParser.java:4142)
> ...
>     [junit] org.apache.pig.impl.logicalLayer.parser.ParseException: Encountered "generate" at line 1, column 1.
>     [junit] Was expecting one of:
>     [junit]     "load" ...
>     [junit]     "filter" ...
> {noformat}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (PIG-100) Tests: NullPointerException parser.QueryParser.Alias(QueryParser.java:471)

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

Benjamin Francisoud updated PIG-100:
------------------------------------

    Attachment: PIG-100-v02.patch

Stefan, Olga, I tried to match  both your requirements...

I added a special exception handling in LogicalPlanBuilder:
{code:java}
try {
    plan = parser.Parse();
} catch (ParseException e) {
    log.error(e.getMessage());
    log.debug(e);
}
{code}

Users should only see the error message: "Unable to find alias: 'A' - aliases: ''"
Developers can set their logging level to debug to get the full stacktrace...

What do you think of it ?

Could you test my patch and see if it fix the problem ?

(I can't run the tests locally at the moment because of my OutOfMemory errors PIG-99)

thanks

> Tests: NullPointerException parser.QueryParser.Alias(QueryParser.java:471)
> --------------------------------------------------------------------------
>
>                 Key: PIG-100
>                 URL: https://issues.apache.org/jira/browse/PIG-100
>             Project: Pig
>          Issue Type: Bug
>          Components: impl
>    Affects Versions: 0.1.0
>            Reporter: Benjamin Francisoud
>            Priority: Minor
>         Attachments: PIG-100-tests.log, PIG-100-v01.patch, PIG-100-v02.patch
>
>
> I think the root problem was that I forget to specify the configuration using -Djunit.hadoop.conf=hadoop-site.xml while running the tests.
> But the error could be clearer...
> The logs are big so I will provide them in a separate file...
> But the core problem is:
> {noformat}
>     [junit] java.lang.NullPointerException
>     [junit] 	at org.apache.pig.impl.logicalLayer.parser.QueryParser.Alias(QueryParser.java:471)
>     [junit] 	at org.apache.pig.impl.logicalLayer.parser.QueryParser.NestedExpr(QueryParser.java:411)
>     [junit] 	at org.apache.pig.impl.logicalLayer.parser.QueryParser.NestedExpr(QueryParser.java:417)
>     [junit] 	at org.apache.pig.impl.logicalLayer.parser.QueryParser.GroupItem(QueryParser.java:1027)
> ...
>     [junit] org.apache.pig.impl.logicalLayer.parser.ParseException: Encountered "group" at line 1, column 9.
>     [junit] Was expecting one of:
>     [junit]     <IDENTIFIER> ...
>     [junit]     "(" ...
>     [junit]     
>     [junit] 	at org.apache.pig.impl.logicalLayer.parser.QueryParser.generateParseException(QueryParser.java:4142)
> ...
>     [junit] org.apache.pig.impl.logicalLayer.parser.ParseException: Encountered "generate" at line 1, column 1.
>     [junit] Was expecting one of:
>     [junit]     "load" ...
>     [junit]     "filter" ...
> {noformat}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (PIG-100) Tests: NullPointerException parser.QueryParser.Alias(QueryParser.java:471)

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

Johannes Zillmann commented on PIG-100:
---------------------------------------

I would like to vote for the half of the current patch!
The changes in LogicalPlanBuilder i would omit, but he changes in QueryParser.jjt are very useful i think. 
WDYT ?

> Tests: NullPointerException parser.QueryParser.Alias(QueryParser.java:471)
> --------------------------------------------------------------------------
>
>                 Key: PIG-100
>                 URL: https://issues.apache.org/jira/browse/PIG-100
>             Project: Pig
>          Issue Type: Bug
>          Components: impl
>    Affects Versions: 0.1.0
>            Reporter: Benjamin Francisoud
>            Priority: Minor
>         Attachments: PIG-100-tests.log, PIG-100-v01.patch, PIG-100-v02.patch
>
>
> I think the root problem was that I forget to specify the configuration using -Djunit.hadoop.conf=hadoop-site.xml while running the tests.
> But the error could be clearer...
> The logs are big so I will provide them in a separate file...
> But the core problem is:
> {noformat}
>     [junit] java.lang.NullPointerException
>     [junit] 	at org.apache.pig.impl.logicalLayer.parser.QueryParser.Alias(QueryParser.java:471)
>     [junit] 	at org.apache.pig.impl.logicalLayer.parser.QueryParser.NestedExpr(QueryParser.java:411)
>     [junit] 	at org.apache.pig.impl.logicalLayer.parser.QueryParser.NestedExpr(QueryParser.java:417)
>     [junit] 	at org.apache.pig.impl.logicalLayer.parser.QueryParser.GroupItem(QueryParser.java:1027)
> ...
>     [junit] org.apache.pig.impl.logicalLayer.parser.ParseException: Encountered "group" at line 1, column 9.
>     [junit] Was expecting one of:
>     [junit]     <IDENTIFIER> ...
>     [junit]     "(" ...
>     [junit]     
>     [junit] 	at org.apache.pig.impl.logicalLayer.parser.QueryParser.generateParseException(QueryParser.java:4142)
> ...
>     [junit] org.apache.pig.impl.logicalLayer.parser.ParseException: Encountered "generate" at line 1, column 1.
>     [junit] Was expecting one of:
>     [junit]     "load" ...
>     [junit]     "filter" ...
> {noformat}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (PIG-100) Tests: NullPointerException parser.QueryParser.Alias(QueryParser.java:471)

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

Benjamin Francisoud updated PIG-100:
------------------------------------

    Patch Info: [Patch Available]

> Tests: NullPointerException parser.QueryParser.Alias(QueryParser.java:471)
> --------------------------------------------------------------------------
>
>                 Key: PIG-100
>                 URL: https://issues.apache.org/jira/browse/PIG-100
>             Project: Pig
>          Issue Type: Bug
>          Components: impl
>    Affects Versions: 0.1.0
>            Reporter: Benjamin Francisoud
>            Priority: Minor
>         Attachments: PIG-100-tests.log, PIG-100-v01.patch, PIG-100-v02.patch
>
>
> I think the root problem was that I forget to specify the configuration using -Djunit.hadoop.conf=hadoop-site.xml while running the tests.
> But the error could be clearer...
> The logs are big so I will provide them in a separate file...
> But the core problem is:
> {noformat}
>     [junit] java.lang.NullPointerException
>     [junit] 	at org.apache.pig.impl.logicalLayer.parser.QueryParser.Alias(QueryParser.java:471)
>     [junit] 	at org.apache.pig.impl.logicalLayer.parser.QueryParser.NestedExpr(QueryParser.java:411)
>     [junit] 	at org.apache.pig.impl.logicalLayer.parser.QueryParser.NestedExpr(QueryParser.java:417)
>     [junit] 	at org.apache.pig.impl.logicalLayer.parser.QueryParser.GroupItem(QueryParser.java:1027)
> ...
>     [junit] org.apache.pig.impl.logicalLayer.parser.ParseException: Encountered "group" at line 1, column 9.
>     [junit] Was expecting one of:
>     [junit]     <IDENTIFIER> ...
>     [junit]     "(" ...
>     [junit]     
>     [junit] 	at org.apache.pig.impl.logicalLayer.parser.QueryParser.generateParseException(QueryParser.java:4142)
> ...
>     [junit] org.apache.pig.impl.logicalLayer.parser.ParseException: Encountered "generate" at line 1, column 1.
>     [junit] Was expecting one of:
>     [junit]     "load" ...
>     [junit]     "filter" ...
> {noformat}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (PIG-100) Tests: NullPointerException parser.QueryParser.Alias(QueryParser.java:471)

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

Olga Natkovich updated PIG-100:
-------------------------------

    Patch Info:   (was: [Patch Available])

Cleared "patch available" flag as this would need to be reworked once we agree on general error handling for pig

> Tests: NullPointerException parser.QueryParser.Alias(QueryParser.java:471)
> --------------------------------------------------------------------------
>
>                 Key: PIG-100
>                 URL: https://issues.apache.org/jira/browse/PIG-100
>             Project: Pig
>          Issue Type: Bug
>          Components: impl
>    Affects Versions: 0.1.0
>            Reporter: Benjamin Francisoud
>            Priority: Minor
>         Attachments: PIG-100-tests.log, PIG-100-v01.patch, PIG-100-v02.patch
>
>
> I think the root problem was that I forget to specify the configuration using -Djunit.hadoop.conf=hadoop-site.xml while running the tests.
> But the error could be clearer...
> The logs are big so I will provide them in a separate file...
> But the core problem is:
> {noformat}
>     [junit] java.lang.NullPointerException
>     [junit] 	at org.apache.pig.impl.logicalLayer.parser.QueryParser.Alias(QueryParser.java:471)
>     [junit] 	at org.apache.pig.impl.logicalLayer.parser.QueryParser.NestedExpr(QueryParser.java:411)
>     [junit] 	at org.apache.pig.impl.logicalLayer.parser.QueryParser.NestedExpr(QueryParser.java:417)
>     [junit] 	at org.apache.pig.impl.logicalLayer.parser.QueryParser.GroupItem(QueryParser.java:1027)
> ...
>     [junit] org.apache.pig.impl.logicalLayer.parser.ParseException: Encountered "group" at line 1, column 9.
>     [junit] Was expecting one of:
>     [junit]     <IDENTIFIER> ...
>     [junit]     "(" ...
>     [junit]     
>     [junit] 	at org.apache.pig.impl.logicalLayer.parser.QueryParser.generateParseException(QueryParser.java:4142)
> ...
>     [junit] org.apache.pig.impl.logicalLayer.parser.ParseException: Encountered "generate" at line 1, column 1.
>     [junit] Was expecting one of:
>     [junit]     "load" ...
>     [junit]     "filter" ...
> {noformat}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Issue Comment Edited: (PIG-100) Tests: NullPointerException parser.QueryParser.Alias(QueryParser.java:471)

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

oae edited comment on PIG-100 at 3/3/08 9:29 AM:
---------------------------------------------------------------

Hi Benjamin, i think doing
{noformat}
try {
    plan = parser.Parse();
} catch (ParseException e) {
    log.error(e.getMessage());
    log.debug(e);
}
{noformat}
is fine. But not in LogicalPlanBuilder, better somewhere in Grunt.
I think the duplicate logging could be avoided with something like:
{noformat}
if(log.isDebugEnabled()){
    log.error(e.getMessage(), e);
}{
   log.error(e.getMessage());
}
{noformat}

      was (Author: oae):
    Hi Benjamin, i think doing
{noformat}
try {
    plan = parser.Parse();
} catch (ParseException e) {
    log.error(e.getMessage());
    log.debug(e);
}
{noformat}
is fine. But not in LogicalPlanBuilder, better somewhere in Grunt.
I think the duplicate logging could be avoided with something like:
if(log.isDebugEnabled()){
    log.error(e.getMessage(), e);
}{
   log.error(e.getMessage());
}
  
> Tests: NullPointerException parser.QueryParser.Alias(QueryParser.java:471)
> --------------------------------------------------------------------------
>
>                 Key: PIG-100
>                 URL: https://issues.apache.org/jira/browse/PIG-100
>             Project: Pig
>          Issue Type: Bug
>          Components: impl
>    Affects Versions: 0.1.0
>            Reporter: Benjamin Francisoud
>            Priority: Minor
>         Attachments: PIG-100-tests.log, PIG-100-v01.patch, PIG-100-v02.patch
>
>
> I think the root problem was that I forget to specify the configuration using -Djunit.hadoop.conf=hadoop-site.xml while running the tests.
> But the error could be clearer...
> The logs are big so I will provide them in a separate file...
> But the core problem is:
> {noformat}
>     [junit] java.lang.NullPointerException
>     [junit] 	at org.apache.pig.impl.logicalLayer.parser.QueryParser.Alias(QueryParser.java:471)
>     [junit] 	at org.apache.pig.impl.logicalLayer.parser.QueryParser.NestedExpr(QueryParser.java:411)
>     [junit] 	at org.apache.pig.impl.logicalLayer.parser.QueryParser.NestedExpr(QueryParser.java:417)
>     [junit] 	at org.apache.pig.impl.logicalLayer.parser.QueryParser.GroupItem(QueryParser.java:1027)
> ...
>     [junit] org.apache.pig.impl.logicalLayer.parser.ParseException: Encountered "group" at line 1, column 9.
>     [junit] Was expecting one of:
>     [junit]     <IDENTIFIER> ...
>     [junit]     "(" ...
>     [junit]     
>     [junit] 	at org.apache.pig.impl.logicalLayer.parser.QueryParser.generateParseException(QueryParser.java:4142)
> ...
>     [junit] org.apache.pig.impl.logicalLayer.parser.ParseException: Encountered "generate" at line 1, column 1.
>     [junit] Was expecting one of:
>     [junit]     "load" ...
>     [junit]     "filter" ...
> {noformat}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (PIG-100) Tests: NullPointerException parser.QueryParser.Alias(QueryParser.java:471)

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

Olga Natkovich commented on PIG-100:
------------------------------------

I agree with Johanes. This should be done outside of PigServer class so that the caller can make the choices of how to deal with the problem.

> Tests: NullPointerException parser.QueryParser.Alias(QueryParser.java:471)
> --------------------------------------------------------------------------
>
>                 Key: PIG-100
>                 URL: https://issues.apache.org/jira/browse/PIG-100
>             Project: Pig
>          Issue Type: Bug
>          Components: impl
>    Affects Versions: 0.1.0
>            Reporter: Benjamin Francisoud
>            Priority: Minor
>         Attachments: PIG-100-tests.log, PIG-100-v01.patch, PIG-100-v02.patch
>
>
> I think the root problem was that I forget to specify the configuration using -Djunit.hadoop.conf=hadoop-site.xml while running the tests.
> But the error could be clearer...
> The logs are big so I will provide them in a separate file...
> But the core problem is:
> {noformat}
>     [junit] java.lang.NullPointerException
>     [junit] 	at org.apache.pig.impl.logicalLayer.parser.QueryParser.Alias(QueryParser.java:471)
>     [junit] 	at org.apache.pig.impl.logicalLayer.parser.QueryParser.NestedExpr(QueryParser.java:411)
>     [junit] 	at org.apache.pig.impl.logicalLayer.parser.QueryParser.NestedExpr(QueryParser.java:417)
>     [junit] 	at org.apache.pig.impl.logicalLayer.parser.QueryParser.GroupItem(QueryParser.java:1027)
> ...
>     [junit] org.apache.pig.impl.logicalLayer.parser.ParseException: Encountered "group" at line 1, column 9.
>     [junit] Was expecting one of:
>     [junit]     <IDENTIFIER> ...
>     [junit]     "(" ...
>     [junit]     
>     [junit] 	at org.apache.pig.impl.logicalLayer.parser.QueryParser.generateParseException(QueryParser.java:4142)
> ...
>     [junit] org.apache.pig.impl.logicalLayer.parser.ParseException: Encountered "generate" at line 1, column 1.
>     [junit] Was expecting one of:
>     [junit]     "load" ...
>     [junit]     "filter" ...
> {noformat}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (PIG-100) Tests: NullPointerException parser.QueryParser.Alias(QueryParser.java:471)

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

Olga Natkovich updated PIG-100:
-------------------------------

    Patch Info:   (was: [Patch Available])

cleared "patch available" flag since I would like to see just an error message and no exception for user syntax error

> Tests: NullPointerException parser.QueryParser.Alias(QueryParser.java:471)
> --------------------------------------------------------------------------
>
>                 Key: PIG-100
>                 URL: https://issues.apache.org/jira/browse/PIG-100
>             Project: Pig
>          Issue Type: Bug
>          Components: impl
>    Affects Versions: 0.1.0
>            Reporter: Benjamin Francisoud
>            Priority: Minor
>         Attachments: PIG-100-tests.log, PIG-100-v01.patch
>
>
> I think the root problem was that I forget to specify the configuration using -Djunit.hadoop.conf=hadoop-site.xml while running the tests.
> But the error could be clearer...
> The logs are big so I will provide them in a separate file...
> But the core problem is:
> {noformat}
>     [junit] java.lang.NullPointerException
>     [junit] 	at org.apache.pig.impl.logicalLayer.parser.QueryParser.Alias(QueryParser.java:471)
>     [junit] 	at org.apache.pig.impl.logicalLayer.parser.QueryParser.NestedExpr(QueryParser.java:411)
>     [junit] 	at org.apache.pig.impl.logicalLayer.parser.QueryParser.NestedExpr(QueryParser.java:417)
>     [junit] 	at org.apache.pig.impl.logicalLayer.parser.QueryParser.GroupItem(QueryParser.java:1027)
> ...
>     [junit] org.apache.pig.impl.logicalLayer.parser.ParseException: Encountered "group" at line 1, column 9.
>     [junit] Was expecting one of:
>     [junit]     <IDENTIFIER> ...
>     [junit]     "(" ...
>     [junit]     
>     [junit] 	at org.apache.pig.impl.logicalLayer.parser.QueryParser.generateParseException(QueryParser.java:4142)
> ...
>     [junit] org.apache.pig.impl.logicalLayer.parser.ParseException: Encountered "generate" at line 1, column 1.
>     [junit] Was expecting one of:
>     [junit]     "load" ...
>     [junit]     "filter" ...
> {noformat}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (PIG-100) Tests: NullPointerException parser.QueryParser.Alias(QueryParser.java:471)

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

Benjamin Francisoud updated PIG-100:
------------------------------------

    Attachment: PIG-100-tests.log

> Tests: NullPointerException parser.QueryParser.Alias(QueryParser.java:471)
> --------------------------------------------------------------------------
>
>                 Key: PIG-100
>                 URL: https://issues.apache.org/jira/browse/PIG-100
>             Project: Pig
>          Issue Type: Bug
>          Components: impl
>    Affects Versions: 0.1.0
>            Reporter: Benjamin Francisoud
>            Priority: Minor
>         Attachments: PIG-100-tests.log
>
>
> I think the root problem was that I forget to specify the configuration using -Djunit.hadoop.conf=hadoop-site.xml while running the tests.
> But the error could be clearer...
> The logs are big so I will provide them in a separate file...
> But the core problem is:
> {noformat}
>     [junit] java.lang.NullPointerException
>     [junit] 	at org.apache.pig.impl.logicalLayer.parser.QueryParser.Alias(QueryParser.java:471)
>     [junit] 	at org.apache.pig.impl.logicalLayer.parser.QueryParser.NestedExpr(QueryParser.java:411)
>     [junit] 	at org.apache.pig.impl.logicalLayer.parser.QueryParser.NestedExpr(QueryParser.java:417)
>     [junit] 	at org.apache.pig.impl.logicalLayer.parser.QueryParser.GroupItem(QueryParser.java:1027)
> ...
>     [junit] org.apache.pig.impl.logicalLayer.parser.ParseException: Encountered "group" at line 1, column 9.
>     [junit] Was expecting one of:
>     [junit]     <IDENTIFIER> ...
>     [junit]     "(" ...
>     [junit]     
>     [junit] 	at org.apache.pig.impl.logicalLayer.parser.QueryParser.generateParseException(QueryParser.java:4142)
> ...
>     [junit] org.apache.pig.impl.logicalLayer.parser.ParseException: Encountered "generate" at line 1, column 1.
>     [junit] Was expecting one of:
>     [junit]     "load" ...
>     [junit]     "filter" ...
> {noformat}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (PIG-100) Tests: NullPointerException parser.QueryParser.Alias(QueryParser.java:471)

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

Benjamin Francisoud updated PIG-100:
------------------------------------

    Attachment: PIG-100-v03-tabs.patch

Same patch as v1 (contains only QueryParser.jjt modification) against latest trunk revision.
I made 2 versions of patch v03
* 'PIG-100-v03-tabs.patch' use tabs for indentation (like the rest of the file)
* 'PIG-100-v03-spaces.patch' use spaces like pig code convention but is not consistent with the rest of the QueryParser.jjt

pick your favorite patch ;)

> Tests: NullPointerException parser.QueryParser.Alias(QueryParser.java:471)
> --------------------------------------------------------------------------
>
>                 Key: PIG-100
>                 URL: https://issues.apache.org/jira/browse/PIG-100
>             Project: Pig
>          Issue Type: Bug
>          Components: impl
>    Affects Versions: 0.1.0
>            Reporter: Benjamin Francisoud
>            Priority: Minor
>         Attachments: PIG-100-tests.log, PIG-100-v01.patch, PIG-100-v02.patch, PIG-100-v03-spaces.patch, PIG-100-v03-tabs.patch
>
>
> I think the root problem was that I forget to specify the configuration using -Djunit.hadoop.conf=hadoop-site.xml while running the tests.
> But the error could be clearer...
> The logs are big so I will provide them in a separate file...
> But the core problem is:
> {noformat}
>     [junit] java.lang.NullPointerException
>     [junit] 	at org.apache.pig.impl.logicalLayer.parser.QueryParser.Alias(QueryParser.java:471)
>     [junit] 	at org.apache.pig.impl.logicalLayer.parser.QueryParser.NestedExpr(QueryParser.java:411)
>     [junit] 	at org.apache.pig.impl.logicalLayer.parser.QueryParser.NestedExpr(QueryParser.java:417)
>     [junit] 	at org.apache.pig.impl.logicalLayer.parser.QueryParser.GroupItem(QueryParser.java:1027)
> ...
>     [junit] org.apache.pig.impl.logicalLayer.parser.ParseException: Encountered "group" at line 1, column 9.
>     [junit] Was expecting one of:
>     [junit]     <IDENTIFIER> ...
>     [junit]     "(" ...
>     [junit]     
>     [junit] 	at org.apache.pig.impl.logicalLayer.parser.QueryParser.generateParseException(QueryParser.java:4142)
> ...
>     [junit] org.apache.pig.impl.logicalLayer.parser.ParseException: Encountered "generate" at line 1, column 1.
>     [junit] Was expecting one of:
>     [junit]     "load" ...
>     [junit]     "filter" ...
> {noformat}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (PIG-100) Tests: NullPointerException parser.QueryParser.Alias(QueryParser.java:471)

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

Olga Natkovich commented on PIG-100:
------------------------------------

Pi, this issue is about missing alias. You might want to open a separate on for configuration verification. Thanks

> Tests: NullPointerException parser.QueryParser.Alias(QueryParser.java:471)
> --------------------------------------------------------------------------
>
>                 Key: PIG-100
>                 URL: https://issues.apache.org/jira/browse/PIG-100
>             Project: Pig
>          Issue Type: Bug
>          Components: impl
>    Affects Versions: 0.1.0
>            Reporter: Benjamin Francisoud
>            Priority: Minor
>         Attachments: PIG-100-tests.log, PIG-100-v01.patch, PIG-100-v02.patch
>
>
> I think the root problem was that I forget to specify the configuration using -Djunit.hadoop.conf=hadoop-site.xml while running the tests.
> But the error could be clearer...
> The logs are big so I will provide them in a separate file...
> But the core problem is:
> {noformat}
>     [junit] java.lang.NullPointerException
>     [junit] 	at org.apache.pig.impl.logicalLayer.parser.QueryParser.Alias(QueryParser.java:471)
>     [junit] 	at org.apache.pig.impl.logicalLayer.parser.QueryParser.NestedExpr(QueryParser.java:411)
>     [junit] 	at org.apache.pig.impl.logicalLayer.parser.QueryParser.NestedExpr(QueryParser.java:417)
>     [junit] 	at org.apache.pig.impl.logicalLayer.parser.QueryParser.GroupItem(QueryParser.java:1027)
> ...
>     [junit] org.apache.pig.impl.logicalLayer.parser.ParseException: Encountered "group" at line 1, column 9.
>     [junit] Was expecting one of:
>     [junit]     <IDENTIFIER> ...
>     [junit]     "(" ...
>     [junit]     
>     [junit] 	at org.apache.pig.impl.logicalLayer.parser.QueryParser.generateParseException(QueryParser.java:4142)
> ...
>     [junit] org.apache.pig.impl.logicalLayer.parser.ParseException: Encountered "generate" at line 1, column 1.
>     [junit] Was expecting one of:
>     [junit]     "load" ...
>     [junit]     "filter" ...
> {noformat}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Issue Comment Edited: (PIG-100) Tests: NullPointerException parser.QueryParser.Alias(QueryParser.java:471)

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

francisoud edited comment on PIG-100 at 3/5/08 5:16 AM:
-----------------------------------------------------------------

Johannes> it's funny because it's exactly PIG-100-v01.patch ;)
I suppose PIG-100-v01.patch will conflict with latest svn revision so I will regenerate it.

      was (Author: francisoud):
    Johannes> it's funny because it's exactly PIG-100-v01.patch ;)
I suppose PIG-100-v01.patch will conflict with latest svn reveision so I will regenerate it.
  
> Tests: NullPointerException parser.QueryParser.Alias(QueryParser.java:471)
> --------------------------------------------------------------------------
>
>                 Key: PIG-100
>                 URL: https://issues.apache.org/jira/browse/PIG-100
>             Project: Pig
>          Issue Type: Bug
>          Components: impl
>    Affects Versions: 0.1.0
>            Reporter: Benjamin Francisoud
>            Priority: Minor
>         Attachments: PIG-100-tests.log, PIG-100-v01.patch, PIG-100-v02.patch, PIG-100-v03-spaces.patch, PIG-100-v03-tabs.patch
>
>
> I think the root problem was that I forget to specify the configuration using -Djunit.hadoop.conf=hadoop-site.xml while running the tests.
> But the error could be clearer...
> The logs are big so I will provide them in a separate file...
> But the core problem is:
> {noformat}
>     [junit] java.lang.NullPointerException
>     [junit] 	at org.apache.pig.impl.logicalLayer.parser.QueryParser.Alias(QueryParser.java:471)
>     [junit] 	at org.apache.pig.impl.logicalLayer.parser.QueryParser.NestedExpr(QueryParser.java:411)
>     [junit] 	at org.apache.pig.impl.logicalLayer.parser.QueryParser.NestedExpr(QueryParser.java:417)
>     [junit] 	at org.apache.pig.impl.logicalLayer.parser.QueryParser.GroupItem(QueryParser.java:1027)
> ...
>     [junit] org.apache.pig.impl.logicalLayer.parser.ParseException: Encountered "group" at line 1, column 9.
>     [junit] Was expecting one of:
>     [junit]     <IDENTIFIER> ...
>     [junit]     "(" ...
>     [junit]     
>     [junit] 	at org.apache.pig.impl.logicalLayer.parser.QueryParser.generateParseException(QueryParser.java:4142)
> ...
>     [junit] org.apache.pig.impl.logicalLayer.parser.ParseException: Encountered "generate" at line 1, column 1.
>     [junit] Was expecting one of:
>     [junit]     "load" ...
>     [junit]     "filter" ...
> {noformat}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (PIG-100) Tests: NullPointerException parser.QueryParser.Alias(QueryParser.java:471)

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

Johannes Zillmann commented on PIG-100:
---------------------------------------

Hi Benjamin, i think doing
{noformat}
try {
    plan = parser.Parse();
} catch (ParseException e) {
    log.error(e.getMessage());
    log.debug(e);
}
{noformat}
is fine. But not in LogicalPlanBuilder, better somewhere in Grunt.
I think the duplicate logging could be avoided with something like:
if(log.isDebugEnabled()){
    log.error(e.getMessage(), e);
}{
   log.error(e.getMessage());
}

> Tests: NullPointerException parser.QueryParser.Alias(QueryParser.java:471)
> --------------------------------------------------------------------------
>
>                 Key: PIG-100
>                 URL: https://issues.apache.org/jira/browse/PIG-100
>             Project: Pig
>          Issue Type: Bug
>          Components: impl
>    Affects Versions: 0.1.0
>            Reporter: Benjamin Francisoud
>            Priority: Minor
>         Attachments: PIG-100-tests.log, PIG-100-v01.patch, PIG-100-v02.patch
>
>
> I think the root problem was that I forget to specify the configuration using -Djunit.hadoop.conf=hadoop-site.xml while running the tests.
> But the error could be clearer...
> The logs are big so I will provide them in a separate file...
> But the core problem is:
> {noformat}
>     [junit] java.lang.NullPointerException
>     [junit] 	at org.apache.pig.impl.logicalLayer.parser.QueryParser.Alias(QueryParser.java:471)
>     [junit] 	at org.apache.pig.impl.logicalLayer.parser.QueryParser.NestedExpr(QueryParser.java:411)
>     [junit] 	at org.apache.pig.impl.logicalLayer.parser.QueryParser.NestedExpr(QueryParser.java:417)
>     [junit] 	at org.apache.pig.impl.logicalLayer.parser.QueryParser.GroupItem(QueryParser.java:1027)
> ...
>     [junit] org.apache.pig.impl.logicalLayer.parser.ParseException: Encountered "group" at line 1, column 9.
>     [junit] Was expecting one of:
>     [junit]     <IDENTIFIER> ...
>     [junit]     "(" ...
>     [junit]     
>     [junit] 	at org.apache.pig.impl.logicalLayer.parser.QueryParser.generateParseException(QueryParser.java:4142)
> ...
>     [junit] org.apache.pig.impl.logicalLayer.parser.ParseException: Encountered "generate" at line 1, column 1.
>     [junit] Was expecting one of:
>     [junit]     "load" ...
>     [junit]     "filter" ...
> {noformat}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (PIG-100) Tests: NullPointerException parser.QueryParser.Alias(QueryParser.java:471)

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

Benjamin Francisoud commented on PIG-100:
-----------------------------------------

Johannes would you prefer this ? (added throw)
{code:java}
try {
    plan = parser.Parse();
} catch (ParseException e) {
    log.error(e.getMessage());
    log.debug(e);
    throw e;
}
{code}
About the double logging, I proposed this because:
* Stefan (and I ;) )wanted the full stacktrace
* Olga wanted a small user friendly message

The message will be logged twice and will look like (if DEBUG level is use for logs): 
{noformat}
[time] [class] Unable to find alias: 'A' - aliases: ''
[time] [class] org.apache.pig.impl.logicalLayer.parser.ParseException: Unable to find alias: 'A' - aliases: ''
	at org.apache.pig.impl.logicalLayer.parser.QueryParser.Alias(QueryParser.java:484)
	at org.apache.pig.impl.logicalLayer.parser.QueryParser.NestedExpr(QueryParser.java:411)
	at org.apache.pig.impl.logicalLayer.parser.QueryParser.NestedExpr(QueryParser.java:417)
	at org.apache.pig.impl.logicalLayer.parser.QueryParser.GroupItem(QueryParser.java:1043)
	at org.apache.pig.impl.logicalLayer.parser.QueryParser.CogroupClause(QueryParser.java:996)
	at org.apache.pig.impl.logicalLayer.parser.QueryParser.BaseExpr(QueryParser.java:537)
...
{noformat}

It will look like this (if log level is ERROR, usually in a production environment):
{noformat}
[time] [class] Unable to find alias: 'A' - aliases: ''
{noformat}

Johannes, do you prefer this ? Do you have something else in mind ?

> Tests: NullPointerException parser.QueryParser.Alias(QueryParser.java:471)
> --------------------------------------------------------------------------
>
>                 Key: PIG-100
>                 URL: https://issues.apache.org/jira/browse/PIG-100
>             Project: Pig
>          Issue Type: Bug
>          Components: impl
>    Affects Versions: 0.1.0
>            Reporter: Benjamin Francisoud
>            Priority: Minor
>         Attachments: PIG-100-tests.log, PIG-100-v01.patch, PIG-100-v02.patch
>
>
> I think the root problem was that I forget to specify the configuration using -Djunit.hadoop.conf=hadoop-site.xml while running the tests.
> But the error could be clearer...
> The logs are big so I will provide them in a separate file...
> But the core problem is:
> {noformat}
>     [junit] java.lang.NullPointerException
>     [junit] 	at org.apache.pig.impl.logicalLayer.parser.QueryParser.Alias(QueryParser.java:471)
>     [junit] 	at org.apache.pig.impl.logicalLayer.parser.QueryParser.NestedExpr(QueryParser.java:411)
>     [junit] 	at org.apache.pig.impl.logicalLayer.parser.QueryParser.NestedExpr(QueryParser.java:417)
>     [junit] 	at org.apache.pig.impl.logicalLayer.parser.QueryParser.GroupItem(QueryParser.java:1027)
> ...
>     [junit] org.apache.pig.impl.logicalLayer.parser.ParseException: Encountered "group" at line 1, column 9.
>     [junit] Was expecting one of:
>     [junit]     <IDENTIFIER> ...
>     [junit]     "(" ...
>     [junit]     
>     [junit] 	at org.apache.pig.impl.logicalLayer.parser.QueryParser.generateParseException(QueryParser.java:4142)
> ...
>     [junit] org.apache.pig.impl.logicalLayer.parser.ParseException: Encountered "generate" at line 1, column 1.
>     [junit] Was expecting one of:
>     [junit]     "load" ...
>     [junit]     "filter" ...
> {noformat}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (PIG-100) Tests: NullPointerException parser.QueryParser.Alias(QueryParser.java:471)

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

Benjamin Francisoud updated PIG-100:
------------------------------------

    Attachment: PIG-100-v01.patch

This wasn't related to the fact that I didn't provide the hadoop-site.xml
The test is checking how the parser handle pasing exception (which is great).
But the error message (a null pointer) can be improve to provide feedback to the user why the parsing failed.

This patch add a better error handling and more important a better error message when an alias is not find in the aliases list.

Modified QueryParser.jjt

Now the error message looks like:
{noformat}
org.apache.pig.impl.logicalLayer.parser.ParseException: Unable to find alias: 'A' - aliases: ''
	at org.apache.pig.impl.logicalLayer.parser.QueryParser.Alias(QueryParser.java:484)
	at org.apache.pig.impl.logicalLayer.parser.QueryParser.NestedExpr(QueryParser.java:411)
	at org.apache.pig.impl.logicalLayer.parser.QueryParser.NestedExpr(QueryParser.java:417)
	at org.apache.pig.impl.logicalLayer.parser.QueryParser.GroupItem(QueryParser.java:1043)
	at org.apache.pig.impl.logicalLayer.parser.QueryParser.CogroupClause(QueryParser.java:996)
	at org.apache.pig.impl.logicalLayer.parser.QueryParser.BaseExpr(QueryParser.java:537)
	at org.apache.pig.impl.logicalLayer.parser.QueryParser.NestedExpr(QueryParser.java:423)
	at org.apache.pig.impl.logicalLayer.parser.QueryParser.ForEachClause(QueryParser.java:1364)
	at org.apache.pig.impl.logicalLayer.parser.QueryParser.BaseExpr(QueryParser.java:566)
	at org.apache.pig.impl.logicalLayer.parser.QueryParser.Expr(QueryParser.java:371)
	at org.apache.pig.impl.logicalLayer.parser.QueryParser.Parse(QueryParser.java:244)
	at org.apache.pig.impl.logicalLayer.LogicalPlanBuilder.parse(LogicalPlanBuilder.java:47)
	at org.apache.pig.test.TestLogicalPlanBuilder.buildPlan(TestLogicalPlanBuilder.java:544)
	at org.apache.pig.test.TestLogicalPlanBuilder.buildPlan(TestLogicalPlanBuilder.java:535)
	at org.apache.pig.test.TestLogicalPlanBuilder.testQueryFail1(TestLogicalPlanBuilder.java:133)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at junit.framework.TestCase.runTest(TestCase.java:164)
	at junit.framework.TestCase.runBare(TestCase.java:130)
	at junit.framework.TestResult$1.protect(TestResult.java:110)
	at junit.framework.TestResult.runProtected(TestResult.java:128)
	at junit.framework.TestResult.run(TestResult.java:113)
	at junit.framework.TestCase.run(TestCase.java:120)
	at junit.framework.TestSuite.runTest(TestSuite.java:228)
	at junit.framework.TestSuite.run(TestSuite.java:223)
	at org.junit.internal.runners.OldTestClassRunner.run(OldTestClassRunner.java:35)
	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:38)
	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
{noformat}

> Tests: NullPointerException parser.QueryParser.Alias(QueryParser.java:471)
> --------------------------------------------------------------------------
>
>                 Key: PIG-100
>                 URL: https://issues.apache.org/jira/browse/PIG-100
>             Project: Pig
>          Issue Type: Bug
>          Components: impl
>    Affects Versions: 0.1.0
>            Reporter: Benjamin Francisoud
>            Priority: Minor
>         Attachments: PIG-100-tests.log, PIG-100-v01.patch
>
>
> I think the root problem was that I forget to specify the configuration using -Djunit.hadoop.conf=hadoop-site.xml while running the tests.
> But the error could be clearer...
> The logs are big so I will provide them in a separate file...
> But the core problem is:
> {noformat}
>     [junit] java.lang.NullPointerException
>     [junit] 	at org.apache.pig.impl.logicalLayer.parser.QueryParser.Alias(QueryParser.java:471)
>     [junit] 	at org.apache.pig.impl.logicalLayer.parser.QueryParser.NestedExpr(QueryParser.java:411)
>     [junit] 	at org.apache.pig.impl.logicalLayer.parser.QueryParser.NestedExpr(QueryParser.java:417)
>     [junit] 	at org.apache.pig.impl.logicalLayer.parser.QueryParser.GroupItem(QueryParser.java:1027)
> ...
>     [junit] org.apache.pig.impl.logicalLayer.parser.ParseException: Encountered "group" at line 1, column 9.
>     [junit] Was expecting one of:
>     [junit]     <IDENTIFIER> ...
>     [junit]     "(" ...
>     [junit]     
>     [junit] 	at org.apache.pig.impl.logicalLayer.parser.QueryParser.generateParseException(QueryParser.java:4142)
> ...
>     [junit] org.apache.pig.impl.logicalLayer.parser.ParseException: Encountered "generate" at line 1, column 1.
>     [junit] Was expecting one of:
>     [junit]     "load" ...
>     [junit]     "filter" ...
> {noformat}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (PIG-100) Tests: NullPointerException parser.QueryParser.Alias(QueryParser.java:471)

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

Pi Song commented on PIG-100:
-----------------------------

Benjamin's proposed solution sounds good to me. If you don't like the full stack trace, you can turn it off.

> Tests: NullPointerException parser.QueryParser.Alias(QueryParser.java:471)
> --------------------------------------------------------------------------
>
>                 Key: PIG-100
>                 URL: https://issues.apache.org/jira/browse/PIG-100
>             Project: Pig
>          Issue Type: Bug
>          Components: impl
>    Affects Versions: 0.1.0
>            Reporter: Benjamin Francisoud
>            Priority: Minor
>         Attachments: PIG-100-tests.log, PIG-100-v01.patch, PIG-100-v02.patch
>
>
> I think the root problem was that I forget to specify the configuration using -Djunit.hadoop.conf=hadoop-site.xml while running the tests.
> But the error could be clearer...
> The logs are big so I will provide them in a separate file...
> But the core problem is:
> {noformat}
>     [junit] java.lang.NullPointerException
>     [junit] 	at org.apache.pig.impl.logicalLayer.parser.QueryParser.Alias(QueryParser.java:471)
>     [junit] 	at org.apache.pig.impl.logicalLayer.parser.QueryParser.NestedExpr(QueryParser.java:411)
>     [junit] 	at org.apache.pig.impl.logicalLayer.parser.QueryParser.NestedExpr(QueryParser.java:417)
>     [junit] 	at org.apache.pig.impl.logicalLayer.parser.QueryParser.GroupItem(QueryParser.java:1027)
> ...
>     [junit] org.apache.pig.impl.logicalLayer.parser.ParseException: Encountered "group" at line 1, column 9.
>     [junit] Was expecting one of:
>     [junit]     <IDENTIFIER> ...
>     [junit]     "(" ...
>     [junit]     
>     [junit] 	at org.apache.pig.impl.logicalLayer.parser.QueryParser.generateParseException(QueryParser.java:4142)
> ...
>     [junit] org.apache.pig.impl.logicalLayer.parser.ParseException: Encountered "generate" at line 1, column 1.
>     [junit] Was expecting one of:
>     [junit]     "load" ...
>     [junit]     "filter" ...
> {noformat}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (PIG-100) Tests: NullPointerException parser.QueryParser.Alias(QueryParser.java:471)

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

Stefan Groschupf commented on PIG-100:
--------------------------------------

Olga, 
there is always value in throwing an exception especially for such a young project as pig. 
Pig does in many cases a bad job in giving the user an idea of what is going on/ wrong. 
On the one hand side I can understand that there is an interestes  of not bordering users with stack traces. On the other hand side, users of pig are not end users but mostly developers. Showing stack traces will help to understand faster the problem - it will invite more developer to read the code - what will help to grow the contributor base of a open source project. What finally will help to iron out more issues faster.

There are endless debates about exception handling but from my experience throwing an exception and handle it as high as possible always help to improve code stability.
Fail early...
Just my 2 cents.

> Tests: NullPointerException parser.QueryParser.Alias(QueryParser.java:471)
> --------------------------------------------------------------------------
>
>                 Key: PIG-100
>                 URL: https://issues.apache.org/jira/browse/PIG-100
>             Project: Pig
>          Issue Type: Bug
>          Components: impl
>    Affects Versions: 0.1.0
>            Reporter: Benjamin Francisoud
>            Priority: Minor
>         Attachments: PIG-100-tests.log, PIG-100-v01.patch
>
>
> I think the root problem was that I forget to specify the configuration using -Djunit.hadoop.conf=hadoop-site.xml while running the tests.
> But the error could be clearer...
> The logs are big so I will provide them in a separate file...
> But the core problem is:
> {noformat}
>     [junit] java.lang.NullPointerException
>     [junit] 	at org.apache.pig.impl.logicalLayer.parser.QueryParser.Alias(QueryParser.java:471)
>     [junit] 	at org.apache.pig.impl.logicalLayer.parser.QueryParser.NestedExpr(QueryParser.java:411)
>     [junit] 	at org.apache.pig.impl.logicalLayer.parser.QueryParser.NestedExpr(QueryParser.java:417)
>     [junit] 	at org.apache.pig.impl.logicalLayer.parser.QueryParser.GroupItem(QueryParser.java:1027)
> ...
>     [junit] org.apache.pig.impl.logicalLayer.parser.ParseException: Encountered "group" at line 1, column 9.
>     [junit] Was expecting one of:
>     [junit]     <IDENTIFIER> ...
>     [junit]     "(" ...
>     [junit]     
>     [junit] 	at org.apache.pig.impl.logicalLayer.parser.QueryParser.generateParseException(QueryParser.java:4142)
> ...
>     [junit] org.apache.pig.impl.logicalLayer.parser.ParseException: Encountered "generate" at line 1, column 1.
>     [junit] Was expecting one of:
>     [junit]     "load" ...
>     [junit]     "filter" ...
> {noformat}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (PIG-100) Tests: NullPointerException parser.QueryParser.Alias(QueryParser.java:471)

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

Olga Natkovich commented on PIG-100:
------------------------------------

Benjamin, thanks for fixing this issue. Is there any value in actually throwing the exception? Seems like the error message should be sufficient in this case.

> Tests: NullPointerException parser.QueryParser.Alias(QueryParser.java:471)
> --------------------------------------------------------------------------
>
>                 Key: PIG-100
>                 URL: https://issues.apache.org/jira/browse/PIG-100
>             Project: Pig
>          Issue Type: Bug
>          Components: impl
>    Affects Versions: 0.1.0
>            Reporter: Benjamin Francisoud
>            Priority: Minor
>         Attachments: PIG-100-tests.log, PIG-100-v01.patch
>
>
> I think the root problem was that I forget to specify the configuration using -Djunit.hadoop.conf=hadoop-site.xml while running the tests.
> But the error could be clearer...
> The logs are big so I will provide them in a separate file...
> But the core problem is:
> {noformat}
>     [junit] java.lang.NullPointerException
>     [junit] 	at org.apache.pig.impl.logicalLayer.parser.QueryParser.Alias(QueryParser.java:471)
>     [junit] 	at org.apache.pig.impl.logicalLayer.parser.QueryParser.NestedExpr(QueryParser.java:411)
>     [junit] 	at org.apache.pig.impl.logicalLayer.parser.QueryParser.NestedExpr(QueryParser.java:417)
>     [junit] 	at org.apache.pig.impl.logicalLayer.parser.QueryParser.GroupItem(QueryParser.java:1027)
> ...
>     [junit] org.apache.pig.impl.logicalLayer.parser.ParseException: Encountered "group" at line 1, column 9.
>     [junit] Was expecting one of:
>     [junit]     <IDENTIFIER> ...
>     [junit]     "(" ...
>     [junit]     
>     [junit] 	at org.apache.pig.impl.logicalLayer.parser.QueryParser.generateParseException(QueryParser.java:4142)
> ...
>     [junit] org.apache.pig.impl.logicalLayer.parser.ParseException: Encountered "generate" at line 1, column 1.
>     [junit] Was expecting one of:
>     [junit]     "load" ...
>     [junit]     "filter" ...
> {noformat}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (PIG-100) Tests: NullPointerException parser.QueryParser.Alias(QueryParser.java:471)

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

Benjamin Francisoud commented on PIG-100:
-----------------------------------------

Johannes> it's funny because it's exactly PIG-100-v01.patch ;)
I suppose PIG-100-v01.patch will conflict with latest svn reveision so I will regenerate it.

> Tests: NullPointerException parser.QueryParser.Alias(QueryParser.java:471)
> --------------------------------------------------------------------------
>
>                 Key: PIG-100
>                 URL: https://issues.apache.org/jira/browse/PIG-100
>             Project: Pig
>          Issue Type: Bug
>          Components: impl
>    Affects Versions: 0.1.0
>            Reporter: Benjamin Francisoud
>            Priority: Minor
>         Attachments: PIG-100-tests.log, PIG-100-v01.patch, PIG-100-v02.patch
>
>
> I think the root problem was that I forget to specify the configuration using -Djunit.hadoop.conf=hadoop-site.xml while running the tests.
> But the error could be clearer...
> The logs are big so I will provide them in a separate file...
> But the core problem is:
> {noformat}
>     [junit] java.lang.NullPointerException
>     [junit] 	at org.apache.pig.impl.logicalLayer.parser.QueryParser.Alias(QueryParser.java:471)
>     [junit] 	at org.apache.pig.impl.logicalLayer.parser.QueryParser.NestedExpr(QueryParser.java:411)
>     [junit] 	at org.apache.pig.impl.logicalLayer.parser.QueryParser.NestedExpr(QueryParser.java:417)
>     [junit] 	at org.apache.pig.impl.logicalLayer.parser.QueryParser.GroupItem(QueryParser.java:1027)
> ...
>     [junit] org.apache.pig.impl.logicalLayer.parser.ParseException: Encountered "group" at line 1, column 9.
>     [junit] Was expecting one of:
>     [junit]     <IDENTIFIER> ...
>     [junit]     "(" ...
>     [junit]     
>     [junit] 	at org.apache.pig.impl.logicalLayer.parser.QueryParser.generateParseException(QueryParser.java:4142)
> ...
>     [junit] org.apache.pig.impl.logicalLayer.parser.ParseException: Encountered "generate" at line 1, column 1.
>     [junit] Was expecting one of:
>     [junit]     "load" ...
>     [junit]     "filter" ...
> {noformat}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (PIG-100) Tests: NullPointerException parser.QueryParser.Alias(QueryParser.java:471)

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

Pi Song commented on PIG-100:
-----------------------------

Should we somehow verify as many as possible the needed configurations before starting Pig? (Main configuration + the selected backend)

> Tests: NullPointerException parser.QueryParser.Alias(QueryParser.java:471)
> --------------------------------------------------------------------------
>
>                 Key: PIG-100
>                 URL: https://issues.apache.org/jira/browse/PIG-100
>             Project: Pig
>          Issue Type: Bug
>          Components: impl
>    Affects Versions: 0.1.0
>            Reporter: Benjamin Francisoud
>            Priority: Minor
>         Attachments: PIG-100-tests.log, PIG-100-v01.patch, PIG-100-v02.patch
>
>
> I think the root problem was that I forget to specify the configuration using -Djunit.hadoop.conf=hadoop-site.xml while running the tests.
> But the error could be clearer...
> The logs are big so I will provide them in a separate file...
> But the core problem is:
> {noformat}
>     [junit] java.lang.NullPointerException
>     [junit] 	at org.apache.pig.impl.logicalLayer.parser.QueryParser.Alias(QueryParser.java:471)
>     [junit] 	at org.apache.pig.impl.logicalLayer.parser.QueryParser.NestedExpr(QueryParser.java:411)
>     [junit] 	at org.apache.pig.impl.logicalLayer.parser.QueryParser.NestedExpr(QueryParser.java:417)
>     [junit] 	at org.apache.pig.impl.logicalLayer.parser.QueryParser.GroupItem(QueryParser.java:1027)
> ...
>     [junit] org.apache.pig.impl.logicalLayer.parser.ParseException: Encountered "group" at line 1, column 9.
>     [junit] Was expecting one of:
>     [junit]     <IDENTIFIER> ...
>     [junit]     "(" ...
>     [junit]     
>     [junit] 	at org.apache.pig.impl.logicalLayer.parser.QueryParser.generateParseException(QueryParser.java:4142)
> ...
>     [junit] org.apache.pig.impl.logicalLayer.parser.ParseException: Encountered "generate" at line 1, column 1.
>     [junit] Was expecting one of:
>     [junit]     "load" ...
>     [junit]     "filter" ...
> {noformat}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (PIG-100) Tests: NullPointerException parser.QueryParser.Alias(QueryParser.java:471)

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

Olga Natkovich commented on PIG-100:
------------------------------------

There are two kinds of errors:

- problems caused by users - where providing a meaningful error message should be sufficient
- internal system errors which should have stack trace written (at least into log file)

This case is clearly a user problem and I think having stack trace only confuses users rather than helps.


> Tests: NullPointerException parser.QueryParser.Alias(QueryParser.java:471)
> --------------------------------------------------------------------------
>
>                 Key: PIG-100
>                 URL: https://issues.apache.org/jira/browse/PIG-100
>             Project: Pig
>          Issue Type: Bug
>          Components: impl
>    Affects Versions: 0.1.0
>            Reporter: Benjamin Francisoud
>            Priority: Minor
>         Attachments: PIG-100-tests.log, PIG-100-v01.patch
>
>
> I think the root problem was that I forget to specify the configuration using -Djunit.hadoop.conf=hadoop-site.xml while running the tests.
> But the error could be clearer...
> The logs are big so I will provide them in a separate file...
> But the core problem is:
> {noformat}
>     [junit] java.lang.NullPointerException
>     [junit] 	at org.apache.pig.impl.logicalLayer.parser.QueryParser.Alias(QueryParser.java:471)
>     [junit] 	at org.apache.pig.impl.logicalLayer.parser.QueryParser.NestedExpr(QueryParser.java:411)
>     [junit] 	at org.apache.pig.impl.logicalLayer.parser.QueryParser.NestedExpr(QueryParser.java:417)
>     [junit] 	at org.apache.pig.impl.logicalLayer.parser.QueryParser.GroupItem(QueryParser.java:1027)
> ...
>     [junit] org.apache.pig.impl.logicalLayer.parser.ParseException: Encountered "group" at line 1, column 9.
>     [junit] Was expecting one of:
>     [junit]     <IDENTIFIER> ...
>     [junit]     "(" ...
>     [junit]     
>     [junit] 	at org.apache.pig.impl.logicalLayer.parser.QueryParser.generateParseException(QueryParser.java:4142)
> ...
>     [junit] org.apache.pig.impl.logicalLayer.parser.ParseException: Encountered "generate" at line 1, column 1.
>     [junit] Was expecting one of:
>     [junit]     "load" ...
>     [junit]     "filter" ...
> {noformat}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (PIG-100) Tests: NullPointerException parser.QueryParser.Alias(QueryParser.java:471)

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

Benjamin Francisoud updated PIG-100:
------------------------------------

    Patch Info: [Patch Available]

> Tests: NullPointerException parser.QueryParser.Alias(QueryParser.java:471)
> --------------------------------------------------------------------------
>
>                 Key: PIG-100
>                 URL: https://issues.apache.org/jira/browse/PIG-100
>             Project: Pig
>          Issue Type: Bug
>          Components: impl
>    Affects Versions: 0.1.0
>            Reporter: Benjamin Francisoud
>            Priority: Minor
>         Attachments: PIG-100-tests.log, PIG-100-v01.patch, PIG-100-v02.patch, PIG-100-v03-spaces.patch, PIG-100-v03-tabs.patch
>
>
> I think the root problem was that I forget to specify the configuration using -Djunit.hadoop.conf=hadoop-site.xml while running the tests.
> But the error could be clearer...
> The logs are big so I will provide them in a separate file...
> But the core problem is:
> {noformat}
>     [junit] java.lang.NullPointerException
>     [junit] 	at org.apache.pig.impl.logicalLayer.parser.QueryParser.Alias(QueryParser.java:471)
>     [junit] 	at org.apache.pig.impl.logicalLayer.parser.QueryParser.NestedExpr(QueryParser.java:411)
>     [junit] 	at org.apache.pig.impl.logicalLayer.parser.QueryParser.NestedExpr(QueryParser.java:417)
>     [junit] 	at org.apache.pig.impl.logicalLayer.parser.QueryParser.GroupItem(QueryParser.java:1027)
> ...
>     [junit] org.apache.pig.impl.logicalLayer.parser.ParseException: Encountered "group" at line 1, column 9.
>     [junit] Was expecting one of:
>     [junit]     <IDENTIFIER> ...
>     [junit]     "(" ...
>     [junit]     
>     [junit] 	at org.apache.pig.impl.logicalLayer.parser.QueryParser.generateParseException(QueryParser.java:4142)
> ...
>     [junit] org.apache.pig.impl.logicalLayer.parser.ParseException: Encountered "generate" at line 1, column 1.
>     [junit] Was expecting one of:
>     [junit]     "load" ...
>     [junit]     "filter" ...
> {noformat}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (PIG-100) Tests: NullPointerException parser.QueryParser.Alias(QueryParser.java:471)

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

Johannes Zillmann commented on PIG-100:
---------------------------------------

{noformat}
try {
    plan = parser.Parse();
} catch (ParseException e) {
    log.error(e.getMessage());
    log.debug(e);
}
{noformat}
Hi Benjamin, i'm very much aginst this kind of error handling.
First of all, i think the user of pig (or the caller of PigServer#registerQuery()) should be in control wether or not he want to stop the execution of his process when the registration of a query failed. I think in a lot of cases the user wants to fail fast. Grunt represents the other side. So if this error handling is appropriate for grunt, it should move to grunt.

Secondly the 2 log statments would lead to duplicate logging, would'nt they ?

> Tests: NullPointerException parser.QueryParser.Alias(QueryParser.java:471)
> --------------------------------------------------------------------------
>
>                 Key: PIG-100
>                 URL: https://issues.apache.org/jira/browse/PIG-100
>             Project: Pig
>          Issue Type: Bug
>          Components: impl
>    Affects Versions: 0.1.0
>            Reporter: Benjamin Francisoud
>            Priority: Minor
>         Attachments: PIG-100-tests.log, PIG-100-v01.patch, PIG-100-v02.patch
>
>
> I think the root problem was that I forget to specify the configuration using -Djunit.hadoop.conf=hadoop-site.xml while running the tests.
> But the error could be clearer...
> The logs are big so I will provide them in a separate file...
> But the core problem is:
> {noformat}
>     [junit] java.lang.NullPointerException
>     [junit] 	at org.apache.pig.impl.logicalLayer.parser.QueryParser.Alias(QueryParser.java:471)
>     [junit] 	at org.apache.pig.impl.logicalLayer.parser.QueryParser.NestedExpr(QueryParser.java:411)
>     [junit] 	at org.apache.pig.impl.logicalLayer.parser.QueryParser.NestedExpr(QueryParser.java:417)
>     [junit] 	at org.apache.pig.impl.logicalLayer.parser.QueryParser.GroupItem(QueryParser.java:1027)
> ...
>     [junit] org.apache.pig.impl.logicalLayer.parser.ParseException: Encountered "group" at line 1, column 9.
>     [junit] Was expecting one of:
>     [junit]     <IDENTIFIER> ...
>     [junit]     "(" ...
>     [junit]     
>     [junit] 	at org.apache.pig.impl.logicalLayer.parser.QueryParser.generateParseException(QueryParser.java:4142)
> ...
>     [junit] org.apache.pig.impl.logicalLayer.parser.ParseException: Encountered "generate" at line 1, column 1.
>     [junit] Was expecting one of:
>     [junit]     "load" ...
>     [junit]     "filter" ...
> {noformat}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (PIG-100) Tests: NullPointerException parser.QueryParser.Alias(QueryParser.java:471)

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

Benjamin Francisoud updated PIG-100:
------------------------------------

    Attachment: PIG-100-v03-spaces.patch

> Tests: NullPointerException parser.QueryParser.Alias(QueryParser.java:471)
> --------------------------------------------------------------------------
>
>                 Key: PIG-100
>                 URL: https://issues.apache.org/jira/browse/PIG-100
>             Project: Pig
>          Issue Type: Bug
>          Components: impl
>    Affects Versions: 0.1.0
>            Reporter: Benjamin Francisoud
>            Priority: Minor
>         Attachments: PIG-100-tests.log, PIG-100-v01.patch, PIG-100-v02.patch, PIG-100-v03-spaces.patch, PIG-100-v03-tabs.patch
>
>
> I think the root problem was that I forget to specify the configuration using -Djunit.hadoop.conf=hadoop-site.xml while running the tests.
> But the error could be clearer...
> The logs are big so I will provide them in a separate file...
> But the core problem is:
> {noformat}
>     [junit] java.lang.NullPointerException
>     [junit] 	at org.apache.pig.impl.logicalLayer.parser.QueryParser.Alias(QueryParser.java:471)
>     [junit] 	at org.apache.pig.impl.logicalLayer.parser.QueryParser.NestedExpr(QueryParser.java:411)
>     [junit] 	at org.apache.pig.impl.logicalLayer.parser.QueryParser.NestedExpr(QueryParser.java:417)
>     [junit] 	at org.apache.pig.impl.logicalLayer.parser.QueryParser.GroupItem(QueryParser.java:1027)
> ...
>     [junit] org.apache.pig.impl.logicalLayer.parser.ParseException: Encountered "group" at line 1, column 9.
>     [junit] Was expecting one of:
>     [junit]     <IDENTIFIER> ...
>     [junit]     "(" ...
>     [junit]     
>     [junit] 	at org.apache.pig.impl.logicalLayer.parser.QueryParser.generateParseException(QueryParser.java:4142)
> ...
>     [junit] org.apache.pig.impl.logicalLayer.parser.ParseException: Encountered "generate" at line 1, column 1.
>     [junit] Was expecting one of:
>     [junit]     "load" ...
>     [junit]     "filter" ...
> {noformat}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.