A very common, error message in Apache Pig is:
ERROR 1066: Unable to open iterator for alias
There are several questions where this error is mentioned, but none of them give a generic approach for dealing with it. Hence this question:
What to do when you get an ERROR 1066: Unable to open iterator for alias ?
The message "ERROR 1066: Unable to open iterator for alias myAlias" suggests that there is something going wrong in the line where you use myAlias.
However, usually you will see this error if something went wrong BEFORE you are trying to use this alias. So the first thing to do is look up further along the error message, and see whether this is truely the first error that is thrown.
Here is what I found to be an efficient way to deal with this error when I did not easily spot an earlier error:
Notes:
pig
or pig -useHCatalog
for example)I once received this error when using the SUM function. I was summing values that had nulls among them. After filtering out the null values in the prior lines, it worked properly.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With