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
128 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 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,040 points
1,032 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
• 10,920 points
10,266 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 2, 2018 in Big Data Hadoop by Ashish
• 2,630 points
1,331 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
178 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
• 10,920 points
5,444 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
• 10,920 points
802 views
+1 vote
11 answers

hadoop fs -put command?

put syntax: put <localSrc> <dest> copy syntax: copyF ...READ MORE

answered Dec 7, 2018 in Big Data Hadoop by Aditya
33,693 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,310 points
2,054 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
• 32,970 points
462 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
• 32,970 points
61 views