Reputation: 37
I am reading a Hive table through Spark SQL and storing it in a Spark Dataframe. I am then exporting the data from the Data frame to CSV using coalesce command & it was successful. The only problem is I want to have the CSV Header in some understandable words but it is just the column names.
Is there a way to have my CSV header customized ?
Upvotes: 0
Views: 304
Reputation: 6082
You can use df.withColumnRenamed('old', 'new')
to rename columns before saving as CSV
Upvotes: 1