Commit a871acd
authored
partially resolves #1335
### Description
1. added `optimize()` call to the snapshot materialization, matching
existing behavior in table and incremental materializations. when a
snapshot is configured with `liquid_clustered_by`, `zorder`, or
`auto_liquid_cluster`, the `OPTIMIZE` query will now execute
automatically after each snapshot run.
2. the change is a single-line addition to `snapshot.sql`, placed after
`persist_constraints` and before `post-hooks` (again, consistent with
the pattern in `table.sql` and `incremental.sql`).
**note**: the original issue also mentioned default clustering columns
and `ALTER TABLE` support for config changes. these are intentionally
excluded from this PR to keep scope minimal and can be addressed in
follow-up PRs if needed. i believe they need a design decision that
should be discussed by/with maintainers first due to having a larger
scope.
### Checklist
- [x] I have run this code in development and it appears to resolve the
stated issue (**unit tests pass :** this change mirrors the identical
optimize() call pattern already used in `table.sql` and
`incremental.sql`.)
- [x] This PR includes tests, or tests are not required/relevant for
this PR
- [x] I have updated the `CHANGELOG.md` and added information about my
change to the "dbt-databricks next" section.
---------
Signed-off-by: aarushisingh04 <aarushi07.singh@gmail.com>
1 parent b647999 commit a871acd
3 files changed
Lines changed: 10 additions & 0 deletions
File tree
- dbt/include/databricks/macros/materializations
- tests/functional/adapter/simple_snapshot
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
124 | 124 | | |
125 | 125 | | |
126 | 126 | | |
| 127 | + | |
| 128 | + | |
127 | 129 | | |
128 | 130 | | |
129 | 131 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
35 | 42 | | |
36 | 43 | | |
37 | 44 | | |
| |||
0 commit comments