错误 1066:无法在 Pig 中打开别名的迭代器,通用解决方案 [英] ERROR 1066: Unable to open iterator for alias in Pig, Generic solution

查看:27
本文介绍了错误 1066:无法在 Pig 中打开别名的迭代器,通用解决方案的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Apache Pig 中一个非常常见的错误消息是:

A very common, error message in Apache Pig is:

错误 1066:无法打开别名的迭代器

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:

收到 ERROR 1066: Unable to open iterator for alias 时该怎么办?

What to do when you get an ERROR 1066: Unable to open iterator for alias ?

推荐答案

消息ERROR 1066: Unable to open iterator for alias myAlias"表明您使用 myAlias 的行中出现问题.

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:

  1. 在您首次定义别名之前运行代码.
  2. 仔细查看,是否看到任何提及 ERROR 的内容(通常在最后几行,但有时可能会更早发生)
  3. 现在您可能有错误,如果有:处理它并转到 1.
  4. 在遇到别名之前,您可能没有出错,在这种情况下,评估出现别名的行.
  5. 如果出现错误:处理后转4;如果没有发生错误,请在第二次使用别名之前运行代码,然后转到 3.

注意事项:

  • 要轻松地逐行运行 PIG 代码:在命令行上打开 pig(例如,只需键入 pigpig -useHCatalog)
  • 如果您感到困惑,请确保只定义一次别名.(我相信这是一般的好做法)

这篇关于错误 1066:无法在 Pig 中打开别名的迭代器,通用解决方案的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆