1
votes

I am trying to store data using PigDump() and am getting the following error.

grunt> TxtLdr = load '/wordcountdata.txt' using TextLoader();
grunt> STORE TxtLdr into '/pigdmpOP' using PigDump();       

2014-07-30 19:59:39,102 [main] ERROR org.apache.pig.tools.grunt.Grunt - ERROR 1070: Could not resolve PigDump using imports: [, java.lang., org.apache.pig.builtin., org.apache.pig.impl.builtin.]
Details at logfile: /home/Xperttech/pig-0.12.0/pig_1406764753800.log

I am getting the error irrespective of the Loading storage method I use (TextLoader / PigStorage / BinaryStorage) and irrespective of the target directory (hdfs or local system)

The log file has the following data:

ERROR 1070: Could not resolve PigDump using imports: [, java.lang., org.apache.pig.builtin., org.apache.pig.impl.builtin.]

Failed to parse: Pig script failed to parse: pig script failed to validate: org.apache.pig.backend.executionengine.ExecException: ERROR 1070: Could not resolve PigDump using imports: [, java.lang., org.apache.pig.builtin., org.apache.pig.impl.builtin.] at org.apache.pig.parser.QueryParserDriver.parse(QueryParserDriver.java:196) at org.apache.pig.PigServer$Graph.validateQuery(PigServer.java:1648) at org.apache.pig.PigServer$Graph.registerQuery(PigServer.java:1621) at org.apache.pig.PigServer.registerQuery(PigServer.java:575) at org.apache.pig.tools.grunt.GruntParser.processPig(GruntParser.java:1093) at org.apache.pig.tools.pigscript.parser.PigScriptParser.parse(PigScriptParser.java:501) at org.apache.pig.tools.grunt.GruntParser.parseStopOnError(GruntParser.java:198) at org.apache.pig.tools.grunt.GruntParser.parseStopOnError(GruntParser.java:173) at org.apache.pig.tools.grunt.Grunt.run(Grunt.java:69) at org.apache.pig.Main.run(Main.java:541) at org.apache.pig.Main.main(Main.java:156) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.hadoop.util.RunJar.main(RunJar.java:160) Caused by: pig script failed to validate: org.apache.pig.backend.executionengine.ExecException: ERROR 1070: Could not resolve PigDump using imports: [, java.lang., org.apache.pig.builtin., org.apache.pig.impl.builtin.] at org.apache.pig.parser.LogicalPlanBuilder.validateFuncSpec(LogicalPlanBuilder.java:1260) at org.apache.pig.parser.LogicalPlanBuilder.buildFuncSpec(LogicalPlanBuilder.java:1245) at org.apache.pig.parser.LogicalPlanGenerator.func_clause(LogicalPlanGenerator.java:5069) at org.apache.pig.parser.LogicalPlanGenerator.store_clause(LogicalPlanGenerator.java:7667) at org.apache.pig.parser.LogicalPlanGenerator.op_clause(LogicalPlanGenerator.java:1580) at org.apache.pig.parser.LogicalPlanGenerator.general_statement(LogicalPlanGenerator.java:1013) at org.apache.pig.parser.LogicalPlanGenerator.statement(LogicalPlanGenerator.java:553) at org.apache.pig.parser.LogicalPlanGenerator.query(LogicalPlanGenerator.java:421) at org.apache.pig.parser.QueryParserDriver.parse(QueryParserDriver.java:188) ... 15 more Caused by: org.apache.pig.backend.executionengine.ExecException: ERROR 1070: Could not resolve PigDump using imports: [, java.lang., org.apache.pig.builtin., org.apache.pig.impl.builtin.] at org.apache.pig.impl.PigContext.resolveClassName(PigContext.java:653) at org.apache.pig.parser.LogicalPlanBuilder.validateFuncSpec(LogicalPlanBuilder.java:1257) ... 23 more

Can you suggest what am I doing wrong? Are any files needed to be imported before trying to implement PigDump() ? (If so, how?)

Thanks in advance.

2
Can you show me your input data?Rengasamy
Can you say for what input it works? As, I have tried for different types of .txt with and without ',' delimiter and newline delimiter.proutray
@Rengasamy - When I do 'dump TxtLdr;' the output I get is (Apache Hadoop is an open-source software framework for storage and large-scale processing of data-sets on clusters of commodity hardware. Hadoop is an Apache top-level project being built and used by a global community of contributors and users.[2] It is licensed under the Apache License 2.0.)proutray
Did you get that message in the grunt shell?Rengasamy

2 Answers

3
votes

I'm affraid the documentation is not completely up to date. PigDump was removed in the 0.7 release. This is stated here :

We have also removed org.apache.pig.builtin.BinaryStorage loader/store function and org.apache.pig.builtin.PigDump which were only used from within streaming. They can be restored if needed - we would just need to implement the corresponding Input/OutputFormats.

1
votes

PigDump was removed but for your purposes, PigStorage will work.

Change:

`STORE TxtLdr into '/pigdmpOP' using PigDump();`

to:

`STORE TxtLdr into '/pigdmpOP' using PigStorage(',');`