hortonworks沙盒Pig脚本

to94eoyn  于 2021-06-04  发布在  Hadoop
关注(0)|答案(3)|浏览(346)

嗨,我刚刚在Windows7的virtualbox上安装了hortonworks沙盒。我把一切都准备好,开始了Pig的教程。我想运行这个简单的表加载pig脚本:

-- Get all IBM stocks
a = LOAD 'default.nyse_stocks' USING org.apache.hive.hcatalog.pig.HCatLoader();
b = filter a by stock_symbol == 'IBM';
dump b;

我得到这个错误:

Failed to parse: Pig script failed to parse: 
<file script.pig, line 2, column 37> pig script failed to validate: org.apache.pig.backend.executionengine.ExecException: ERROR 1070: Could not resolve org.apache.hive.hcatalog.pig.HCatLoader using imports: [, java.lang., org.apache.pig.builtin., org.apache.pig.impl.builtin.]

不确定要做什么。对hadoop相当陌生。谢谢

bfnvny8b

bfnvny8b1#

如果有人在完成hortonworks hdp 2.4教程后遇到这个问题,比如我,答案是:

1. Open the script in the Pig view in Ambari
   2. Below the query editor, there are 'Arguments'
   3. Choose +Add, then type in -useHCatalog
eqoofvh9

eqoofvh92#

将jar文件名hcatalog*.jar复制到路径“<%hadoop\u home>\bin\share\hcatalog”

lymgl2op

lymgl2op3#

“arguments”的用法(beeks的回答)是有效的,因为需要小心处理这个案例:-usehcatalog,而不是-usehcatalog。

相关问题