I'm trying to read in a text file on Amazon EMR using the python spark libraries. The file is in the home directory (/home/hadoop/wet0), but spark can't seem to find it.
Line in question:
lines = spark.read.text(sys.argv).rdd.map(lambda r: r)
pyspark.sql.utils.AnalysisException: u'Path does not exist: hdfs://ip-172-31-19-121.us-west-2.compute.internal:8020/user/hadoop/wet0;'
If its in the local filesystem, the URL should be file://user/hadoop/wet0 If its in HDFS, that should be a valid path. Use the hadoop fs command to take a look
e.g: hadoop fs -ls /home/hadoop
one think to look at, you say it's in "/home/hadoop", but the path in the error is "/user/hadoop". Make sure you aren't using ~ in the command line, as bash will do the expansion before spark sees it. Best to use the full path /home/hadoop