0

captionI want to write my dynamicframe on s3 with xml format . I want to get one xml file of my df. I TRIED THESES lines but got different parts of xml files . Who can help me to fix this problem please???

datasink4 = glueContext.write_dynamic_frame.from_options(frame = df, connection_type = "s3", connection_options = {"path": "s3://datalaketest1/temp"}, format = "xml", transformation_ctx = "datasink4")
ceo
  • 31
  • 1
  • 2
  • 7

1 Answers1

0

In this case, you need to repartition to 1, so it will create only 1 output file:

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")
Gokhan Atil
  • 9,278
  • 2
  • 11
  • 24