Skip to navigation

Supports:

  • ✅ Models
  • ✅ Model sync destination
  • ✅ Bulk sync source
  • ✅ Bulk sync destination

Connection

Configuration

NameTypeDescriptionRequired
auth_modestringAuthentication method

How to authenticate with AWS. Defaults to Access Key and Secret. Accepted values: access_key_and_secret ↓, iam_role ↓
required
databasestringDatabaserequired
hostnamestringHostnamerequired
passwordstringPasswordrequired
portintegerPortrequired
s3_bucket_namestringS3 bucket name (destinations only)

Name of bucket used for staging data load files
optional
s3_bucket_regionstringS3 bucket region (destinations only)

Region of bucket. Note: must match region of redshift server
optional
sshbooleanConnect over SSH tunnel ↓optional
use_bulk_sync_staging_schemabooleanUse custom bulk sync staging schema ↓optional
usernamestringUsernamerequired

auth_mode

When auth_mode is access_key_and_secret:

NameTypeDescriptionRequired
aws_access_key_idstringAWS access key ID (destinations only)

Access Key ID with read/write access to a bucket. More info: https://docs.polytomic.com/docs/redshift
optional
aws_secret_access_keystringAWS secret access key (destinations only)optional
Read-only propertyTypeDescription
aws_userstringUser ARN
{
"name": "Redshift connection",
"type": "redshift",
"configuration": {
"auth_mode": "access_key_and_secret",
"aws_access_key_id": "AKIAIOSFODNN7EXAMPLE",
"aws_secret_access_key": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY",
"database": "mydb",
"hostname": "mycluster.us-west-2.redshift.amazonaws.com",
"password": "password",
"port": 5439,
"s3_bucket_name": "my-bucket",
"s3_bucket_region": "us-west-2",
"ssh": false,
"use_bulk_sync_staging_schema": false,
"username": "redshift_user"
}
}

When auth_mode is iam_role:

NameTypeDescriptionRequired
iam_role_arnstringIAM role ARNrequired
Read-only propertyTypeDescription
external_idstringExternal ID for the IAM role
{
"name": "Redshift connection",
"type": "redshift",
"configuration": {
"auth_mode": "iam_role",
"database": "mydb",
"hostname": "mycluster.us-west-2.redshift.amazonaws.com",
"iam_role_arn": "",
"password": "password",
"port": 5439,
"s3_bucket_name": "my-bucket",
"s3_bucket_region": "us-west-2",
"ssh": false,
"use_bulk_sync_staging_schema": false,
"username": "redshift_user"
}
}

ssh

When ssh is true:

NameTypeDescriptionRequired
ssh_hoststringSSH hostrequired
ssh_portintegerSSH portrequired
ssh_private_keystringPrivate keyrequired
ssh_userstringSSH userrequired
{
"name": "Redshift connection",
"type": "redshift",
"configuration": {
"auth_mode": "access_key_and_secret",
"aws_access_key_id": "AKIAIOSFODNN7EXAMPLE",
"aws_secret_access_key": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY",
"database": "mydb",
"hostname": "mycluster.us-west-2.redshift.amazonaws.com",
"password": "password",
"port": 5439,
"s3_bucket_name": "my-bucket",
"s3_bucket_region": "us-west-2",
"ssh": true,
"ssh_host": "bastion.example.com",
"ssh_port": 22,
"ssh_private_key": "",
"ssh_user": "root",
"use_bulk_sync_staging_schema": false,
"username": "redshift_user"
}
}

use_bulk_sync_staging_schema

When use_bulk_sync_staging_schema is true:

NameTypeDescriptionRequired
bulk_sync_staging_schemastringStaging schema namerequired
{
"name": "Redshift connection",
"type": "redshift",
"configuration": {
"auth_mode": "access_key_and_secret",
"aws_access_key_id": "AKIAIOSFODNN7EXAMPLE",
"aws_secret_access_key": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY",
"bulk_sync_staging_schema": "",
"database": "mydb",
"hostname": "mycluster.us-west-2.redshift.amazonaws.com",
"password": "password",
"port": 5439,
"s3_bucket_name": "my-bucket",
"s3_bucket_region": "us-west-2",
"ssh": false,
"use_bulk_sync_staging_schema": true,
"username": "redshift_user"
}
}

Model Sync

Source

Configuration

NameTypeDescriptionRequired
querystringoptional
schemastringSchemaoptional
tablestringTableoptional
viewstringViewoptional

Example

{
...
"configuration": {
"query": "SELECT * FROM sampledata.users",
"schema": "sampledata",
"table": "users",
"view": "active_users"
}
}

Target

Redshift connections may be used as the destination in a model sync.

All targets

Configuration
NameTypeDescriptionRequired
created_columnstring’Created at’ timestamp columnoptional
preserve_table_on_resyncbooleanPreserve destination table when resyncingoptional
updated_columnstring’Updated at’ timestamp columnoptional
write_record_timestampsbooleanWrite row timestamp metadataoptional
Example
{
...
"target": {
"configuration": {
"created_column": "",
"preserve_table_on_resync": false,
"updated_column": "",
"write_record_timestamps": false
}
}
}

Target creation

Redshift connections may be used to create a new target for a model sync. The following parameters are required to create a new target:

NAMEDESCRIPTIONENUM
nameTable namefalse

Bulk Sync

Source

Redshift connections may be used as a bulk sync source. No additional configuration options are required.

Destination

Configuration

NameTypeDescriptionRequired
advancedobjectoptional
mirror_schemasbooleanMirror schemasoptional
schemastringOutput schemaoptional

Example

{
...
"destination_configuration": {
"advanced": {
"empty_strings_null": true,
"hard_deletes": false,
"initial_execution": "rebuild",
"table_prefix": "",
"truncate_existing": false
},
"mirror_schemas": false,
"schema": "schema"
}
}

Type handling

Destination types

POLYTOMIC TYPEREDSHIFT TYPE
array<>SUPER
bigintBIGINT
booleanBOOL
dateDATE
datetimeTIMESTAMP
decimal(precision, scale)NUMERIC(precision,scale)
doubleFLOAT8
intINTEGER
jsonSUPER
jsonarraySUPER
numberNUMERIC(38,18)
object{}SUPER
singleFLOAT4
smallintSMALLINT
stringVARCHAR(MAX)
timeVARCHAR(255)

Source types

REDSHIFT TYPEPOLYTOMIC TYPE
4000json
BIGINTbigint
BOOLboolean
BOOLEANboolean
BPCHARstring
CHARstring
CHARACTERstring
CHARACTER VARYINGstring
DATEdate
DECIMALnumber
DECIMAL(precision, scale)decimal(precision, scale)
DOUBLE PRECISIONdouble
FLOATdouble
FLOAT4single
FLOAT8double
INTint
INT2smallint
INT4int
INT8bigint
INTEGERint
NCHARstring
NUMERICnumber
NUMERIC(precision, scale)decimal(precision, scale)
NVARCHARstring
REALsingle
SMALLINTsmallint
STRINGstring
TEXTstring
TIMEtime
TIME WITH TIME ZONEtime
TIME WITHOUT TIME ZONEtime
TIMESTAMPdatetime
TIMESTAMP WITH TIME ZONEdatetime_tz
TIMESTAMP WITHOUT TIME ZONEdatetime
TIMESTAMPTZdatetime_tz
TIMETZtime
VARCHARstring