Not Able to read the file from hdfs location

0 votes

Not able to read the file from hdfs location using spark. But getting the error after running this line

val ordersRDD=sc.textFile("/user/reshma/sqoop_import/retail_db/orders ")

ERROR:

org.apache.hadoop.mapred.InvalidInputException: Input path does not exist: file:/user/reshma/sqoop_import/retail_db/orders
Jul 23, 2019 in Big Data Hadoop by Reshma
2,251 views

2 answers to this question.

0 votes

You have to mention the hdfs path, but you are missing it out. 

For your case, you might change the command to the below:

val RDD = sc,textFile("hdfs:///user/reshma/sqoop_import/retail_db/orders")
answered Jul 23, 2019 by Esha
0 votes

Please make sure you connect to spark2-shell instead of spark-shell. 

>spark2-shell 

Once you get spark shell. The following code should work -

val ordersRDD = sc.textFile("/user/reshma/sqoop_import/retail_db/orders.csv")
ordersRDD.collect()
answered Jul 14, 2020 by Shantanu
• 190 points

Related Questions In Big Data Hadoop

0 votes
1 answer

Not able to create Hive table from HDFS file

You dont have to specify the file name ...READ MORE

answered Dec 5, 2018 in Big Data Hadoop by Omkar
• 69,220 points
2,531 views
0 votes
1 answer

Copy file from HDFS to the local file system

There are two possible ways to copy ...READ MORE

answered Mar 27, 2018 in Big Data Hadoop by nitinrawat895
• 11,380 points
17,102 views
0 votes
1 answer

Error while copying the file from local to HDFS

Well, the reason you are getting such ...READ MORE

answered May 3, 2018 in Big Data Hadoop by Ashish
• 2,650 points
3,993 views
0 votes
1 answer

Not able to upload files to hdfs: No such file or directory

The reason for this error is that ...READ MORE

answered Jul 11, 2019 in Big Data Hadoop by Srujan
4,153 views
+1 vote
1 answer

Hadoop Mapreduce word count Program

Firstly you need to understand the concept ...READ MORE

answered Mar 16, 2018 in Data Analytics by nitinrawat895
• 11,380 points
11,029 views
0 votes
1 answer

hadoop.mapred vs hadoop.mapreduce?

org.apache.hadoop.mapred is the Old API  org.apache.hadoop.mapreduce is the ...READ MORE

answered Mar 16, 2018 in Data Analytics by nitinrawat895
• 11,380 points
2,536 views
+2 votes
11 answers

hadoop fs -put command?

Hi, You can create one directory in HDFS ...READ MORE

answered Mar 16, 2018 in Big Data Hadoop by nitinrawat895
• 11,380 points
108,832 views
–1 vote
1 answer

Hadoop dfs -ls command?

In your case there is no difference ...READ MORE

answered Mar 16, 2018 in Big Data Hadoop by kurt_cobain
• 9,350 points
4,612 views
0 votes
1 answer

How to load data from HDFS into pig relation?

Hey, To load data from HDFS to pig ...READ MORE

answered May 7, 2019 in Big Data Hadoop by Gitika
• 65,770 points
3,250 views
0 votes
1 answer

How to check your file is created on HDFS?

Hey,  There is a process or steps you ...READ MORE

answered May 7, 2019 in Big Data Hadoop by Gitika
• 65,770 points
1,081 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP