Repository navigation
refactor: drop no-op create_indexes and commit from snapshot materialization - #1691
Merged
Merged
Conversation
…ization The snapshot materialization called create_indexes() on first run and adapter.commit() after the inside-transaction post-hooks. Both do nothing on Databricks: create_indexes dispatches to dbt's default, which emits no SQL because neither Spark nor Databricks implements get_create_index_sql, and adapter.commit() resolves to the adapter's no-op commit_if_has_connection(). Hook ordering is unchanged.
sd-db
marked this pull request as ready for review
September 30, 2026 04:19
jprakash-db
approved these changes
Sep 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The snapshot materialization made two calls that do nothing on Databricks:
create_indexes()on the first run dispatches to dbt's default, which emits no SQL because neither Spark nor Databricks implementsget_create_index_sql.adapter.commit()after the inside-transaction post-hooks resolves tocommit_if_has_connection(), which the adapter overrides as a no-op.Both came in with the dbt 1.9 snapshot port (#904), copied from dbt-core's default materialization. This removes them and updates the snapshot flow doc. Hook ordering is unchanged.
The same pair is removed from seeds in #1690. The two PRs are independent.
The only user-visible effect is for projects that override
create_indexes(orget_create_index_sql) and expect snapshots to call it. Those overrides are no longer called for snapshots, so the CHANGELOG entry is labeled breaking for custom macro overrides only.Tests
No test changes. Ran the snapshot-related functional suites on
mainand then against this change on the SQL warehouse profile:simple_snapshot/*, the basic snapshot check-cols and timestamp tests, snapshot column tags, tags, grants, persist constraints, tblproperties, and dbt clone. Both runs gave 53 passed and 8 skipped, with identical per-test outcomes. The skips depend on the environment or profile.Checklist
CHANGELOG.mdand added information about my change to the "dbt-databricks next" section.dbt-databricks-pr-readyproject skill for this PR and addressed its merge-readiness feedback