0

I have Hadoop version 2.7.1 and Pig 0.14.0 installed on CentOS PC. I tried running Pig dump command on Grunt shell, but it failed with below error:

[main] ERROR org.apache.pig.tools.grunt.Grunt - ERROR 1066: Unable to open iterator for alias 

Below are the commands I am running:

grunt> youtube_dump = LOAD '/youtubedata.txt' as (video_id:chararray , uploader:chararray, upload_interval : int, category:chararray, video_length:int, views:int, rating:float, no_rating:int, no_comments:int, related_video_ids:chararray);

grunt> grp_by_category = GROUP youtube_dump by category;

grunt> dump grp_by_category;

If I try Pig in local mode with file youtubedata.txt copied to local disk, I don't get any error.

Manjunath Ballur
  • 6,287
  • 3
  • 37
  • 48
Vikram
  • 41
  • 1
  • 3
  • Can you post some sample data? It would help in trying out the script. – Manjunath Ballur Dec 27 '15 at 04:08
  • @ManjunathBallur : Below is the sample record. QuRYeRnAuXM EvilSquirrelPictures 1135 Pets & Animals 252 1075 4.96 46 86 gFa1YMEJFag nRcovJn9xHg 3TYqkBJ9YRk rSJ8QZWBegU 0TZqX5MbXMA UEvVksP91kg ZTopArY7Nbg 0RViGi2Rne8 HT_QlOJbDpg YZev1imoxX8 8qQrrfUTmh0 zQ83d_D2MGs u6_DQQjLsAw 73Wz9CQFDtE Sorry I am new to Stackoveflow.com and couldn't find attachment option. I do not think this is related to in-correct code as I tried using more simpler code and data on pig. It just fails on ERROR 1066: Unable to open iterator – Vikram Dec 28 '15 at 04:46
  • I loaded this data into HDFS and copied the script as is. I could successfully run the script. Yes, I too believe, there is no problem with the script. – Manjunath Ballur Dec 28 '15 at 05:50
  • If it works in local mode, the solution provided may not yet be sufficient, but 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 15:26

1 Answers1

1

I was finally able to resolve the issue. Here's what I found after doing some research. Apparently, my yarn-site.xml was in-correctly configured.There was a typo in the property name section. Instead of "yarn.nodemanager.aux-services" it was "yarn.nodemanager.aux-service" (missing letter "s" in services).

After updating conf file yarn-site.xml correctly, I was able to run pig commands without any error.

Vikram
  • 41
  • 1
  • 3
  • Good to see that you posted the answer here, but out of curiosity: was the Error 1066 really the only (/most specific) error message that you got? – Dennis Jaheruddin Jan 06 '16 at 13:34
  • @DennisJaheruddin: I check old pig log and found below is the entire log message: Pig Stack Trace --------------- ERROR 1066: Unable to open iterator for alias data1 org.apache.pig.impl.logicalLayer.FrontendException: ERROR 1066: Unable to open iterator for alias data1 at org.apache.pig.PigServer.openIterator(PigServer.java:935) at . . . . Caused by: java.io.IOException: Job terminated with anomalous status FAILED – Vikram Jan 08 '16 at 03:46