For the complete documentation index, see llms.txt. Markdown versions of documentation pages are available by appending .md to page URLs.
Skip to content

AWS Redshift

AWS Redshift batch source. Reads tables or custom SQL via the PostgreSQL-compatible wire protocol; the connector address uses the redshift:// scheme and rewrites it internally.

Amazon Redshift is AWS's columnar data warehouse. Nilus reads from Redshift as a batch source through the PostgreSQL-compatible wire protocol (redshift+psycopg2://), so anything that works on a psql client works for Nilus too.

For information on writing into Redshift, see the Redshift.

Requirements

Connectivity and credentials must both be in place before the pipeline can run.

Connectivity

  • The Nilus runtime must reach the Redshift cluster's leader node on TCP 5439 (default). For Redshift Serverless, the endpoint is <workgroup>.<account-id>.<region>.redshift-serverless.amazonaws.com:5439. For provisioned clusters, it is <cluster>.<account-id>.<region>.redshift.amazonaws.com:5439.

  • Inbound network access from the runtime VPC. Either: a) the cluster is in the same VPC and a security-group rule allows the runtime IPs on port 5439, or b) the cluster has a public endpoint and a security-group rule allows the runtime's egress IPs.

  • If the cluster requires SSL (recommended; on by default for new clusters), the runtime trusts AWS's standard Redshift CA bundle. No customer action required for the standard CA.

Required parameters

Parameter
Required
Default
Description

host

Yes

-

Cluster endpoint hostname (provisioned or serverless).

port

No

5439

TCP port for the wire protocol.

username

Yes

-

Redshift user with SELECT on the target tables.

password

Yes

-

Password for the user.

database

Yes

-

Database name on the cluster (Redshift clusters have one database; serverless workgroups one database per workgroup).

Database-side permissions

The ALTER DEFAULT PRIVILEGES line ensures Nilus continues to have SELECT on tables created in the schema after the grant.

URI format

redshift:// is the canonical scheme but redshift+psycopg2:// is what Nilus's connector registry dispatches on (both work). sslmode=require is strongly recommended for production clusters reachable over the public internet.

Depot-backed equivalent (recommended for production):

The depot carries host, port, database, and the credential secret in one place.

Source options

Option
Required
Description

source_table

Yes

Fully qualified table name in <schema>.<table> form. Cross-database reads are not supported on Redshift, each manifest reads from one database.

incremental_key

No

Timestamp or numeric column used to identify newly visible rows for each run. LOAD_TIMESTAMP-style audit columns and sequence-backed id columns are the standard picks.

interval_start

No

Optional ISO-8601 lower bound for the extraction window.

interval_end

No

Optional ISO-8601 upper bound for the extraction window.

page_size

No

Rows per extraction batch (default 50000). For wide rows, lower this to keep per-batch memory bounded.

sql_reflection_level

No

full (default) or reduced, controls how thoroughly Nilus reflects the source schema before extraction.

sql_limit

No

Caps total rows extracted per run. Use for sampling and validation.

sql_exclude_columns

No

Comma-separated column names to skip during extraction.

type_hints

No

Object map of column_name: <type> to override inferred types. Supported types: text, bigint, bool, timestamp, date, decimal, double, binary, json, time.

max_table_nesting

No

String. "0" for fully flattened analytics-friendly output (default for SQL sources).

Redshift's SUPER columns containing nested JSON arrive at the connector as text. Set type_hints: { <col>: json } if you need the downstream pipeline to treat them as JSON rather than strings.

Sample Nilus configs

Each example below is self-contained and uses the current Nilus pipeline shape.

Batch, incremental snapshot to Lakehouse

Batch, direct URI with projected secret

Behavior and capabilities

  • Compute model: Nilus connects over the PostgreSQL-compatible wire protocol and submits parameterized SQL reads against the cluster's leader node. Redshift's distributed compute resolves the query plan; the connector consumes the rowset over the wire.

  • Object model: Redshift databases, schemas, tables, and late-binding views, addressed as <schema>.<table>.

  • Pipeline type: batch only on this page.

  • Authentication modes: username + password. IAM-based auth (temporary credentials via GetClusterCredentials) is not currently wired through the connector; rotate passwords on a regular cadence and store them in a DataOS depot or secret.

  • Custom queries: supply source_table: "query:SELECT ... FROM ..." to extract from a hand-authored SQL query. Useful for joining across schemas or pre-aggregating before extraction.

  • Lakehouse decimals: table reads preserve source precision and scale (NUMERIC(20,4) becomes Iceberg decimal(20,4)). query: extracts store decimals as Iceberg decimal(38,9). Do not mix these extract styles on the same dest_table. See Custom Query (SQL Sources) and Schema evolution.

  • Concurrency: Redshift charges per query-second of cluster work. Heavy ingestion windows can compete with downstream BI workloads; consider running on Redshift Serverless or a dedicated WLM queue for ingestion.

Troubleshooting

Symptom
Likely cause
Resolution

could not connect to server: Connection timed out

Network path is blocked, runtime can't reach the leader node.

Verify security-group rule on port 5439, VPC peering / Transit Gateway routes, or move the cluster into the same VPC as the runtime.

FATAL: password authentication failed for user

Wrong username or password, or the user's password was rotated.

Re-check credentials; rotate the depot secret.

permission denied for table <schema>.<table>

The Nilus user has USAGE on the schema but not SELECT on the table.

Run GRANT SELECT ON ALL TABLES IN SCHEMA <schema_name> TO nilus_reader; and the ALTER DEFAULT PRIVILEGES line above.

relation "<schema>.<table>" does not exist

The table was dropped, renamed, or lives in a different schema than the manifest.

Check the <schema>.<table> value; Redshift identifiers are case-folded to lower-case unless quoted.

Run extracts the full table every time despite incremental_key

The column is not monotonically increasing in the source, or the pipeline state was reset between runs.

Pick a column that is genuinely monotonic. Sequence-backed id or load_ts columns are typical.

out of memory errors during extraction

Wide rows (many VARCHAR(MAX) / SUPER columns) combined with a large page_size.

Lower page_size; restrict the column list with sql_exclude_columns or a query: source table.

Extraction is slow despite a small row count

Cluster is busy with concurrent BI workloads; ingestion query is queued behind WLM.

Move ingestion to a dedicated WLM queue with a guaranteed slot count, or use Redshift Serverless with separate workgroup.

ValueError: Cannot serialize value, scale of value does not match type decimal(38, 9): 4

The Lakehouse table was created by a query: extract (decimal(38,9)), then a table read tried to write source-scale decimals such as NUMERIC(20,4) — or the reverse.

Keep one extract style per table. Point dest_table at a new table, or drop and reload. See Schema evolution and Custom Query (SQL Sources).

Last updated

Was this helpful?