Hi Mina, Even text won't work you may try this df.coalesce(1).write.option("h eader","true").mode("overwrite").save("output",format=text) Else convert to an rdd and use saveAsTextFile
Regards, Snehasish On Wed, Feb 21, 2018 at 3:38 AM, SNEHASISH DUTTA <info.snehas...@gmail.com> wrote: > Hi Mina, > This might work then > > df.coalesce(1).write.option("header","true").mode("overwrite > ").text("output") > > Regards, > Snehasish > > On Wed, Feb 21, 2018 at 3:21 AM, Mina Aslani <aslanim...@gmail.com> wrote: > >> Hi Snehasish, >> >> Using df.coalesce(1).write.option("header","true").mode("overwrite >> ").csv("output") throws >> >> java.lang.UnsupportedOperationException: CSV data source does not >> support struct<...> data type. >> >> >> Regards, >> Mina >> >> >> >> >> On Tue, Feb 20, 2018 at 4:36 PM, SNEHASISH DUTTA < >> info.snehas...@gmail.com> wrote: >> >>> Hi Mina, >>> This might help >>> df.coalesce(1).write.option("header","true").mode("overwrite >>> ").csv("output") >>> >>> Regards, >>> Snehasish >>> >>> On Wed, Feb 21, 2018 at 1:53 AM, Mina Aslani <aslanim...@gmail.com> >>> wrote: >>> >>>> Hi, >>>> >>>> I would like to serialize a dataframe with vector values into a >>>> text/csv in pyspark. >>>> >>>> Using below line, I can write the dataframe(e.g. df) as parquet, >>>> however I cannot open it in excel/as text. >>>> df.coalesce(1).write.option("header","true").mode("overwrite >>>> ").save("output") >>>> >>>> Best regards, >>>> Mina >>>> >>>> >>> >> >