raviston Thanasekar
raviston Thanasekar

Reputation: 55

How to write empty data frame headers only to csv file?

when i write an empty data frame with options ("header","true") but it does not write any header on the CSV file how to resolve ?

Upvotes: 1

Views: 703

Answers (1)

steven35
steven35

Reputation: 4017

You can't do this with Spark 2.x and there is no workaround, so you will have to create the file manually. It will work from 3.0 onwards though. Here is the ticket: https://issues.apache.org/jira/browse/SPARK-26208

Upvotes: 3

Related Questions