0

标题我想用 xml 格式在 s3 上编写我的动态框架。我想获取我的 df 的一个 xml 文件。我尝试了这些行,但得到了 xml 文件的不同部分。请问谁能帮我解决这个问题???

datasink4 = glueContext.write_dynamic_frame.from_options(frame = df, connection_type = "s3", connection_options = {"path": "s3://datalaketest1/temp"}, format = "xml", transformation_ctx = "datasink4")
4

1 回答 1

0

在这种情况下,您需要重新分区为 1,因此它只会创建 1 个输出文件:

repartitioned_df = df.repartition(1)
datasink4 = glueContext.write_dynamic_frame.from_options(frame = repartitioned_df, connection_type = "s3", connection_options = {"path": "s3://datalaketest1/temp"}, format = "xml", transformation_ctx = "datasink4")
于 2019-12-27T14:26:57.697 回答