Unable to load the data from local file using pig

Hi

I have employee file in documents directory,

Trying to load data in to pig using

student = LOAD '/home/vis/Documents/employee2.txt'  USING PigStorage(',')  as ( id:int, firstname:chararray, lastname:chararray, phone:chararray, city:chararray );

or
> student = LOAD '/Documents/employee2.txt' USING PigStorage(',') as ( id:int, firstname:chararray, lastname:chararray, phone:chararray, city:chararray );

i am recieving error


this is the directory location in ubuntu:

any suggestion how to deal this error ?
> > Alias Feature Message Outputs
> > N/A student MAP_ONLY Message: org.apache.pig.backend.executionengine.ExecException: ERROR 2118: Input path does not exist: file:/home/vis/Desktop/employee2.txt
> > at org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.PigInputFormat.getSplits(PigInputFormat.java:288)
> > at org.apache.hadoop.mapred.JobClient.writeNewSplits(JobClient.java:1054)
> > at org.apache.hadoop.mapred.JobClient.writeSplits(JobClient.java:1071)
> > at org.apache.hadoop.mapred.JobClient.access$700(JobClient.java:179)
> > at org.apache.hadoop.mapred.JobClient$2.run(JobClient.java:983)
> > at org.apache.hadoop.mapred.JobClient$2.run(JobClient.java:936)
> > at java.security.AccessController.doPrivileged(Native Method)
> > at javax.security.auth.Subject.doAs(Subject.java:415)
> > at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1190)
> > at org.apache.hadoop.mapred.JobClient.submitJobInternal(JobClient.java:936)
> > at org.apache.hadoop.mapred.JobClient.submitJob(JobClient.java:910)
> > at org.apache.hadoop.mapred.jobcontrol.Job.submit(Job.java:378)
> > at org.apache.hadoop.mapred.jobcontrol.JobControl.startReadyJobs(JobControl.java:247)
> > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> > at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
> > at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> > at java.lang.reflect.Method.invoke(Method.java:606)
> > at org.apache.pig.backend.hadoop20.PigJobControl.mainLoopAction(PigJobControl.java:157)
> > at org.apache.pig.backend.hadoop20.PigJobControl.run(PigJobControl.java:134)
> > at java.lang.Thread.run(Thread.java:745)
> > at org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.MapReduceLauncher$1.run(MapReduceLauncher.java:270)
> > Caused by: org.apache.hadoop.mapreduce.lib.input.InvalidInputException: Input path does not exist: file:/home/vis/Desktop/employee2.txt
> > at org.apache.hadoop.mapreduce.lib.input.FileInputFormat.listStatus(FileInputFormat.java:235)
> > at org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.PigTextInputFormat.listStatus(PigTextInputFormat.java:36)
> > at org.apache.hadoop.mapreduce.lib.input.FileInputFormat.getSplits(FileInputFormat.java:252)
> > at org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.PigInputFormat.getSplits(PigInputFormat.java:274)
> > … 20 more
> > file:/tmp/temp293514598/tmp319732,

>     >     Input(s):
>     >     Failed to read data from "/home/vis/Desktop/employee2.txt"

>     >     Output(s):
>     >     Failed to produce result in "file:/tmp/temp293514598/tmp319732"

i got the answer, silly mistake

i mentioned " employee2.txt" it should be "employee2 "

1 Like