0

I am creating a glue job where output is stored in s3 bucket. S3 path is given as follows:

DF.write.format('csv').mode("overwrite").save("s3://test",header='true')

I want a user defined file name for the output which should be appended with system date.

Ex: test20180101.csv

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
Kiran
  • 868
  • 1
  • 13
  • 23

2 Answers2

0

You can try the following:

DF.write.format('csv').mode("overwrite").save("s3://test/test20180101.csv",header='true')
Aida Martinez
  • 559
  • 3
  • 7
  • This does not work. It creates a new folder `test20180101/` and a new file `part-000-xxx.csv` inside it. – Luke Mar 22 '22 at 08:25
0

You can see this answer - https://stackoverflow.com/a/65631582/11842006

Don't use the partitions given in the code.

For system date you can use datetime -

from datetime import datetime
today = datetime.today() #will given the current date. 

Append today in the Key of copy_object.