Switchboard Docs
Data engineering

Sync files from storage

Load recurring CSV feeds from an S3 bucket.

The S3 (direct) source copies files from a bucket into Switchboard. A resource describes one file feed: which objects to read and how to load them. For a single local file, use Create a model from a file.

Before you start

You need Builder, Admin, or a custom role with source editing access. Contact our support team to arrange access to your S3 bucket, including AWS permissions and role configuration. Continue with the connection details from that setup.

Connect the bucket

  1. Open Sources and select Add Data Source, then S3 (direct).
  2. Enter a Source name and select Continue.
  3. Enter Bucket and, if required, Region.
  4. Enter Access key ID and Secret access key. Alternatively, enter Role ARN and leave the keys blank.
  5. Enter External ID if the role requires one.
  6. Select Connect and check the connection result.

Configure a file feed

  1. Under Resources, select Add resource.
  2. Enter a Key prefix, such as orders/. A prefix restricts which object names the source reads.
  3. Choose Mode and Format from the tables below.
  4. Optionally enter a Key pattern. This regular expression must match the full object name.
  5. For New files, set primary keys that identify each row. _s3_key and _line identify a row within a file.
  6. Review the resource schedule. Select Add resource.
  7. Select Synchronize now and check the resource's status.
ModeBehavior
Latest fileReloads the dataset from the newest matching file each run.
All filesReads every matching file each run. Use for a static set of files.
New filesLoads files that have not been loaded. Updates matching rows using the primary keys.
FormatInput
From the file extensionInfer the format from the object name.
CSVA CSV file.
CSV, gzip-compressedA compressed CSV file.
Zip holding one CSVA ZIP archive containing one CSV.

Configure dated feeds

In New files mode, Date partition describes a date within the object path, such as %Y/%m/%d. Lookback days controls how many recent day paths each run lists. The default is 2. Dedupe on names columns for removing duplicate rows within a run. Keep the latest by selects the column that decides which duplicate to keep. If it is blank, the last row read is kept.

The default resource schedule is daily at 05:00 UTC. Set it after the files arrive.

Verify the imported rows

The source loads file columns as text. Use a model to convert dates and numbers. Rows also include _s3_key, _s3_last_modified, and _line for tracing the source file. If the feed is empty, check the prefix, pattern, and file format. Contact our support team for bucket access or permission errors.

On this page