mysqlamazon-s3amazon-aurora

Parameterize S3 URI in LOAD DATA FROM S3 SQL statement (Aurora MySQL)


In our team, we want to import multiple tables from an S3 bucket into an Aurora 8 (MySQL) database using SQL. Yet, the LOAD DATA FROM S3 statement seems only to support literal URI strings, not string expressions. How can we avoid specifying the same S3 bucket URI multiple times?


Solution

  • According to the official specification of Aurora (MySQL) at AWS RDS, the syntax of the LOAD DATA FROM S3 statement only supports static URIs for specifying the S3 data source:

    https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/AuroraMySQL.Integrating.LoadFromS3.html#AuroraMySQL.Integrating.LoadFromS3.Text