3

I have a bag called Ftel. describe Ftel; results in following -

Ftel: {billVal:int, billCount:int}

An example of dump from Ftel is -

(20,1)
(5,1)
(5,1)
(10,1)
...
etc.

I grouped the above bag using the command Gtel = group Ftel by billVal;

Now, Dump Gtel; throws following error -

Pig Stack Trace

ERROR 1066: Unable to open iterator for alias Gtel

org.apache.pig.impl.logicalLayer.FrontendException: ERROR 1066: Unable to open iterator for alias Gtel
at org.apache.pig.PigServer.openIterator(PigServer.java:765)
at org.apache.pig.tools.grunt.GruntParser.processDump(GruntParser.java:615)
at    
org.apache.pig.tools.pigscript.parser.PigScriptParser.parse(PigScriptParser.java:303)
at org.apache.pig.tools.grunt.GruntParser.parseStopOnError(GruntParser.java:168)
at org.apache.pig.tools.grunt.GruntParser.parseStopOnError(GruntParser.java:144)
at org.apache.pig.tools.grunt.Grunt.run(Grunt.java:76)
at org.apache.pig.Main.run(Main.java:455)
at org.apache.pig.Main.main(Main.java:107)
Caused by: java.io.IOException: Job terminated with anomalous status FAILED
at org.apache.pig.PigServer.openIterator(PigServer.java:755)

I don't know what is causing this issue. Please help.

Thanks!

Frederic
  • 3,254
  • 1
  • 18
  • 35
user1798968
  • 39
  • 1
  • 4
  • Your code looks ok. Could you post the beginning of your script, too. Also, make sure your input data is properly formatted. Do you see any warnings except the error message that you have posted? – Frederic Nov 05 '12 at 09:12
  • My data is properly formatted. I have following scripts: register myudfs.jar; tel1 = load 'pig/Teller1.txt' as (billVal); tel2 = load 'pig/Teller2.txt' as (billVal); tel = union tel1, tel2; Ptel = foreach tel generate myudfs.Pivot(billVal); Ftel = foreach Ptel generate flatten($0) as billVal:chararray, 1 as billCount:int; Gtel = group Ftel by billVal; – user1798968 Nov 05 '12 at 12:28
  • For people who found this post when looking for [ERROR 1066: Unable to open iterator for alias](http://stackoverflow.com/questions/34495085/error-1066-unable-to-open-iterator-for-alias-in-pig-generic-solution) here is a [generic solution](http://stackoverflow.com/a/34495086/983722). – Dennis Jaheruddin Dec 28 '15 at 14:57

2 Answers2

0

It works now... I just changed Ftel from

Ftel: {billVal:int, billCount:int}

to

Ftel: {billVal:chararray, billCount:int}

Seems like grouping only works if the group-key is chararray. Does anyone have an idea why??

user1798968
  • 39
  • 1
  • 4
0

As a tip to future searchers, I encountered this same problem with a script that works fine on the cluster.

The problem was that the mapper output was still being compressed. Commenting out these options in my script fixed it:

SET mapred.compress.map.output 'true';
SET mapred.map.output.compression.codec 'org.apache.hadoop.io.compress.GzipCodec';
chokamp
  • 70
  • 1
  • 7