Redshift
Set up the Redshift destination connector.
Sync modes, namespaces and the columns Pipeloom adds are explained once in Connector concepts; workspace variables and custom components in Orchestration.
Setting up the Redshift destination connector involves setting up Redshift entities (cluster, database, schema, user) in the AWS console, configuring an S3 bucket for staging, and configuring the Redshift destination connector using Pipeloom.
This page describes the step-by-step process of setting up the Redshift destination connector.
Prerequisites
- An AWS account with access to Amazon Redshift
- A Redshift cluster (provisioned or serverless)
- An S3 bucket for staging data
- AWS IAM credentials with read and write permissions to the S3 bucket
NOTE: The Redshift destination uses S3 staging with COPY as the loading method. This is the recommended approach described by Redshift best practices. Data is uploaded to S3 as multiple files along with a manifest file, then loaded into Redshift via the COPY command.
Setup guide
Step 1: Set up Pipeloom-specific entities in Redshift
To set up the Redshift destination connector, you first need to create Pipeloom-specific Redshift entities (a database, schema, and user) with the appropriate permissions to write data into Redshift and manage staging operations.
You can use the following script in the Redshift Query Editor to create the entities:
- Log into your AWS account and navigate to the Redshift service.
- Open the Query Editor and connect to your cluster.
- Edit the following script to change the password to a more secure password and to change the names of other resources as needed.
-- create a Database for Pipeloom data (if it does not already exist)
CREATE
DATABASE airbyte_database;- Switch your connection to
airbyte_databasein the Query Editor. Redshift does not support switching databases within a session, so you must selectairbyte_databasefrom the database dropdown before running the remaining statements.
TIP: You can verify you are connected to the correct database by running:
SELECT CURRENT_DATABASE();- Run the following script to create the schema, user, and grants:
-- create a schema for Pipeloom data (if it does not already exist)
CREATE SCHEMA IF NOT EXISTS airbyte_schema;
-- create Pipeloom user
CREATE
USER airbyte_user PASSWORD 'your_secure_password_here';
-- grant permissions on the database
GRANT CREATE
ON DATABASE airbyte_database TO airbyte_user;
-- grant permissions on the target schema
GRANT USAGE, CREATE
ON SCHEMA airbyte_schema TO airbyte_user;- Verify the script ran successfully in the Query Editor.
NOTE: Our integration can automatically create schemas in your Redshift database. That path requires CREATE
privileges on the database (GRANT CREATE ON DATABASE). If you prefer to pre-create schemas manually, grant only
USAGE and CREATE on those schemas to the Pipeloom user — the connector skips CREATE SCHEMA when the configured
schema already exists, so database-level CREATE is not required in that case.
Step 2: Set up S3 staging
Pipeloom stages data in S3 before loading it into Redshift via the COPY command. You need to configure an S3 bucket and IAM credentials for this purpose.
- Create an S3 bucket if you don't already have one for staging.
- Place the S3 bucket in the same AWS region as your Redshift cluster to minimize networking costs and improve performance.
- Create an IAM user (or use an existing one) with read and write permissions to the staging bucket.
- Generate an access key for the IAM user.
See the S3 Staging fields table for the full list of required and optional S3 configuration parameters.
NOTE: S3 staging does not use the SSH Tunnel option for copying data. SSH Tunnel supports the SQL connection only. S3 is secured through public HTTPS access only. Subsequent queries on the destination tables are executed using the provided SSH Tunnel configuration.
Optional: SSH Bastion Host
This connector supports the use of a Bastion host as a gateway to a private Redshift cluster via SSH Tunneling. Enter the bastion host, port, and credentials in the destination configuration.
Step 3: Set up Redshift as a destination in Pipeloom
Navigate to Pipeloom to set up Redshift as a destination:
- Log into your Pipeloom account.
- In the left navigation bar, click Destinations. In the top-right corner, click + new destination.
- On the destination setup page, select Redshift from the Destination type dropdown and enter a name for this connector.
- Fill in the required fields using the configuration reference below.
- Click Set up destination.
Connection fields
| Field | Description |
|---|---|
| Host | The endpoint of your Redshift cluster or serverless workgroup. Provisioned clusters end with .redshift.amazonaws.com; serverless workgroups end with .redshift-serverless.amazonaws.com. Example: my-cluster.abc123xyz.us-east-1.redshift.amazonaws.com |
| Port | Port of the database. Default: 5439 |
| Username | The username you created in Step 1 to allow Pipeloom to access the database. Example: airbyte_user |
| Password | The password associated with the username. |
| Database | The name of the database you want to sync data into. This database must already exist within your Redshift cluster. Example: airbyte_database |
| Default Schema | The default schema tables are written to if the source does not specify a namespace. Default: public |
S3 Staging fields
| Field | Description |
|---|---|
| S3 Bucket Name | The name of the staging S3 bucket you created in Step 2. Example: airbyte-staging-bucket |
| S3 Bucket Region | The region of the S3 staging bucket. Place in the same region as your Redshift cluster to reduce costs. Example: us-east-1 |
| S3 Access Key ID | The AWS Access Key ID for an IAM user with read and write permissions to the staging bucket. |
| S3 Secret Access Key | The corresponding AWS Secret Access Key for the Access Key ID. |
| S3 Bucket Path (Optional) | The directory under the S3 bucket where staging data will be written. If not provided, defaults to the root directory. Example: data_sync/redshift |
| S3 Filename Pattern (Optional) | The pattern for S3 staging file names. Supported placeholders: {date}, {date:yyyy_MM}, {timestamp}, {timestamp:millis}, {timestamp:micros}, {part_number}, {sync_id}, {format_extension}. Do not use empty spaces or unsupported placeholders. |
| Purge Staging Data (Optional) | Whether to delete the staging files from S3 after completing the sync. Default: true. Set to false to retain files for debugging or auditing. |
Advanced fields
| Field | Description |
|---|---|
| JDBC URL Params (Optional) | Additional properties to pass to the JDBC URL string when connecting to the database, formatted as key=value pairs separated by &. Example: key1=value1&key2=value2 |
| SSH Tunnel Method (Optional) | Whether to initiate an SSH tunnel before connecting to the database, and if so, which kind of authentication to use. |
| Drop CASCADE (Optional) | Whether to use CASCADE when dropping tables and columns. Warning: This deletes data in all dependent objects (views, etc.), including during schema evolution. Default: false. |
Output schema
Pipeloom writes each stream directly into a final table in Redshift with typed columns.
Final Table schema
The final table contains these fields, in addition to the columns declared in your stream schema:
_airbyte_raw_id: A UUID assigned by Pipeloom to each event that is processed. Column type:VARCHAR(36)._airbyte_extracted_at: A timestamp representing when the event was pulled from the data source. Column type:TIMESTAMP WITH TIME ZONE._airbyte_meta: A JSON object containing metadata about the record, such as changes applied during syncing. Column type:SUPER._airbyte_generation_id: An identifier for the generation of the sync that produced this record. Column type:BIGINT.
See Pipeloom metadata fields for more information about these fields.
NOTE: As of version 4.0.0, the Redshift destination writes data directly to final tables
with direct load. Raw tables (
_airbyte_raw_*) are no longer created. If you are upgrading from an older version, see
the migration guide for details.
Schema naming
- Redshift lowercases all schema, table, and column names and replaces special characters with underscores, following the rules defined in Redshift Names & Identifiers.
- Identifiers are limited to 127 characters. Names that exceed this limit are truncated to 118 characters with an underscore and an 8-character hash suffix to avoid collisions.
Data type map
| Pipeloom type | Redshift type |
|---|---|
| STRING | VARCHAR(65535) |
| STRING (BASE64) | VARCHAR(65535) |
| STRING (BIG_NUMBER) | VARCHAR(65535) |
| STRING (BIG_INTEGER) | VARCHAR(65535) |
| NUMBER | DECIMAL(38,9) |
| INTEGER | BIGINT |
| BOOLEAN | BOOLEAN |
| STRING (TIMESTAMP_WITH_TIMEZONE) | TIMESTAMPTZ |
| STRING (TIMESTAMP_WITHOUT_TIMEZONE) | TIMESTAMP |
| STRING (TIME_WITH_TIMEZONE) | TIMETZ |
| STRING (TIME_WITHOUT_TIMEZONE) | TIME |
| DATE | DATE |
| OBJECT | SUPER |
| ARRAY | SUPER |
| UNKNOWN | VARCHAR(65535) |
Precision and size limits
Redshift enforces size limits on certain data types. When a value exceeds a limit, Pipeloom nulls the value and records
the change in the _airbyte_meta column.
- VARCHAR: Maximum 65,535 bytes.
- SUPER: Maximum 16 MB per record. Individual string scalars nested within a SUPER value are limited to
65,535 bytes. If any nested string exceeds this limit, Pipeloom nulls the entire SUPER value and records the
change in
_airbyte_meta. See the AWS documentation on SUPER type and SUPER limitations. - BIGINT: Stores values in the range -2^63 to 2^63-1. If an integer value falls outside this range, Pipeloom nulls
the value and records the change in
_airbyte_meta. - NUMERIC(38, 9): Redshift supports a maximum precision of 38 and scale of 9. If the source value has a scale
greater than 9, Redshift silently rounds it — this is not recorded in
_airbyte_meta. If the precision exceeds 38, Pipeloom nulls the value and records the change in_airbyte_meta.
Schema evolution
This connector supports automatic schema evolution. When the source schema changes, the connector automatically adds new
columns to destination tables. The connector requires CREATE and ALTER TABLE privileges on destination schemas and
tables to support this feature.
Supported sync modes
The Redshift destination connector supports the following sync modes:
| Sync Mode | Supported? |
|---|---|
| Full Refresh - Overwrite | Yes |
| Full Refresh - Append | Yes |
| Full Refresh - Overwrite + Deduped | Yes |
| Incremental Sync - Append | Yes |
| Incremental Sync - Append + Deduped | Yes |
Encryption
All Redshift connections are encrypted using SSL.
Troubleshooting
'Cannot connect to Redshift cluster'
If your Redshift cluster is in a private VPC, you may need to:
- Allow connections from Pipeloom to your Redshift cluster (if they exist in separate VPCs).
- Configure an SSH Bastion Host (see Step 2) to tunnel through to the private cluster.
- For Pipeloom, ensure the Pipeloom IP addresses are allowed in your Redshift cluster's security group and network policy.
'S3 access denied' during staging
Ensure your IAM credentials have read and write permissions to the staging S3 bucket. Verify that:
- The Access Key ID and Secret Access Key are correct.
- The IAM user has a policy allowing
s3:PutObject,s3:GetObject,s3:DeleteObject, ands3:ListBucketon the staging bucket. - There is no S3 bucket policy blocking access.
Namespace support
This destination supports namespaces. The namespace maps to a Redshift schema.
Limitations
NULL primary keys in dedup syncs
When using Incremental Sync - Append + Deduped or Full Refresh - Overwrite + Deduped, records where any primary key column contains a NULL value are not written to the final table. This is by design for performance reasons.