Error: Invalid Clustering Keys or Table Is Not Clustered
Issue
The following error appears in Snowflake:
Invalid clustering keys or table <table_name> is not clustered
Environment
Destination: Snowflake
Resolution
If your connection is syncing data successfully, you don't need to take any action. However, if you want to avoid this error, you have two options:
- Filter out queries that call the
SYSTEM$CLUSTERING_INFORMATION
function. - Add clustering keys to large or frequently queried tables. For more information, see Snowflake's Clustering Keys & Clustered Tables documentation.
NOTE: It's not possible to disable Fivetran's performance checks. However, these diagnostic queries don't affect connection or sync performance.
Cause
We recommend adding cluster keys to Snowflake tables to optimize performance, but we don't enforce it. For more information, see our Improve Snowflake query performance documentation.
We call the SYSTEM$CLUSTERING_INFORMATION
function once a day to identify cluster keys. This issue occurs when a table doesn't contain cluster keys, causing the query to fail. However, it doesn't indicate an issue with your connection or recent syncs.