Export query results to S3 and on-prem files

Recipe ToolsMarketingDocument/FiledatabaseDeveloper Tool

What it does

When a scheduled time arrives, this automation runs a custom SQL query and exports the results directly to Amazon S3 or an on-prem file destination. Someone receives the data in their chosen location without manual steps.

Who it's for

Data and analytics teams who need to move SQL query results to cloud or local storage on a schedule.

How teams use this

Schedule daily exports to S3

Run the SQL query every morning and send results to an S3 bucket automatically. The team accesses the latest data without running queries manually or downloading files.

Archive query results locally

Export query results to an on-prem file directory on a weekly schedule so historical data stays in local storage. No cloud upload is needed for compliance or performance reasons.

Filter results before export

Add a condition to the SQL query so only records matching specific criteria are exported to S3 and on-prem files. This reduces file size and keeps destinations clean.

Export to multiple S3 buckets

Include an extra S3 presigned URL step so query results go to a backup bucket in addition to the primary one. This adds redundancy without changing the core flow.

How it works

  1. Run on a specified interval. At a scheduled time, this automation wakes up and begins the process of running the SQL query and exporting results to the chosen destination.
  2. Execute custom SQL query. Run a custom SQL query in Jdbc to fetch the data that will be exported to the destination.
  3. Generate on-prem file presigned URL. Create a presigned URL in Onprem Files so the query results can be written to a local directory without additional authentication.
  4. Generate S3 presigned URL. Create a presigned object URL in Amazon S3 so the query results can be exported to an S3 bucket without additional authentication.
  5. Export to both destinations. Send the SQL query results in bulk to both the on-prem file location and S3 bucket using the generated presigned URLs.