1-844-696-6465 (US)        +91 77600 44484        help@dezyre.com

PIG exception

I am trying store command in PIG , I am getting following exception.

Failed Jobs:
JobId Alias Feature Message Outputs
N/A A MAP_ONLY Message: org.apache.pig.backend.executionengine.ExecException: ERROR 2118: Input path does not exist: file:/user/cloudera/class6-Pig/input/emp/emp.txt
at org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.PigInputFormat.getSplits(PigInputFormat.java:280)
at org.apache.hadoop.mapred.JobClient.writeNewSplits(JobClient.java:944)
at org.apache.hadoop.mapred.JobClient.writeSplits(JobClient.java:961)
at org.apache.hadoop.mapred.JobClient.access$500(JobClient.java:170)
at org.apache.hadoop.mapred.JobClient$2.run(JobClient.java:880)
at org.apache.hadoop.mapred.JobClient$2.run(JobClient.java:833)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:396)
at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1115)
at org.apache.hadoop.mapred.JobClient.submitJobInternal(JobClient.java:833)
at org.apache.hadoop.mapred.JobClient.submitJob(JobClient.java:807)
at org.apache.hadoop.mapred.jobcontrol.Job.submit(Job.java:378)
at org.apache.hadoop.mapred.jobcontrol.JobControl.startReadyJobs(JobControl.java:247)
at org.apache.hadoop.mapred.jobcontrol.JobControl.run(JobControl.java:279)
at java.lang.Thread.run(Thread.java:662)
Caused by: org.apache.hadoop.mapreduce.lib.input.InvalidInputException: Input path does not exist: file:/user/cloudera/class6-Pig/input/emp/emp.txt
at org.apache.hadoop.mapreduce.lib.input.FileInputFormat.listStatus(FileInputFormat.java:231)
at org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.PigTextInputFormat.listStatus(PigTextInputFormat.java:36)
at org.apache.hadoop.mapreduce.lib.input.FileInputFormat.getSplits(FileInputFormat.java:248)
at org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.PigInputFormat.getSplits(PigInputFormat.java:268)
... 14 more

Failed to read data from "/user/cloudera/class6-Pig/input/emp/emp.txt"

Failed to produce result in "/user/cloudera/class6-Pig/pig/store-ex-1"

Job DAG:

The file is there in hdfs I can see it. don't know why it can't find it emp.txt
tried googling it.but kind of stuck.

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.



hi Mughda,

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



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

Your Answer

Click on this code-snippet-icon icon to add code snippet.

Upload Files (Maximum image file size - 1.5 MB, other file size - 10 MB, total size - not more than 50 MB)