0

I am new to the Spark and Scala Technology. I'm getting the following exception while trying to load a file from local file system into table using Spark. Spark version -2.0 and Scala version - 2.11

scala> sqlContext.sql("LOAD DATA LOCAL INPATH 'file.txt' INTO TABLE student")

org.apache.spark.sql.AnalysisException: LOAD DATA input path does not exist: file.txt

2
  • is the file present in the path from where spark-shell has been initialised? please try by providing the complete path of the file . Commented Jan 8, 2017 at 6:20
  • @Sipra - are you working in "spark local mode"? do you have several executors? Commented Jan 8, 2017 at 7:58

1 Answer 1

1

Please try to give complete path as file:/complete path to the file.

In above case:

sqlContext.sql("LOAD DATA LOCAL INPATH 'file:/complete path to the file.txt' INTO TABLE student") 

~Kedar

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.