0

The following code works fine:

S4 = FOREACH S3 GENERATE group AS page_i, 
                         COUNT(S2) AS outlinks,
                         FLATTEN(S2.rank);
DUMP S4

The result are like below:

(Computer engineering,1,0.1111111111111111)
(Outline of computer science,1,0.1111111111111111)

However, when I try to create one more table using divide:

S44 = FOREACH S4 GENERATE group as page_i, outlinks/2, ...

It goes gown like:

Failed Jobs:
JobId   Alias   Feature Message Outputs
job_local125575051_0033 S6,S66  DISTINCT    Message: Job failed! Error - NA    
file:/tmp/temp-847036156/tmp-1908150009,

Input(s):
Successfully read records from:  "/home/song/workspace/FinalProject/output/part-m-00000"
Successfully read records from: "/home/song/workspace/FinalProject/output/part-m-00000"

Output(s):
Failed to produce result in "file:/tmp/temp-847036156/tmp-1908150009"

Job DAG:
job_local777342816_0028 ->  job_local39708124_0029,
job_local39708124_0029  ->  job_local495952123_0030,job_local268178801_0032,
job_local495952123_0030 ->  job_local1880869927_0031,
job_local1880869927_0031    ->  job_local268178801_0032,
job_local268178801_0032 ->  job_local125575051_0033,
job_local125575051_0033


2015-04-29 07:45:49,133 [main] INFO     org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.MapReduceLauncher -   Some jobs have failed! Stop running all dependent jobs
2015-04-29 07:45:49,136 [main] ERROR org.apache.pig.tools.grunt.Grunt - ERROR 1066: Unable to open iterator for alias S66
Details at logfile: /home/song/workspace/FinalProject/pig_1430315000370.log
mr2ert
  • 4,956
  • 1
  • 18
  • 31
SHJ
  • 1
  • 2
  • To help others answer your question, it helps to format the code and output to make it clear which is which. I tried to format it, but I might have made mistakes. You should take a look to make sure it is still correct. – Cecilia Apr 29 '15 at 21:57
  • 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:30

1 Answers1

1

It seems that you are trying to project a field called group for each tuple in relation S4, while the schema contains only those fields:

  1. page_i
  2. outlinks
  3. unnamed field as a result of FLATTEN(S2.rank).

So I guess that all you need to do is to replace the invalid line with:

S44 = FOREACH S4 GENERATE page_i as page_i, outlinks/2, ...

Or maybe just:

S44 = FOREACH S4 GENERATE page_i, outlinks/2, ...

Hope that this was the only issue here...

Zach Beniash
  • 303
  • 1
  • 9