Skip to contentManaged Kafka is live: Apache Kafka on AWS for half the cost of MSK

Destinations

Redshift

Learn how to configure Amazon Redshift as a destination in Artie, including endpoint setup, schema configuration, service account creation, and required database permissions.

Required settings

  • Redshift endpoint
  • Schema name
  • Service account

Creating a service account

SQL
CREATE USER artie_transfer WITH PASSWORD 'password';
GRANT SELECT, INSERT, UPDATE, DELETE, DROP, ALTER ON ALL TABLES IN SCHEMA schema_name TO artie_transfer;
GRANT CREATE, USAGE ON SCHEMA schema_name TO artie_transfer;
-- Lets Artie create missing schemas, including its staging schema.
GRANT CREATE ON DATABASE database_name TO artie_transfer;

Advanced

Type mapping

Artie creates these Redshift types for new columns:

Source dataRedshift type
JSON objectsSUPER, or VARCHAR(MAX) with Store JSON as VARCHAR on
ArraysSUPER
Geometry values, for example PostGIS geometryGEOMETRY, with the source SRID
Geography values, for example PostGIS geographySUPER, holding GeoJSON
UUIDs and intervalsVARCHAR(MAX)
TimestampsTIMESTAMP WITH TIME ZONE or TIMESTAMP WITHOUT TIME ZONE, to the microsecond

Artie also loads into GEOMETRY and GEOGRAPHY columns you create yourself. It writes GEOGRAPHY values with SRID 4326, since Redshift only supports WGS84 for that type.

Redshift caps a GEOMETRY or GEOGRAPHY value at 1,048,447 bytes. A larger value can’t be stored. An insert writes NULL, and an update keeps the geometry the row already has.

JSON data as SUPER

Artie creates JSON columns as SUPER, so you can query them with PartiQL without parsing them first.

Two limits apply to SUPER values:

  • The whole value: Artie writes JSON values up to 16,000,000 bytes. A larger value is replaced with {"key":"__artie_exceeded_value"}.
  • Each string inside the value: Redshift caps strings inside a SUPER value at 65,535 bytes, or 16,000,000 bytes if your cluster has enable_large_strings_opt_in turned on. See SUPER limitations.

A string over that cap makes Redshift reject the load for the whole batch, so none of the batch’s rows reach the table. Turn on Truncate long strings in JSON (in the destination advanced settings) so Redshift trims those strings to the cap and the load goes through.

JSON and string settings

These settings are in the pipeline’s destination Advanced settings, under Data handling. Pipeline setup shows the same settings, two of them under shorter names.

Store JSON as VARCHAR (JSON as VARCHAR in setup): creates new JSON columns as VARCHAR(MAX) instead of SUPER. Columns that are already SUPER stay SUPER. A VARCHAR(MAX) column holds up to 65,535 bytes, so a longer JSON value follows the Truncate exceeded values rule.

Truncate exceeded values (Truncate oversized values in setup): decides what happens to a string longer than its column allows, for example more than 65,535 bytes in a VARCHAR(MAX) column.

  • Off (default): Artie writes __artie_exceeded_value in place of the value.
  • On: Artie trims the value to the column’s length in bytes, cut back to the last whole character.

Truncate long strings in JSON: runs each load with Redshift’s json_parse_truncate_strings turned on. A string inside a SUPER value that’s over Redshift’s cap is trimmed instead of failing the load. Off by default. See SUPER configurations.