I was following this tutorial (https://www.guru99.com/pyspark-tutorial.html) and trying to read the csv file with sqlContext.read.csv, but this error showed:'Path does not exist: file:/C:/Users/asus/AppData/Local/Temp/spark-62c50c87-060e-49f7-b331-111abfa496f3/userFiles-da6cdfff-ea8a-426c-b4f4-fe5a15c67794/adult.csv;'
I heard that I might have to copy the file across all the nodes of same shared file system or use HDFS, but I don't know exactly how I should do these.
This is the code:
from pyspark.sql import SQLContext
sqlContext = SQLContext(sc)
df = sqlContext.read.csv(SparkFiles.get("adult.csv"), header=True, inferSchema= True)
This is the result I got:
AnalysisException: 'Path does not exist: file:/C:/Users/asus/AppData/Local/Temp/spark-62c50c87-060e-49f7-b331-111abfa496f3/userFiles-da6cdfff-ea8a-426c-b4f4-fe5a15c67794/adult.csv;'