错误 1066:无法打开别名的迭代器 - Pig [英] ERROR 1066: Unable to open iterator for alias - Pig

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

问题描述

刚开始的猪;试图从文件中加载数据并在以后转储它.加载似乎是正确的,没有抛出错误.以下是查询:

<块引用>

NYSE = LOAD '/root/Desktop/Works/NYSE-2000-2001.tsv' 使用PigStorage() AS (exchange:chararray, stock_symbol:chararray,日期:字符数组,stock_price_open:浮动,stock_price_high:浮动,stock_price_low:float, stock_price_close:float, stock_volume:int,stock_price_adj_close:float);

当我尝试执行转储时,它会引发以下错误:

猪堆栈跟踪

<块引用>

错误 1066:无法打开别名 NYSE 的迭代器org.apache.pig.impl.logicalLayer.FrontendException:错误 1066:无法打开别名 NYSE 的迭代器在 org.apache.pig.PigServer.openIterator(PigServer.java:857)在 org.apache.pig.tools.grunt.GruntParser.processDump(GruntParser.java:682)在 org.apache.pig.tools.pigscript.parser.PigScriptParser.parse(PigScriptParser.java:303)在 org.apache.pig.tools.grunt.GruntParser.parseStopOnError(GruntParser.java:189)在 org.apache.pig.tools.grunt.GruntParser.parseStopOnError(GruntParser.java:165)在 org.apache.pig.tools.grunt.Grunt.run(Grunt.java:69)在 org.apache.pig.Main.run(Main.java:490)在 org.apache.pig.Main.main(Main.java:111)引起:java.io.IOException:作业终止,异常状态失败在 org.apache.pig.PigServer.openIterator(PigServer.java:849)"

知道是什么导致了问题吗?

解决方案

您是否正在针对 hadoop 2.2 运行 Pig 0.12.0 或更早版本的 jar,如果是这种情况,则我设法通过从 src 重新编译 pig jar 来解决此错误,这里是 debian 类型框

所涉及步骤的摘要

  1. 下载pig-0.12.0.tar.gz

  2. 解压jar包并设置权限

  3. 然后在解压后的目录中用'ant clean jar -Dhadoopversion=23'

  4. 编译src

然后你需要在你的maven类路径上获取jar,例如,在同一目录

mvn install:install-file -Dfile=pig.jar -DgroupId={set a groupId}-DartifactId={设置一个 artifactId} -Dversion=1.0 -Dpackaging=jar

或者如果在 Eclipse 中,则添加 jar 作为外部库/依赖项

我正在尝试在 hadoop 2.2.0 中运行 pig 12 时得到您的确切跟踪,并且上述步骤对我有用

更新
我在 Pig jira 上发布了我的问题,他们做出了回应.他们有一个已经为 hadoop2 pig-h2.jar 编译的猪罐子 http://search.maven.org/#artifactdetails|org.apache.pig|pig|0.12.0|jar
这个jar的maven标签是

<块引用>

 <依赖><groupId>org.apache.pig</groupId><artifactId>猪</artifactId><classifier>h2</classifier><version>0.12.0</version><范围>提供</范围></依赖>

Just started Pig; trying to load the data from a file and dump it henceforth. Loading seems to be proper, no error is thrown. Below is the query:

NYSE = LOAD '/root/Desktop/Works/NYSE-2000-2001.tsv' USING PigStorage() AS (exchange:chararray, stock_symbol:chararray, date:chararray, stock_price_open:float, stock_price_high:float, stock_price_low:float, stock_price_close:float, stock_volume:int, stock_price_adj_close:float);

When I try to do the Dump, it throws the following error:

Pig Stack Trace

ERROR 1066: Unable to open iterator for alias NYSE org.apache.pig.impl.logicalLayer.FrontendException: ERROR 1066: Unable to open iterator for alias NYSE at org.apache.pig.PigServer.openIterator(PigServer.java:857) at org.apache.pig.tools.grunt.GruntParser.processDump(GruntParser.java:682) at org.apache.pig.tools.pigscript.parser.PigScriptParser.parse(PigScriptParser.java:303) at org.apache.pig.tools.grunt.GruntParser.parseStopOnError(GruntParser.java:189) at org.apache.pig.tools.grunt.GruntParser.parseStopOnError(GruntParser.java:165) at org.apache.pig.tools.grunt.Grunt.run(Grunt.java:69) at org.apache.pig.Main.run(Main.java:490) at org.apache.pig.Main.main(Main.java:111) Caused by: java.io.IOException: Job terminated with anomalous status FAILED at org.apache.pig.PigServer.openIterator(PigServer.java:849)"

Any idea what's causing the issue?

解决方案

Are you running a pig 0.12.0 or earlier jar against hadoop 2.2, if this is the case then I managed to get around this error by recompiling the pig jar from src, here is a summary of the steps involved on a debian type box

  1. download the pig-0.12.0.tar.gz

  2. unpack the jar and set permissions

  3. then inside the unpacked directory compile the src with 'ant clean jar -Dhadoopversion=23'

then you need to get the jar on your class-path in maven, for example, in the same directory

mvn install:install-file -Dfile=pig.jar -DgroupId={set a groupId}-
                 DartifactId={set a artifactId} -Dversion=1.0 -Dpackaging=jar  

or if in eclipse then add jar as external libary/dependency

I was getting your exact trace trying to run pig 12 in a hadoop 2.2.0 and the above steps worked for me

UPDATE
I posted my issue on the pig jira and they responded. They have a pig jar already compiled for hadoop2 pig-h2.jar here http://search.maven.org/#artifactdetails|org.apache.pig|pig|0.12.0|jar
a maven tag for this jar is

  <dependency>
       <groupId>org.apache.pig</groupId>
       <artifactId>pig</artifactId>
      <classifier>h2</classifier>
      <version>0.12.0</version>
      <scope>provided</scope>
  </dependency>  

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

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