Learn how Stitch will load data from your integrations into Stitch’s Amazon Redshift destination.
In this guide, we’ll cover data loading scenarios involving:
-
Object identifiers in the destination, including naming limitations and transformations
-
Various data types, including how data is typed and structured in the destination
-
Schema changes in the source or structural changes in the destination
Applicable destination types
This guide is applicable to the all variations of the Amazon Redshift destination, including:
Primary Key scenarios
Scenarios involving Primary Key columns.
IF |
A table without a Primary Key is replicated. |
THEN |
|
IF |
A table with a single Primary Key is replicated. |
THEN |
|
IF |
A table with multiple Primary Keys is replicated. |
THEN |
|
IF |
The table’s Primary Key(s) is/are changed. |
THEN |
If using Key-based Incremental or Log-based Incremental Replication, data will be added to the table in an Append-Only fashion. If using Full Table Replication, the table will be overwritten in its entirety during each job. |
IF |
You remove the Primary Key column(s) for a table in Amazon Redshift. |
THEN |
Data will continue to be loaded into the table in an Append-Only fashion. |
Replication Key scenarios
Scenarios involving Replication Keys and how data is loaded as a result.
IF |
A table using Key-based Incremental Replication is replicated where the Replication Key column contains |
THEN |
|
Object naming scenarios
Scenarios involving object identifiers in the destination, including naming limitations and transformations.
IF |
A table name contains more characters than allowed by Amazon Redshift. |
THEN |
Amazon Redshift will reject all data for the table. |
AND |
The following error will display in the Notifications tab in Stitch:
Rejected records will be logged in the |
FIX IT |
If possible, change the table name in the source to be less than Amazon Redshift’s character limit of 127 characters.
Use the |
IF |
A column name contains more characters than allowed by Amazon Redshift. |
THEN |
Amazon Redshift will reject columns with names that exceed the column character limit. Other columns in the table will persist to Amazon Redshift. |
AND |
The following error will display in the Notifications tab in Stitch:
Rejected records will be logged in the |
FIX IT |
If possible, change the column name in the source to be less than Amazon Redshift’s character limit of 115 characters.
Use the |
IF |
Two columns are replicated that canonicalize to the same name. |
THEN |
For example: A table containing both Amazon Redshift will reject the records and create a log for the rejected records in the |
AND |
The following error will display in the Notifications tab in Stitch:
Rejected records will be logged in the |
FIX IT |
If possible, re-name one of the columns in the source so that both column names will be unique when replicated to Amazon Redshift.
Use the |
IF |
A column is replicated that has a mixed-case name. |
||||||
THEN |
Amazon Redshift will convert letters to lowercase. For example:
|
IF |
A column is replicated that has a name with spaces. |
||||||
THEN |
Amazon Redshift will maintain spaces. For example:
|
IF |
A column is replicated with a name that contains unsupported special characters. |
|||||||||
THEN |
Amazon Redshift will remove all special characters with the exception of underscores and dollar signs. For example:
|
IF |
A column is replicated with a name that begins with a non-letter. |
THEN |
This scenario is unremarkable to Amazon Redshift. |
Table scenarios
Scenarios involving table creation and modification in the destination.
IF |
A table contains entirely |
THEN |
No table is created in Amazon Redshift. At least one column must have a non- |
IF |
A table arrives with more columns than Amazon Redshift allows. |
THEN |
Amazon Redshift will reject all data for the table. |
AND |
The following error will display in the Notifications tab in Stitch:
Rejected records will be logged in the |
FIX IT |
If possible, deselect some columns to allow Stitch to load data into Amazon Redshift for the table. Amazon Redshift has a limit of 1,600 columns per table.
Use the |
Data typing scenarios
Scenarios involving various data types, including how data is typed and structured in the destination.
IF |
Stitch detects multiple data types for a single column. |
THEN |
To accommodate data of varying types, Stitch will create multiple columns to ensure data is loaded with the correct type. In the destination, this will look like the column has been “split”. For example: Stitch first detected that
|
IF |
Data is replicated to Amazon Redshift that is nested, containing many top-level properties and potentially nested sub-properties. |
THEN |
To ensure nested data can be loaded, Stitch will flatten objects and arrays into columns and subtables, respectively. For more info and examples, refer to the Handling nested data structures guide. |
IF |
A |
THEN |
Amazon Redshift will type the column as For example: During the initial replication job, data in a |
IF |
|
THEN |
Amazon Redshift will widen the column to accommodate the width of the largest record up to the limit of For example: during the initial replication job, a During a subsequent job, Stitch identifies data for this column that exceeds the current size maximum of To accommodate the data, the column will become |
IF |
VARCHAR data is loaded that exceeds Amazon Redshift’s supported limit. |
THEN |
Amazon Redshift will truncate the data to the maximum width of |
IF |
A column containing date data with timezone info is replicated to Amazon Redshift. |
THEN |
Amazon Redshift will store the value as For more info on this data type, refer to Amazon’s Datetime Type documentation. |
IF |
A column contains timestamp data that is outside Amazon Redshift’s supported range. |
THEN |
Amazon Redshift will reject the records that fall outside the supported range. |
AND |
The following error will display in the Notifications tab in Stitch:
Rejected records will be logged in the |
FIX IT |
To resolve the error, offending values in the source must be changed to be within Amazon Redshift’s timestamp range.
Use the |
IF |
A column contains integer data that is outside Amazon Redshift’s supported range. |
THEN |
Amazon Redshift will reject the records that fall outside the supported range. |
AND |
The following error will display in the Notifications tab in Stitch:
Rejected records will be logged in the |
FIX IT |
To resolve the error, offending values in the source must be changed to be within Amazon Redshift’s limit for integers.
Use the |
IF |
A column contains decimal data that is outside Amazon Redshift’s supported range. |
THEN |
Amazon Redshift will reject the records that fall outside the supported range. |
AND |
The following error will display in the Notifications tab in Stitch:
Rejected records will be logged in the |
FIX IT |
To resolve the error, offending values in the source must be changed to be within Amazon Redshift’s limit for decimal data.
Use the |
Schema change scenarios
Scenarios involving schema changes in the source or structural changes in the destination.
IF |
A new column is added in table already set to replicate. |
THEN |
If the column has at least one non- Note: If the table using either Key- or Log-based Incremental Replication, backfilled values for the column will only be replicated if:
|
IF |
A new column is added by you to a Stitch-generated table in Amazon Redshift. |
THEN |
Columns may be added to tables created by Stitch as long as they are nullable, meaning columns don’t have |
IF |
A column is deleted at the source. |
THEN |
How a deleted column is reflected in Amazon Redshift depends on the Replication Method used by the table:
|
IF |
You remove a column from a Stitch-replicated table in your destination. |
THEN |
The result of deleting a column from a Stitch-generated table depends on the type of column being removed:
|
Destination changes
Scenarios involving modifications made to the destination, such as the application of workload/performance management features or user privilege changes.
IF |
Indices are applied to Stitch-generated columns in the destination. |
THEN |
Stitch will respect the index application. |
IF |
SORT and/or DISTRIBUTION Keys are applied to Stitch-generated columns in the destination. |
THEN |
Stitch will respect the application when loading data. |
IF |
You switch to a different destination of the same type. |
THEN |
This means the destination type is still Amazon Redshift, Stitch may just be connected a different database in Amazon Redshift.
|
Related | Troubleshooting |
Questions? Feedback?
Did this article help? If you have questions or feedback, feel free to submit a pull request with your suggestions, open an issue on GitHub, or reach out to us.