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;
Any help would be much appreciated!
I'm running this on TEZ
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.
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!