You can use "csv" instead of the Databricks CSV - the latter now redirects to the default Spark reader. But, this is just a hint :)
In Spark 2.2 a new option has been added - wholeFile
. If you write this:
spark.read.option("wholeFile", "true").csv("file.csv")
it will read all files and process multi-line CSV.
In Spark 2.1 there is no such option. You can read the file using sparkContext.wholeTextFile
or just use the new version
source
share