After prolonged execution of Snowflake queries, automatic query cancellation may occur.
While running a pipeline, client sessions can detach from long-running queries for various reasons, such as network issues, timeouts, or service restarts. This detachment can lead to the automatic cancellation of long-running queries by Snowflake.
Problem:
The data quality pipeline or a job fails with a UI status of "Canceled".
Error message:
SQL execution cancelled
Workaround:
To prevent this issue, in Snowflake, set the parameter
ABORT_DETACHED_QUERY to FALSE for the user
running the pipeline. For instance, if the user is DJOHN, use this
command to set the parameter to false.
alter user DJOHN set ABORT_DETACHED_QUERY=FALSE
By default, this parameter is set to FALSE in Snowflake, and it is
typically enabled or disabled by the admin at the account level. In cases where it's
set to TRUE, you must override it and set it to
FALSE to avoid the cancellation of long-running queries.