错误1066:无法打开别名的迭代器-Pig [英] ERROR 1066: Unable to open iterator for alias - Pig
问题描述
刚开始养猪;尝试从文件中加载数据,然后将其转储.加载似乎是正确的,不会引发任何错误.下面是查询:
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'使用 PigStorage()AS(交易所:chararray,stock_symbol:chararray, 日期:字符数组,股票价格开盘价:浮动,股票价格高价:浮动, stock_price_low:浮动,stock_price_close:浮动,stock_volume:int, stock_price_adj_close:float);
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:
错误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:作业以异常状态FAILED终止 在org.apache.pig.PigServer.openIterator(PigServer.java:849)"
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?
推荐答案
您是否针对hadoop 2.2
运行Pig 0.12.0或更早版本的jar,如果是这种情况,那么
我设法通过重新编译src
的猪罐子来解决此错误,这是debian
类型框
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
-
下载
pig-0.12.0.tar.gz
打开罐子并设置权限
然后在解压目录中使用'ant clean jar -Dhadoopversion=23'
then inside the unpacked directory compile the src with 'ant clean jar -Dhadoopversion=23'
然后,您需要将jar放在maven中的类路径中,例如,在 相同目录
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
或在eclipse中添加jar作为外部库/依赖项
or if in eclipse then add jar as external libary/dependency
我在尝试在hadoop 2.2.0
中运行pig 12
时得到了准确的跟踪,并且上述步骤对我有用
I was getting your exact trace trying to run pig 12
in a hadoop 2.2.0
and the above steps worked for me
更新
我在猪吉拉上张贴了我的问题,他们回应了.他们有一个已经为hadoop2 pig-h2.jar编译的猪缸,这里
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屋!