Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to save file in Feather format\storage from Spark?

Is it possible to export data-frame from Apache Spark to feather (https://github.com/wesm/feather) file?

like image 753
Dmitry Petrov Avatar asked Jul 08 '16 16:07

Dmitry Petrov


1 Answers

Not sure, you can do it directly, but you can transform first the Spark Dataframe (on pyspark) to a pandas and store it the to Feather:

pandas_df = spark_df.toPandas()

feather.write_feather(pandas_df, 'example_feather')

But I afraid, this will have an impact on the performance.

like image 109
Christoph Haene Avatar answered Sep 27 '22 23:09

Christoph Haene