-
Notifications
You must be signed in to change notification settings - Fork 21
Description
Is there an existing issue for this?
- I have searched the existing issues
Current Behavior
Materialized view DBT model is re-created despite no changes to its Jinja-SQL script.
Expected Behavior
It should at most be refreshed.
Steps To Reproduce
Write a materialized view model with leading whitespace and comments before the first SQL keyword and run it at least twice.
Relevant log output using --debug
flag enabled
OracleMaterializedViewConfigChangeset(refresh_mode=None, refresh_method=None, build_mode=None, query_rewrite=None, query=OracleQueryConfigChange(action=<RelationConfigChangeAction.create: 'create' > ...
Environment
- OS: win 10
- Python: 3.11.9
- dbt: 1.8.3
What Oracle database version are you using dbt with?
19c (thin mode)
Additional Context
The behavior likely stems from the conditional of the if statement on line 114 in relation.py always evaluating to true when the Jinja-SQL script of the materialized view DBT model has leading whitespace and SQL comments in it.
To be clear, I edited the relation.py python script to output the query
attributes of existing_relation
and new_relation
to two files to compare them and discovered that the existing relation's query collected from the Oracle database was stripped of leading whitespace and comments.
I have not checked whether trailing whitespace and trailing comments would also be stripped, but I suspect so.