Failed to read from local file system in Linux spark

apache-spark

#1

Hi team,

I am not able to read data from local file system in spark. I am using web console for practice.

Code:

val crime = sc.textFile("/public/crime/csv")

crime.take(1)

Error:


#2

You are using the wrong path.
Correct path is /data/crime/csv not /public/crime/csv

Hope that helps!


#3

Still same error


#4

@hardik_patira If you are reading data from local launch spark-shell as local and try your query.

spark-shell --master local --conf spark.ui.port=12569


#5

Got the solution. Its my bad.

Path should start file:///

Three forward slashes. i was using only two.