โ06-25-2021 02:10 PM
When I try to save my file I get
org.apache.spark.sql.AnalysisException: Text data source supports only a single column, and you have 2 columns.;
Is there any way to save a dataframe with more than one column to a .txt file?
โ06-25-2021 02:45 PM
Would pyspark.sql.DataFrameWriter.csv work? You could specify the separator (sep) as tab
df.write.csv(os.path.join(tempfile.mkdtemp(), 'data'))
never-displayed
Passionate about hosting events and connecting people? Help us grow a vibrant local communityโsign up today to get started!