Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Pig error 1066

Highlighted

Pig error 1066

Contributor

My pig script is throwing ERROR org.apache.pig.tools.grunt.Grunt - ERROR 1066: Unable to open iterator for alias E

This is where i'm defining the alias E:

A = JOIN CONTACT_ACTIVITY BY Sold_To, KNA1_SAMPLE BY KNA1_Sold_To;

B = JOIN A BY KNA1_Sold_To, KNVV_SAMPLE BY KNVV_Sold_To;

C = JOIN B BY KNVV_District_Number, DISTRICT BY District_Number;

D = JOIN C BY KNA1_Industry_Code, INDUSTRY BY Industry_Code;

E = JOIN D BY KNA1_CoT_Number, CLASS_OF_TRADE BY CoT_Number;

dump E;

Any help would be much appreciated!

I'm running this on TEZ

2 REPLIES 2
Highlighted

Re: Pig error 1066

You can try to set debug mode:

SET debug 'on'

And, for example, comment out the line with E and try to dump D, if that works, then you can inspect D and

CLASS_OF_TRADE, make sure they look as expected.

Highlighted

Re: Pig error 1066

Contributor

can you post the whole syntax? I want to see what it is exactly you are joining. This error usually happens when you don't cast appropriately. meaning for example A = JOIN CONTACT_ACTIVITY BY Sold_To, KNA1_SAMPLE BY KNA1_Sold_To;

you should make sure you explicitly define the schema like this for all your records that is going to be used in the Join statement like this (chararray) Sold_To:chararray...

I hope it helped!

Don't have an account?
Coming from Hortonworks? Activate your account here