Hi skipowder99,
When you set a DEFAULT COLLATION at the catalog or schema level, it is forward looking. It does not retroactively apply to existing tables, columns or views. It leaves you with a split environment the newly created objects default to UTF8_LCASE, while the existing ones are still with UTF8_BINARY.
The expression and data type mismatch errors you are seeing occur because the engine enforces collation rules during query planning. If you join an older UTF8_BINARY column with a newer UTF8_LCASE column or compare an existing table column to a string literal (which now inherits the new schema default), it throws an error.
Views are particularly stubborn here as they bake in the implicit collation of their underlying columns at the exact moment they are created.
You need to systematically update the existing metadata to get your environment running again.
1. Recompiling Views - As views lock in the collation at creation, they won't automatically inherit the new schema default. You must recreate them provided the underlying tables have already been fixed.
2. Updating Base Table Columns - For the base tables, you have two options depending on your compute version. You can alter the column collations in place in serverless warehouse.
ALTER TABLE my_schema.my_table
ALTER COLUMN my_string_column TYPE STRING COLLATE UTF8_LCASE;
If that feature isn't available on the runtime, you can recreate the tables using a CTAS operation. Since your schema default is now UTF8_LCASE, the new table will automatically pick it up.
3. Execution Order - You should audit and execute these changes in a strict dependency order to avoid recursive errors. You can find the lagging columns by querying the information schema. Apply the fixes bottom-up from there.
Update or recreate base tables first.
Recreate the views that query those base tables directly.
Recreate downstream views (views querying views) moving from the leaf nodes up to the root.