Why Is the model_large Column Truncated in the FIVETRAN_FORMULA_MODEL Table?
Environment: Fivetran's Salesforce connector with Quickstart formula models on an Amazon Redshift destination.
This issue only affects Amazon Redshift destinations. It does not affect Snowflake, BigQuery, or other destinations.
What causes the model_large column to be truncated in the FIVETRAN_FORMULA_MODEL table?
On some Amazon Redshift cluster versions, large string literals written into SUPER columns are truncated at 65,535 bytes, even though AWS documentation states SUPER columns support string literals up to 16 MB. This issue originates in the Redshift cluster, not in Fivetran's sync process. AWS has confirmed it is a patch-version issue in certain Redshift cluster versions.
When this issue impacts the Salesforce Quickstart formula model flow, it results in the following:
- The
model_largecolumn in theFIVETRAN_FORMULA_MODELtable is truncated to ~65 KB. - Quickstart views are built using the truncated, incomplete SQL.
- dbt queries fail with errors such as
invalid SQLorunterminated quoted identifier.
Fivetran writes the full translated formula SQL into the model_large column, which uses the Redshift SUPER data type. On affected Redshift cluster versions, string literals larger than 65,535 bytes fail to insert correctly or are silently truncated.
On some affected clusters, you may also see the following error in Redshift query logs:
ERROR: Invalid input context: Value is too large for SUPER string type: 65535
The same SQL that fails on affected cluster versions works correctly on fully patched clusters.
How to confirm the issue
To verify if your cluster is affected by this issue, you can check using either of these methods:
- Inspect the
model_largecolumn: Check the values in yourFIVETRAN_FORMULA_MODELtable directly. Because Redshift serializesSUPERcolumns with surrounding double quotes, a truncated value contains exactly 64 KB of SQL content (65,535 bytes, excluding the surrounding " characters). If the stored formula SQL appears cut off at that size, your cluster is affected. - Check the failure reason table: Search the
FIVETRAN_FORMULA_FAILURE_REASONtable for rows where failure_reason = 'TRANSLATED_SQL_TOO_LONG'. This indicates Fivetran detected that the formula exceeded the column limit.
How to resolve the issue
Fivetran cannot patch customer-managed Redshift clusters. To resolve this issue, open an AWS Support ticket and request a cluster patch that resolves the SUPER string literal truncation at 65,535 bytes. AWS Support can confirm the correct patch for your cluster version.
Once AWS patches your cluster:
- The full formula SQL is correctly stored in
model_large. - Quickstart views rebuild successfully on the next sync.
- dbt queries work as expected.
To open an AWS Support case, go to the AWS Support Center and reference that string literals in SUPER columns are being truncated at 65,535 bytes.