You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@pig.apache.org by Haitao Yao <ya...@gmail.com> on 2012/07/04 05:17:33 UTC

pig error message enhancement

hi, all
	I encountered an Exception like this: 

ERROR org.apache.pig.tools.grunt.Grunt  - org.apache.pig.impl.logicalLayer.FrontendException: ERROR 1000: Error during parsing. null
        at org.apache.pig.PigServer$Graph.parseQuery(PigServer.java:1641)
        at org.apache.pig.PigServer$Graph.registerQuery(PigServer.java:1584)
        at org.apache.pig.PigServer.registerQuery(PigServer.java:584)
        at org.apache.pig.tools.grunt.GruntParser.processPig(GruntParser.java:939)
        at org.apache.pig.tools.pigscript.parser.PigScriptParser.parse(PigScriptParser.java:386)
        at org.apache.pig.tools.grunt.GruntParser.parseStopOnError(GruntParser.java:188)
        at org.apache.pig.tools.grunt.GruntParser.parseStopOnError(GruntParser.java:164)
        at org.apache.pig.tools.grunt.Grunt.exec(Grunt.java:84)        at he.pig.PigWorker.call(BatchPig.java:412)
        at he.pig.PigWorker.call(BatchPig.java:386)        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
        at java.util.concurrent.FutureTask.run(FutureTask.java:166)        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)        at java.lang.Thread.run(Thread.java:722)
Caused by: Failed to parse: null        at org.apache.pig.parser.QueryParserDriver.parse(QueryParserDriver.java:180)
        at org.apache.pig.PigServer$Graph.parseQuery(PigServer.java:1633)
        ... 14 more
Caused by: java.lang.NullPointerException
        at java.util.Hashtable.put(Hashtable.java:432)
        at java.util.Properties.setProperty(Properties.java:161)        at org.apache.hadoop.conf.Configuration.set(Configuration.java:438)
        at org.apache.pig.backend.hadoop.datastorage.ConfigurationUtil.toConfiguration(ConfigurationUtil.java:43)
        at org.apache.pig.parser.LogicalPlanBuilder.buildLoadOp(LogicalPlanBuilder.java:375)
        at org.apache.pig.parser.LogicalPlanGenerator.load_clause(LogicalPlanGenerator.java:2955)
        at org.apache.pig.parser.LogicalPlanGenerator.op_clause(LogicalPlanGenerator.java:1078)
        at org.apache.pig.parser.LogicalPlanGenerator.general_statement(LogicalPlanGenerator.java:683)
        at org.apache.pig.parser.LogicalPlanGenerator.statement(LogicalPlanGenerator.java:483)
        at org.apache.pig.parser.LogicalPlanGenerator.query(LogicalPlanGenerator.java:369)
        at org.apache.pig.parser.QueryParserDriver.parse(QueryParserDriver.java:171)
        ... 15 more


Can we change the error message to provide more information? Or how about we prevent this error to happen like this?
org.apache.pig.backend.hadoop.datastorage.ConfigurationUtil:toConfiguration(Properties properties)

        while (iter.hasMoreElements()) {
            final String key = (String) iter.nextElement();
            final String val = properties.getProperty(key);
	    if(key == null || val == null){
                // show more information here and do not set the config
                continue;
            }
            config.set(key, val);
        }







Haitao Yao
yao.erix@gmail.com
weibo: @haitao_yao
Skype:  haitao.yao.final