Getting “org.apache.spark.sql.AnalysisException: Path does not exist” from SparkSession.read() [duplicate]
问题 This question already has an answer here : How to get path to the uploaded file (1 answer) Closed 2 years ago . I am trying to read a file submitted by spark-submit to yarn cluster in client mode. Putting file in HDFS is not an option. Here's what I've done: def main(args: Array[String]) { if (args != null && args.length > 0) { val inputfile: String = args(0) //get filename: train.csv val input_filename = inputfile.split("/").toList.last val d = SparkSession.read .option("header", "true")