有谁知道我在哪里可以找到 pyspark.sql.DataFrameWriter
中 saveAsTable()
函数的可用格式列表?在 the documentation它只是说“用于保存的格式”。
我看到的每个示例都使用“ Parquet ”,但我找不到其他提及的内容。具体来说,我想以某种方式从 pyspark 中保存到 Feather。
谢谢!
最佳答案
据我所知,开箱即用的源代码支持命令 https://github.com/apache/spark/blob/master/sql/core/src/main/scala/org/apache/spark/sql/DataFrameWriter.scala格式为:
- Parquet
- JSON
- 兽人
- JDBC
- 正文
- csv
- 来源(仅获取来源 您保存的格式)
因此 Feather 不支持开箱即用的 saveAsTable()。根据您的设置,您可以尝试直接保存到 HDFS,就像这样:"
import feather
path= "my_data.feather" #this would then be your full hdfs URI
feather.write_dataframe(df, path)
希望这对您有所帮助,如果有任何错误或不清楚的地方,请告诉我。
关于apache-spark - pyspark.sql.DataFrameWriter.saveAsTable() 的格式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44530799/