How to catch exception , if my file is not found in given location in spark csv read?
try {
val df = sqlCxt.read.format("csv")
.option("delimiter", "|")
.load("C:/Users/swapnil.shirke/Downloads/dataset/u.item");
}
catch {
case ex: FileNotFoundException => {
println(" file missing exception")
}
case ex: Exception => ex.printStackTrace()
}
given try catch condition not worked.