Support Questions

Find answers, ask questions, and share your expertise

ERROR 1066: Unable to open iterator for alias- PIG

avatar
New Contributor

I have been facing this issue from long time.

I tried to solve this but i couldn't.

I need some experts advice to solve this.

I am trying to load a sample tweets obtained with flume.

 

This is the error:

 

 

Pig Stack Trace
---------------
ERROR 1066: Unable to open iterator for alias tweets. Backend error : java.lang.IllegalStateException: Job in state DEFINE instead of RUNNING

org.apache.pig.impl.logicalLayer.FrontendException: ERROR 1066: Unable to open iterator for alias tweets. Backend error : java.lang.IllegalStateException: Job in state DEFINE instead of RUNNING
	at org.apache.pig.PigServer.openIterator(PigServer.java:1010)
	at org.apache.pig.tools.grunt.GruntParser.processDump(GruntParser.java:782)
	at org.apache.pig.tools.pigscript.parser.PigScriptParser.parse(PigScriptParser.java:383)
	at org.apache.pig.tools.grunt.GruntParser.parseStopOnError(GruntParser.java:230)
	at org.apache.pig.tools.grunt.GruntParser.parseStopOnError(GruntParser.java:205)
	at org.apache.pig.tools.grunt.Grunt.run(Grunt.java:66)
	at org.apache.pig.Main.run(Main.java:564)
	at org.apache.pig.Main.main(Main.java:175)
	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:323)
	at org.apache.hadoop.util.RunJar.main(RunJar.java:236)
Caused by: org.apache.pig.backend.executionengine.ExecException: ERROR 0: java.lang.IllegalStateException: Job in state DEFINE instead of RUNNING
	at org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.MapReduceLauncher.getStats(MapReduceLauncher.java:844)
	at org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.MapReduceLauncher.launchPig(MapReduceLauncher.java:473)
	at org.apache.pig.backend.hadoop.executionengine.HExecutionEngine.launchPig(HExecutionEngine.java:290)
	at org.apache.pig.PigServer.launchPlan(PigServer.java:1475)
	at org.apache.pig.PigServer.executeCompiledLogicalPlan(PigServer.java:1460)
	at org.apache.pig.PigServer.storeEx(PigServer.java:1119)
	at org.apache.pig.PigServer.store(PigServer.java:1082)
	at org.apache.pig.PigServer.openIterator(PigServer.java:995)
	... 13 more
Caused by: java.lang.IllegalStateException: Job in state DEFINE instead of RUNNING
	at org.apache.hadoop.mapreduce.Job.ensureState(Job.java:302)
	at org.apache.hadoop.mapreduce.Job.getTaskReports(Job.java:544)
	at org.apache.pig.tools.pigstats.mapreduce.MRJobStats.getTaskReports(MRJobStats.java:532)
	at org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.MapReduceLauncher.getStats(MapReduceLauncher.java:823)
	... 20 more

 

 

 

I have tried to load this json file using ELEPHANT BIRD

script:

 

 

REGISTER '/home/hdoop/Escritorio/json-simple-1.1.1.jar'
REGISTER '/home/hdoop/Escritorio/elephant-bird-pig-4.10.jar'
REGISTER '/home/hdoop/Escritorio/elephant-bird-core-4.10.jar'
REGISTER '/home/hdoop/Escritorio/elephant-bird-hadoop-compat-4.10.jar'
REGISTER '/home/hdoop/Escritorio/avro-1.11.0.jar'
REGISTER '/home/hdoop/Escritorio/guava-31.0.1-jre.jar'
REGISTER '/home/hdoop/Escritorio/piggybank-0.17.0.jar'

tweets = LOAD  '/hdoop/twitter_data' USING com.twitter.elephantbird.pig.load.JsonLoader('-nestedLoad') AS myMap;

describe tweets;

dump tweets;

 

 

 

0 REPLIES 0