0
votes

I am trying to load an XML file using XMLLoader(Piggybank) in Pig, but I get an error saying "unable to open iterator for alias B". I have written the following code:

REGISTER /home/hdfs/spig/trunk/contrib/piggybank/java/piggybank.jar
A = LOAD '/core-site.xml'using org.apache.pig.piggybank.storage.XMLLoader('property') as (x:chararray);
B = foreach A GENERATE FLATTEN(REGEX_EXTRACT_ALL(x,'<property>\\s*<name>(.*)  </name>\\s*<value>(.*)</value>\\s*<description>(.*)</description>\\s*</property>'));
dump B;

The following is the log file:

Pig Stack Trace

ERROR 1066: Unable to open iterator for alias A

org.apache.pig.impl.logicalLayer.FrontendException: ERROR 1066: Unable to open iterator for alias A at org.apache.pig.PigServer.openIterator(PigServer.java:935) at org.apache.pig.tools.grunt.GruntParser.processDump(GruntParser.java:754) at org.apache.pig.tools.pigscript.parser.PigScriptParser.parse(PigScriptParser.java:376) 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.exec(Grunt.java:81) at org.apache.pig.Main.run(Main.java:631) at org.apache.pig.Main.main(Main.java:177) 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:606) at org.apache.hadoop.util.RunJar.run(RunJar.java:221) at org.apache.hadoop.util.RunJar.main(RunJar.java:136) Caused by: java.io.IOException: Job terminated with anomalous status FAILED at org.apache.pig.PigServer.openIterator(PigServer.java:927) ... 13 more

1
Can you post the full error please? - Pradeep Gollakota
@PradeepGollakota I have added the log file. - Arnab
I tried to dump A , and in response I got the above error as shown in the log. - Arnab
Not sure if the answer here is sufficient yet, but perhaps this helps: ERROR 1066: Unable to open iterator for alias here is a generic solution. - Dennis Jaheruddin

1 Answers

-1
votes

Looks like one of your jobs might have failed.

Caused by: java.io.IOException: Job terminated with anomalous status FAILED