Hi All,
Any help with the following would be great!
I would like to use cube operator in my pig script:rawdata = LOAD
'/structured/input.tsv';raw_data_projected = FOREACH rawdata GENERATE $2, $3,
$4, $5 AS (name: chararray, age: int, prod_name: chararray, view_date:
chararray);
cubed_out = CUBE raw_data_projected BY CUBE (name,age);result = FOREACH
cubed_out GENERATE FLATTEN (group), COUNT_STAR(raw_data_projected);DUMP result;
I get the following error:
pig -x mapreduce cubetest.pig
Warn: Cannot open log4j properties file, use default2014-02-13 10:01:47,371
[main] INFO org.apache.pig.Main - Apache Pig version 0.11.1 (r1459641)
compiled Mar 22 2013, 02:13:532014-02-13 10:01:47,372 [main] INFO
org.apache.pig.Main - Logging error messages to:
/apps/pig-scripts/pig_1392314507366.log2014-02-13 10:01:47,650 [main] INFO
org.apache.pig.impl.util.Utils - Default bootup file /users/userid/.pigbootup
not found2014-02-13 10:01:47,830 [main] INFO
org.apache.pig.backend.hadoop.executionengine.HExecutionEngine - Connecting to
hadoop file system at: hdfs://server:543102014-02-13 10:01:47,984 [main] INFO
org.apache.pig.backend.hadoop.executionengine.HExecutionEngine - Connecting to
map-reduce job tracker at: hdfs://server:543112014-02-13 10:01:48,690 [main]
ERROR org.apache.pig.tools.grunt.Grunt - ERROR 1200: nullDetails at logfile:
/apps/pig-scripts/pig_1392314507366.log
Pig Stack Trace---------------ERROR 1200: null
org.apache.pig.impl.logicalLayer.FrontendException: ERROR 1000: Error during
parsing. null at
org.apache.pig.PigServer$Graph.parseQuery(PigServer.java:1607) at
org.apache.pig.PigServer$Graph.registerQuery(PigServer.java:1546) at
org.apache.pig.PigServer.registerQuery(PigServer.java:516) at
org.apache.pig.tools.grunt.GruntParser.processPig(GruntParser.java:991)
at
org.apache.pig.tools.pigscript.parser.PigScriptParser.parse(PigScriptParser.java:412)
at
org.apache.pig.tools.grunt.GruntParser.parseStopOnError(GruntParser.java:194)
at
org.apache.pig.tools.grunt.GruntParser.parseStopOnError(GruntParser.java:170)
at org.apache.pig.tools.grunt.Grunt.exec(Grunt.java:84) at
org.apache.pig.Main.run(Main.java:604) at
org.apache.pig.Main.main(Main.java:157) at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601) at
org.apache.hadoop.util.RunJar.main(RunJar.java:156)Caused by: Failed to parse:
null at
org.apache.pig.parser.QueryParserDriver.parse(QueryParserDriver.java:193)
at org.apache.pig.PigServer$Graph.parseQuery(PigServer.java:1599) ...
14 moreCaused by: java.lang.NullPointerException at
org.apache.pig.parser.LogicalPlanBuilder.convertCubeToFGPlan(LogicalPlanBuilder.java:585)
at
org.apache.pig.parser.LogicalPlanBuilder.buildCubeOp(LogicalPlanBuilder.java:415)
at
org.apache.pig.parser.LogicalPlanGenerator.cube_clause(LogicalPlanGenerator.java:5175)
at
org.apache.pig.parser.LogicalPlanGenerator.op_clause(LogicalPlanGenerator.java:1645)
at
org.apache.pig.parser.LogicalPlanGenerator.general_statement(LogicalPlanGenerator.java:799)
at
org.apache.pig.parser.LogicalPlanGenerator.statement(LogicalPlanGenerator.java:517)
at
org.apache.pig.parser.LogicalPlanGenerator.query(LogicalPlanGenerator.java:392)
at
org.apache.pig.parser.QueryParserDriver.parse(QueryParserDriver.java:184)
... 15
more================================================================================