Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

How to concatenate a date to a filename in pyspark

Solved Go to solution

Re: How to concatenate a date to a filename in pyspark

@Carlton Patterson

You can use "mode("append")" to append the new data to existing one.

counts.coalesce(1).write.mode("append").csv("/home/packt/Downloads/myresults7-"+currentdate+".csv")     

P.S please use 'reply' on this comment instead of writing a new comment. In this way we can maintain the conversaion in order.

Highlighted

Re: How to concatenate a date to a filename in pyspark

New Contributor

Hi Sandeep, thanks. It works very well. Thank you

Re: How to concatenate a date to a filename in pyspark

@Carlton Patterson Glad it helped, Do click on 'Accept' on my answer and mark this thread as closed.

Re: How to concatenate a date to a filename in pyspark

@Carlton Patterson Looks like you have accepted another comment. I've made this reply as comment and this should be the correct one to accept as it helped in resolving your issue. :)

Don't have an account?
Coming from Hortonworks? Activate your account here