The code example executes the following steps:
- import modules that are bundled by AWS Glue by default.
- Define some configuration parameters (e.g., the Redshift hostname RedshiftHOST).
- Read the S3 bucket and object from the arguments (see getResolvedOptions) handed over when starting the job.
- Establish a connection to Redshift: connect(...).
- Increase the statement timeout (see statement_timeout) to one hour.
- Execute the COPY query to tell Redshift to the object from S3.