[Solved] Input path does not exist


The error is pretty self explanatory, so it is probably something simple that you are missing. Can you modify your script and run it as shown below.

Please modify the “fileName” value to where you think the file is.

import java.nio.file.{Paths, Files}
import sys.process._

/************ Modify this line with your data's file name **************/
val fileName = "/home/gmc/exists.csv"

if (Files.exists(Paths.get(fileName))) {
  sc.textFile(fileName).take(5).foreach(println)
} else {
  s"ls -l ${Paths.get(fileName).getParent}".!
}

If you run it with a file that exists, it will display some of the content of that file. If the file does not exist, it will give a directory listing of the parent.

Hopefully this will help you work out what the problem is. If you can not work out the solution using the above, please add the entire output from the above script into your original question.

solved Input path does not exist