Error: Statement Reached Its Statement or Warehouse Timeout and Was Canceled
Issue
Despite updating the STATEMENT_TIMEOUT_IN_SECONDS
parameter at the account level, connector syncs fail with the following error:
net.snowflake.client.jdbc.SnowflakeSQLException: Statement reached its statement or warehouse timeout of 'xxxx' second(s) and was canceled.
Environment
Destination: Snowflake
Resolution
To resolve this issue, set a sufficient value for the STATEMENT_TIMEOUT_IN_SECONDS
parameter at the warehouse level rather than the account level. We recommend a value of 43200
seconds.
To check the current STATEMENT_TIMEOUT_IN_SECONDS
value for your warehouse, run the following query:
show parameters like '%STATEMENT_TIMEOUT_IN_SECONDS%' for warehouse <FIVETRAN_WAREHOUSE_NAME>;
To update the STATEMENT_TIMEOUT_IN_SECONDS
value for your warehouse, run the following query:
alter warehouse <FIVETRAN_WAREHOUSE_NAME> set STATEMENT_TIMEOUT_IN_SECONDS=43200;
Cause
When the STATEMENT_TIMEOUT_IN_SECONDS
parameter's value is lower at the warehouse level than at the account level, Snowflake prioritizes the warehouse-level value. As a result, this issue may occur when the warehouse-level value is lower than the recommended 43200
seconds, regardless of the account-level value.