My question is exactly same as this How to get path to the uploaded file
But when I try it, I get different results.
I can see my file uploaded into staging directory in log as
20/05/04 15:30:17 INFO Client: Uploading resource file:/home1/irteam/fileName.txt -> hdfs://aaa.aaa.aaa:8020/user/irteam/.sparkStaging/application_1554781627650_743169/fileName.txt
But when I try get it with
spark.read.text(SparkFiles.get('fileName.txt'))
I get error as
Input path does not exist: hdfs://aaa.aaa.aaa:8020/tmp/spark-d5854059-2389-4623-a5ce-431789d81bd3/ ...
That is not the staging directory. How can I get it?
Thank you for reading my question.