Support Questions

Find answers, ask questions, and share your expertise

Pig ERROR 1066: Unable to open iterator for alias load_data.

avatar
Explorer

Hey guys,

I´m trying to run a simple script through VM, but I´m getting the following error. Does anyone know how to fix it?

Thanks.

Pig commands:

grunt> load_data = load 'user/root/pig_demo.txt'; 
grunt> dump load_data

Pig Log errors:

Pig Stack Trace
---------------
ERROR 1066: Unable to open iterator for alias load_data. 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 load_data. Backend error : java.lang.IllegalStateException: Job in state DEFINE instead of RUNNING
        at org.apache.pig.PigServer.openIterator(PigServer.java:1009)
        at org.apache.pig.tools.grunt.GruntParser.processDump(GruntParser.java:747)
        at org.apache.pig.tools.pigscript.parser.PigScriptParser.parse(PigScriptParser.java:376)
        at org.apache.pig.tools.grunt.GruntParser.parseStopOnError(GruntParser.java:231)
        at org.apache.pig.tools.grunt.GruntParser.parseStopOnError(GruntParser.java:206)
        at org.apache.pig.tools.grunt.Grunt.run(Grunt.java:66)
        at org.apache.pig.Main.run(Main.java:566)
        at org.apache.pig.Main.main(Main.java:178)
        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:233)
        at org.apache.hadoop.util.RunJar.main(RunJar.java:148)
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:822)
        at org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.MapReduceLauncher.launchPig(MapReduceLauncher.java:452)
        at org.apache.pig.backend.hadoop.executionengine.HExecutionEngine.launchPig(HExecutionEngine.java:308)
        at org.apache.pig.PigServer.launchPlan(PigServer.java:1474)
        at org.apache.pig.PigServer.executeCompiledLogicalPlan(PigServer.java:1459)
        at org.apache.pig.PigServer.storeEx(PigServer.java:1118)
        at org.apache.pig.PigServer.store(PigServer.java:1081)
        at org.apache.pig.PigServer.openIterator(PigServer.java:994)
        ... 13 more
Caused by: java.lang.IllegalStateException: Job in state DEFINE instead of RUNNING
        at org.apache.hadoop.mapreduce.Job.ensureState(Job.java:292)
        at org.apache.hadoop.mapreduce.Job.getTaskReports(Job.java:534)
        at org.apache.pig.backend.hadoop.executionengine.shims.HadoopShims.getTaskReports(HadoopShims.java:235)
        at org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.MapReduceLauncher.getStats(MapReduceLauncher.java:801)
        ... 20 more
1 ACCEPTED SOLUTION

avatar
Master Mentor

@Junior

The Path seems to be incorrect isn't it?

'user/root/pig_demo.txt'
OR
'/user/root/pig_demo.txt'

View solution in original post

2 REPLIES 2

avatar
Master Mentor

@Junior

The Path seems to be incorrect isn't it?

'user/root/pig_demo.txt'
OR
'/user/root/pig_demo.txt'

avatar
Explorer

@Jay SenSharma thank you very much!

The problem is the path.