简体   繁体   中英

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

当我用选项(“ header”,“ true”)写一个空的数据框但它没有在CSV文件中写任何标题时如何解决?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM