Skip to content

Commit e51a823

Browse files
Add optimize() call to snapshot materialization
Signed-off-by: aarushisingh04 <aarushi07.singh@gmail.com>
1 parent b647999 commit e51a823

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
gated behind the `use_concurrent_microbatch` behavior flag (default: `false`).
77
Opt in via `flags: {use_concurrent_microbatch: true}` in `dbt_project.yml`
88
([#914](https://github.com/databricks/dbt-databricks/issues/914))
9+
- Run `optimize` on snapshots when `liquid_clustered_by`, `zorder`, or `auto_liquid_cluster` config is set, matching existing behavior for tables and incremental models ([#1335](https://github.com/databricks/dbt-databricks/issues/1335))
910

1011
### Fixes
1112

dbt/include/databricks/macros/materializations/snapshot.sql

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,8 @@
124124

125125
{% do persist_constraints(target_relation, model) %}
126126

127+
{% do optimize(target_relation) %}
128+
127129
{{ run_hooks(post_hooks, inside_transaction=False) }}
128130

129131
{{ return({'relations': [target_relation]}) }}

0 commit comments

Comments
 (0)