hortonworks沙箱中的猪错误
Posted
技术标签:
【中文标题】hortonworks沙箱中的猪错误【英文标题】:Pig error in hortonworks sandbox 【发布时间】:2015-05-17 17:58:52 【问题描述】:我是 Hadoop 的初学者。我在hortonworks沙盒中的猪代码是:
raw=load 'SchoolDataSet.csv' using org.apache.hcatalog.pig.hcatloader();
es=foreach raw generate times as timestamp,ip,country,status;
store es into 'SchoolDataSet.csv'using org.dataset.hadoop.pig.esstorage();
stock_a=load 'SchoolDataSet.csv' using pigstore(',')
AS (name:chararray,TypeofSchool:chararray,
SexStudents:boolean, Branchofstudy:chararray,
Evidence:chararray, FieldofStudy:chararray,
Side:chararray,Status:chararray, Cityoffice:chararray,
LessonName:chararray,PersonalCode:int,
SchoolCode:int, LessonCode:int,NumberOfStudents:int,
OfreNewal:int,ReasonableNumber:int,
Meanscores:float,Acceptancerate:float,Experience:int);
describe stock_a;
B = LIMIT STOCK_A 100;
DESCRIBE B;
dump b;
C = FOREACH B GENERATE symbol, date, close;
DESCRIBE C;
STORE C INTO 'output/C';
沙盒中的错误是:
ls: cannot access /usr/lib/hive/lib/slf4j-api-*.jar: No such file or directory
2015-05-15 12:37:13,349 [main] INFO org.apache.pig.Main - Apache Pig version 0.12.1.2.1.1.0-385
(rexported) compiled Apr 16 2014, 15:59:00
2015-05-15 12:37:13,350 [main] INFO org.apache.pig.Main - Logging error messages to:
/hadoop/yarn/local/usercache/hue/appcache/application_1431515718576_0020/container_143151
5718576_0020_01_000002/pig_1431718633347.log
2015-05-15 12:37:14,510 [main] INFO org.apache.pig.impl.util.Utils - Default bootup file
/home/yarn/.pigbootup not found
2015-05-15 12:37:14,869 [main] INFO org.apache.hadoop.conf.Configuration.deprecation -
mapred.job.tracker is deprecated. Instead, use mapreduce.jobtrac
1 of 2
Displaying SandBoxCode.docx.
出了什么问题?
【问题讨论】:
如果您使用的是 Hcat,那么您应该提供表名而不是文件,或者您应该提供文件的完整路径。 【参考方案1】:您可能会收到此错误,因为尚未更新您的 .bashrc 变量。去 vi ~/.bashrc 然后插入
export PIG_HOME=/usr/lib/pig/pig-0.12.0
export PATH=$PATH:$PIG_HOME/bin
然后尝试在mapreduce版本中执行pig:
pig -x mapreduce
现在你可以通过“grunt>”来执行你的猪脚本了。如果你想运行一个 shell 脚本试试这个:https://github.com/sindresorhus/grunt-shell
【讨论】:
以上是关于hortonworks沙箱中的猪错误的主要内容,如果未能解决你的问题,请参考以下文章
如何将文件从 Windows 传输到 HortonWorks 沙箱?
Hive 中的多个 SLF4J 绑定 - Hortonworks 沙箱
如何在Hortonworks沙箱Hadoop平台中运行mapreduce作业
hortonworks 网站不支持下载 HDP Sandbox