COPY manifests.
Redshift setup
The connector does not have a provisioned/Serverless switch. Supply the provisioned cluster endpoint or Serverless workgroup endpoint ashost; both
use the same PostgreSQL-compatible connection. The default port is 5439.
The security group associated with the cluster or workgroup must allow inbound
traffic from the Filament worker on the configured port. See AWS’s
Redshift network configuration guide.
Filament currently connects with a Redshift database username and password.
The user needs permission to create and use the destination schema, create
temporary tables, and create and alter destination tables. A dedicated schema
owned by the Filament user is the simplest setup. Pre-existing destination
tables must also allow the user to insert and delete rows.
S3 load staging
Create a private, general-purpose S3 bucket in the same AWS Region as the Redshift cluster or Serverless workgroup. Loading requires two distinct AWS identities:- The Filament worker identity uses the AWS SDK default credential chain.
It needs
s3:ListBucketon the bucket ands3:PutObjectpluss3:DeleteObjectunder the configured staging prefix. - The Redshift associated IAM role needs
s3:ListBucketands3:GetObjectfor the same bucket and prefix. Associate the role with the provisioned cluster or Serverless namespace before using it forCOPY.
default when the S3-read role is Redshift’s
default role, or provide its full ARN. If role use is restricted by database
user, grant the Filament user ASSUMEROLE permission for COPY.
The worker identity uploads and deletes staged objects; the associated Redshift
role reads them. Granting S3 access to only one identity is not sufficient.
filament/load-staging. Filament appends the
pipeline ID and run-scoped hashes to prevent pipelines and runs from sharing
objects:
Configuration
The sink prefers batches no larger than 100,000 rows or approximately 256 MiB,
whichever limit is reached first.
Supported write modes
The sink advertisesfull_replace, full_append, full_upsert,
incremental_append, incremental_upsert, incremental_delete, cdc_append,
and cdc_merge. See
replication modes.
- Replace loads a run-scoped replacement table and promotes it at commit.
- Append adds each batch directly to the destination.
- Upsert, delete, and merge fold repeated keys to their final operation, delete matching destination keys, and insert surviving rows in one transaction. These modes require a primary key.
Table management
Before extraction,EnsureSchema runs per resource:
- Create the destination schema and typed table if they do not exist.
- Inspect
information_schema.columnsand add missing columns. - For replace, create an empty run-scoped replacement table.
DISTSTYLE AUTO, SORTKEY AUTO,
and ENCODE AUTO, allowing Redshift to evolve distribution, sorting, and
compression based on the workload. See AWS’s
automatic table optimization
documentation.
Type mapping
Write mechanics and atomicity
Each Arrow batch is encoded as Snappy-compressed Parquet files. The file count is based on approximately 64 MiB of unencoded input per file and, when the row count permits, rounded up to a multiple of eight for parallelCOPY work.
Each manifest contains at most 128 Parquet files. Larger batches produce
multiple manifests, which are copied sequentially into the same temporary
table and transaction. This is a per-manifest boundary, not a row or run limit;
large initial syncs continue across normal engine batches.
The sink verifies S3 uploads with CRC32C, compares the loaded row count with the
submitted batch, and returns an encoded checksum in the write receipt. The
temporary load table, destination mutation, and replay token commit in one
Redshift transaction.
Append and keyed writes become visible per batch; no transaction covers an
entire run. Replace batches remain in a replacement table until Commit, which
locks, clears, and refills the live table in one transaction per resource.
Multiple resources are promoted independently.
A replay ledger named _filament_load_batches prevents the same batch from
being applied twice. Reusing a replay token with different content is treated
as an integrity error.
Failure behavior
A failed append run can leave earlier committed batches in the destination, but retrying the same run does not duplicate them. Upsert, delete, and merge retries converge through both the replay ledger and primary key. A failed replace leaves the previous destination rows intact.Abort drops the
run-scoped replacement table and its replay entries. Additive schema changes
made before the failure remain in place.
Troubleshooting
- A connection timeout usually means the Redshift endpoint is not reachable from the worker or its associated security group does not allow the database port.
access bucketmeans the worker identity cannot inspect the configured bucket. Check the bucket name, Region, bucket policy, ands3:ListBucket.- S3 upload or cleanup errors require
s3:PutObjectands3:DeleteObjecton the configured staging prefix for the worker identity. - A
COPY manifestaccess error concerns the associated Redshift role, not the worker role. Confirm itss3:GetObjectaccess and its association with the cluster or namespace. - Region errors require the staging bucket and Redshift deployment to use the same AWS Region.