티스토리 뷰

공부

[Java][Spark] dataframe to csv

seunggabi 승가비 2021. 9. 11. 09:07
    yourDf
    .coalesce(1) // if you want to save as single file
    .write
    .option("sep", "\t")
    .option("encoding", "UTF-8")
    .csv("outputpath")

https://stackoverflow.com/questions/61063446/how-to-write-a-spark-dataframe-tab-delimited-as-a-text-file-using-java

 

How to write a spark dataframe tab delimited as a text file using java

I have a Spark Dataset with lot of columns that have to be written to a text file with a tab delimiter. With csv its easy to specify that option, but how to handle this for a text file when using J...

stackoverflow.com

 

'공부' 카테고리의 다른 글

[Github] Creating a personal access token  (0) 2021.09.11
[Java][Spark] dataframe to csv  (0) 2021.09.11
[Java][Spark] rows to dataframe  (0) 2021.09.11
[Python] Split string every nth character?  (0) 2021.09.11
[Linux] check DNS  (0) 2021.09.11
[Java][Spark] add column & default  (0) 2021.09.11
댓글
댓글쓰기 폼