Right now, I transferring a lot of small individual spark parquet files from EMR to S3. The way I am currently doing this is by creating a step function, which is what AWS recommends, in the clusters Steps UI, below is an example
JAR location :command-runner.jar
Main class :None
Arguments :/usr/bin/s3-dist-cp --src=/refoutput --dest=s3://***-us-east-1/bens-flattened-step/refs
Action on failure:Continue
I actually need to change parts of the --dest parameter depending on the files that are being uploaded. What I am trying to do, is to create the same step function, except with python code that I can put into my Jupyter notebook, as opposed to doing this with the UI. Is this possible? Also, spark.parquet.write('s3 path') causes S3 to hang when there are a lot of small files, so that is not a viable solution.