【问题标题】:How to save file in Feather format\storage from Spark?如何从 Spark 以 Feather 格式保存文件\存储?
【发布时间】:2016-11-11 06:43:55
【问题描述】:

是否可以将数据帧从 Apache Spark 导出到羽毛 (https://github.com/wesm/feather) 文件?

【问题讨论】:

    标签: pandas apache-spark dataframe spark-dataframe feather


    【解决方案1】:

    不确定,您可以直接执行此操作,但您可以先将 Spark Dataframe(在 pyspark 上)转换为 pandas 并将其存储到 Feather:

    pandas_df = spark_df.toPandas()

    feather.write_feather(pandas_df, 'example_feather')

    但我担心,这会对性能产生影响。

    【讨论】:

    • 是的,它仅在您的数据框适合内存时才有效。所以,不完全是我想要的。
    猜你喜欢
    • 2022-08-23
    • 1970-01-01
    • 2015-12-13
    • 2016-03-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-03-17
    • 1970-01-01
    相关资源
    最近更新 更多