Sync CSV file from on-prem folder to Redshift

Document/FileDatabase

What it does

When a new CSV file lands in an on-prem folder, this automation reads each row and upserts it into an Amazon Redshift table. Existing records are updated and new ones are created in a single batch operation.

Who it's for

Data and analytics teams who need to load on-prem data into Redshift without manual file transfers.

How teams use this

Load daily sales data into Redshift

Drop a CSV with new orders into the on-prem folder each morning. The automation upserts all rows into the customers table so the data warehouse stays current without manual steps.

Sync account records from legacy system

Export account data from an on-prem database as CSV and place it in the monitored folder. Each row upserts into Redshift so the cloud warehouse mirrors the source system.

Add data validation before upsert

Include a step to filter or check CSV rows against business rules before they reach Redshift. Only valid records are upserted, keeping the table clean.

Route files to different tables

Set a condition to route CSV files to different Redshift tables based on file name or content. One folder feeds multiple tables with a single automation.

How it works

  1. Detect new CSV file. Monitor an on-prem folder for a new CSV file. When one arrives, the automation starts and reads all rows from that file.
  2. Query the collection. Use the Smart List collection to match and prepare each CSV row for the upsert operation in Amazon Redshift.
  3. Upsert rows to Redshift. For each CSV row, upsert the record into the public.account or public.customers table in Amazon Redshift. Updates existing rows and inserts new ones.