Reputation: 11
I am a beginner in Hadoop. My pig code in hortonworks sandbox is:
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';
And error is this in sandbox:
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.
What is going wrong?
Upvotes: 0
Views: 812
Reputation: 323
You could be getting this error because have not updated your .bashrc variables. Go vi ~/.bashrc then insert
export PIG_HOME=/usr/lib/pig/pig-0.12.0
export PATH=$PATH:$PIG_HOME/bin
Then try executing pig in mapreduce version:
pig -x mapreduce
Now you can execute your pig script via "grunt>". If you want to run a shell script try this:https://github.com/sindresorhus/grunt-shell
Upvotes: 0