Support Questions
Find answers, ask questions, and share your expertise

Create XML file with header using Spark DataFrameWriter

Create XML file with header using Spark DataFrameWriter

New Contributor

I'm working on Java app that uses Spark 2.3.1 to generate xml files from Dataset. The following code doesn't create header in the XML file: 

dataset.
write().
format("xml").
option("encoding", "UTF-8").
option("header", "true").
...

I can't find what key in DataFrameWriter.option (if any) creates XML file header. I tried option("header", "true"), that creates header for CSV files but it doesn't work. So any suggestions please or even better- reference to documented list of all keys available in option for XML files.