I am using the following code to export my data frame to csv:
data.write.format(\'com.databricks.spark.csv\').options(delimiter=\"\\t\", codec=\"org.apache.hadoo
You don't use all the options provided by the CSV writer. It has quoteMode
parameter which takes one of the four values (descriptions from the org.apache.commons.csv
documentation:
ALL
- quotes all fieldsMINIMAL
(default) - quotes fields which contain special characters such as a delimiter, quotes character or any of the characters in line separatorNON_NUMERIC
- quotes all non-numeric fieldsNONE
- never quotes fieldsIf want to avoid quoting the last options looks a good choice, doesn't it?