PIG exception


8 Answer(s)


Perhaps your data file is located in /usr/cloudera/class6-Pig/input/emp/emp.txt and not /user/......

hi Mugdha,

The error says it cannot find the file "Failed to read data from "/user/cloudera/class6-Pig/input/emp/emp.txt". Are you trying to load from hdfs or local filesystem.

Can you see if the file is there in hdfs or local filesystem. I see this as the only issue

i am able to see it in hdfs and ocal file system, however its failing on load, am i missing the configuration setting?
I exported java_home , and added pig.properties file. DO i need to set HADOOP_HOME? to which dir? please help.

While the beginning of your question talks about you trying to Store the data,

the error is actually reading the file is the problem.
So you should check the following:

do a hadoop fs -ls

and also

hadoop fs -ls /user/cloudera/class6-Pig/input/emp/emp.txt

and see the results?

While in the folder also check the persmissions on the file. Not sure if Hadoop looks for it to be only readable or also write and execute. Anycase set it to 777 and try.

-Naveen.

hi Mughda,

Please paste the commands what you are executing. This will help us to know if there is any issue with the commands

Thanks

hi Navin/Dezyre support,
Thanks for the inputs.
I am issuing following commands
hadoop fs -mkdir /user/cloudera/class6-Pig/input/emp/
hadoop fs -put /home/cloudera/class6-Pig/emp.txt /user/cloudera/class6-Pig/input/emp/

A= LOAD '/user/cloudera/class6-Pig/input/emp/emp.txt' using PigStorage(',') as (name:chararray,age:int,salary:int,dept_id:int);

--STORE feature
STORE A into '/user/cloudera/class6-Pig/pig/store-ex-1/' using PigStorage(',');


What about permissions?

hadoop fs -ls should list that. I see by default it does not give permissions to others. it is

-rw-r--r-- Only.


you are right Navin,Thanks i will correct it and try