Snowflake suddenly treating PURGE differently?
I’m facing a strange issue in Snowflake/dbt today.
We have Viewpoint source tables ingested through Fivetran into Snowflake. Several staging models have a column named PURGE. These models have been running successfully every day for a long time.
Today, all models referencing PURGE suddenly started failing with:
SQL compilation error:
000904 (42000): invalid identifier 'PURGE'
The interesting part:
- The
PURGEcolumn still exists in the Snowflake landing/Fivetran table - No source column was removed
- The dbt code hasn't intentionally changed
- Models that don't reference
PURGEare working - This works:
​
SELECT "PURGE"
FROM <table>
LIMIT 1;
- But this fails:
​
SELECT PURGE
FROM <table>
LIMIT 1;
with:
invalid identifier 'PURGE'
So it appears that unquoted PURGE is no longer being resolved as a column identifier, while quoted "PURGE" still works.
Does anyone know if there was a recent Snowflake behavior change / parser change / release that could cause this?
I'm especially interested in whether PURGE has recently started being treated as a keyword in some SQL context, because this broke many existing dbt models simultaneously without any apparent schema change.
Any insight into the exact Snowflake change would be appreciated.