SparkSession.read (). Csv () can not locate the problem local files

The reason is that there are two spark header

  [File: //] represents the local

  [Hdfs: //] represents the path hdfs

If the path is not a file header, spark the path will be added by default on "hdfs: //"

So if you want to access local csv file, you need to make sure there is a path in front of "file: //"

// java code that tells spark which is a local file 
"file: ///" + url

 

Guess you like

Origin www.cnblogs.com/wanshiming/p/11542965.html