Pig command error: Failed to parse: Pig script failed to parse

0 votes

Error on executing pig command - 

custdata = load "module5pig/cust.txt" using Pigstorage(",") as (custid:int,fsname:chararray,lsname:chararray,age:int,prof:chararray);

error message :

[main] ERROR org.apache.pig.tools.grunt.Grunt - Failed to parse: Pig script failed to parse: 
pig script failed to validate: org.apache.pig.backend.executionengine.ExecException: ERROR 1070: Could not resolve Pigstorage 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:1660)
at org.apache.pig.PigServer$Graph.registerQuery(PigServer.java:1633)
at org.apache.pig.PigServer.registerQuery(PigServer.java:587)
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:547)
at org.apache.pig.Main.main(Main.java:158)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.hadoop.util.RunJar.run(RunJar.java:221)
at org.apache.hadoop.util.RunJar.main(RunJar.java:136)
Caused by: 
pig script failed to validate: org.apache.pig.backend.executionengine.ExecException: ERROR 1070: Could not resolve Pigstorage using imports: [, java
.lang., org.apache.pig.builtin., org.apache.pig.impl.builtin.]
at org.apache.pig.parser.LogicalPlanBuilder.validateFuncSpec(LogicalPlanBuilder.java:1273)
at org.apache.pig.parser.LogicalPlanBuilder.buildFuncSpec(LogicalPlanBuilder.java:1258)
at org.apache.pig.parser.LogicalPlanGenerator.func_clause(LogicalPlanGenerator.java:5153)
at org.apache.pig.parser.LogicalPlanGenerator.load_clause(LogicalPlanGenerator.java:3515)
at org.apache.pig.parser.LogicalPlanGenerator.op_clause(LogicalPlanGenerator.java:1625)
at org.apache.pig.parser.LogicalPlanGenerator.general_statement(LogicalPlanGenerator.java:1102)
at org.apache.pig.parser.LogicalPlanGenerator.statement(LogicalPlanGenerator.java:560)
at org.apache.pig.parser.LogicalPlanGenerator.query(LogicalPlanGenerator.java:421)
at org.apache.pig.parser.QueryParserDriver.parse(QueryParserDriver.java:188)
... 16 more
Caused by: org.apache.pig.backend.executionengine.ExecException: ERROR 1070: Could not resolve Pigstorage using imports: [, java.lang., org.apache.pig.builtin., org.apa
che.pig.impl.builtin.]
at org.apache.pig.impl.PigContext.resolveClassName(PigContext.java:653)
at org.apache.pig.parser.LogicalPlanBuilder.validateFuncSpec(LogicalPlanBuilder.java:1270)
... 24 more
Jan 7 in Big Data Hadoop by digger
• 27,620 points
200 views

1 answer to this question.

0 votes

There's a typo in your command:

Right command:

custdata = load 'module5pig/cust.txt' using PigStorage(',') as custid:int,fsname:chararray,lsname:chararray,age:int,prof:chararray);

Your command:

custdata = load "module5pig/cust.txt" using Pigstorage(",") as (custid:int,fsname:chararray,lsname:chararray,age:int,prof:chararray);

answered Jan 7 by Omkar
• 67,140 points

Related Questions In Big Data Hadoop

+1 vote
3 answers

when i tried to run the hdfs namenode -format command...its failed to run..can anyone help me with this???

Hi Suriyaprakash, I guess the path for hadoop ...READ MORE

answered Jul 23, 2018 in Big Data Hadoop by avi_man_utd
342 views
0 votes
1 answer
0 votes
1 answer

Pig code in Eclipse shows error :LongWritable cannot be resolved to a type

To rectify this errors, you need to ...READ MORE

answered Jan 2 in Big Data Hadoop by Omkar
• 67,140 points
50 views
0 votes
1 answer

Error while hitting the hadoop jar command to execute my map reduce

Since your jar file was inside the ...READ MORE

answered Feb 11 in Big Data Hadoop by Omkar
• 67,140 points
48 views
0 votes
1 answer

What do we exactly mean by “Hadoop” – the definition of Hadoop?

The official definition of Apache Hadoop given ...READ MORE

answered Mar 16, 2018 in Big Data Hadoop by Shubham
153 views
0 votes
1 answer

Hadoop Mapreduce word count Program

Firstly you need to understand the concept ...READ MORE

answered Mar 16, 2018 in Data Analytics by nitinrawat895
• 10,150 points
2,062 views
0 votes
1 answer

hadoop.mapred vs hadoop.mapreduce?

org.apache.hadoop.mapred is the Old API  org.apache.hadoop.mapreduce is the ...READ MORE

answered Mar 16, 2018 in Data Analytics by nitinrawat895
• 10,150 points
199 views
0 votes
10 answers

hadoop fs -put command?

copy command can be used to copy files ...READ MORE

answered Dec 7, 2018 in Big Data Hadoop by Sujay
10,570 views
0 votes
1 answer

Hadoop: "DEPRECATED: Use of this script to execute hdfs command is deprecated." error

The use of dfs in your command is "Deprecated". ...READ MORE

answered Nov 26, 2018 in Big Data Hadoop by Omkar
• 67,140 points
506 views
0 votes
1 answer

Apache Spark gives "Failed to load native-hadoop with error"

Seems like hadoop path is missing in java.library.path. ...READ MORE

answered Nov 22, 2018 in Big Data Hadoop by Omkar
• 67,140 points
290 views