Error: Cannot Deserialize Value From String TIMESTAMP_LTZ
Issue
Historical syncs fail with the following error:
Caused by: com.fasterxml.jackson.databind.exc.InvalidFormatException: Cannot deserialize value of type com.fivetran.warehouses.snowflake.connector.SnowflakeWriterDelegate$SnowflakeType from String "TIMESTAMP_LTZ": not one of the values accepted for Enum class: [BINARY, FIXED, VARIANT, BOOLEAN, TIMESTAMP_NTZ, TEXT, DATE, TIMESTAMP_TZ, TIME, REAL]
Environment
- Connector: SQL Server
- Destination: Snowflake
Resolution
To resolve this issue, go to your SQL Server connection page and identify the affected destination tables and columns in the warning message, then choose one of the following options:
Option 1: Restore the expected data types
Restore the affected destination columns to the Fivetran-managed data types that correspond to the source SQL Server schema. For more information, see SQL Server type transformation and mapping and Snowflake type transformation and mapping.
Option 2: Recreate and re-sync the affected tables
Drop the affected destination tables, or, where appropriate, the affected columns.
Re-sync the affected tables.
i. In Fivetran, go to your SQL Server connection page.
ii. Select the Schema tab.
iii. Find the affected tables and click Re-sync.
iv. In the confirmation pop-up, click Re-sync table.
Fivetran performs a historical sync and recreates the affected tables or columns with the expected schema and supported data types.
Do not manually modify the schema of destination tables managed by Fivetran. These changes can cause schema mismatches and sync failures.
Cause
This issue occurs when you change a replicated SQL Server DATETIME2 column to the unsupported Snowflake TIMESTAMP_LTZ data type. We expect SQL Server DATETIME2 columns to map to a supported Snowflake timestamp type. When we read a destination column defined as TIMESTAMP_LTZ, we cannot process the destination schema metadata, and the sync fails.