How to overwrite textfile using RDD

apache-spark
scala

#1

Hello,

Can someone suggest me best way how to overwrite data while using RDD.

Below is the command that I want to run twice to overwrite my existing data:

dataResult.saveAsTextFile("/user/dkothari/Result/")

Note: I know in DataFrame we have saveMode function to overwrite existing files but not sure how to do it using RDD.

Thanks
Divya


#2

check this
https://community.hortonworks.com/questions/59140/apache-spark-overwrite-data-file.html


#3

Thanks Vani for the help.


#4