-
Notifications
You must be signed in to change notification settings - Fork 197
feat: support TRIGGER ON UPDATE and SCHEDULE EVERY for MV and ST #1434
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
sd-db
merged 9 commits into
1.12.latest
from
sd-db/feature/mv-st-trigger-schedule-syntax
May 13, 2026
Merged
Changes from 4 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
692d92c
feat: support TRIGGER ON UPDATE and SCHEDULE EVERY for MV and ST
sd-db 4118dcd
test: simplify MV/ST schedule-mode functional tests per review
sd-db a80f2dd
Merge branch '1.12.latest' into sd-db/feature/mv-st-trigger-schedule-…
sd-db c04780f
Merge branch '1.12.latest' into sd-db/feature/mv-st-trigger-schedule-…
sd-db 1fb445f
fix: canonicalize Etc/UTC in CRON refresh equality
sd-db 1a414f4
Merge remote-tracking branch 'origin/1.12.latest' into feature/mv-st-…
sd-db f4946f8
test: move inline ST_*/MV_* schedule fixtures to fixtures.py
sd-db bc503b4
test: drop redundant 2-HOURS EVERY test, superseded by input matrix
sd-db eb2a07b
test: drop redundant MANUAL / rate-limited ON_UPDATE tests
sd-db File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
22 changes: 11 additions & 11 deletions
22
dbt/include/databricks/macros/relations/components/refresh_schedule.sql
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,17 +1,17 @@ | ||
| {% macro get_create_sql_refresh_schedule(cron, time_zone_value) %} | ||
| {%- if cron -%} | ||
| SCHEDULE CRON '{{ cron }}'{%- if time_zone_value %} AT TIME ZONE '{{ time_zone_value }}'{%- endif -%} | ||
| {% macro get_create_sql_refresh_schedule(refresh) %} | ||
| {%- if refresh.cron -%} | ||
| SCHEDULE CRON '{{ refresh.cron }}'{%- if refresh.time_zone_value %} AT TIME ZONE '{{ refresh.time_zone_value }}'{%- endif -%} | ||
| {%- elif refresh.every -%} | ||
| SCHEDULE EVERY {{ refresh.every }} | ||
| {%- elif refresh.on_update -%} | ||
| TRIGGER ON UPDATE{%- if refresh.at_most_every %} AT MOST EVERY INTERVAL {{ refresh.at_most_every }}{%- endif -%} | ||
| {%- endif -%} | ||
| {% endmacro %} | ||
|
|
||
| {% macro get_alter_sql_refresh_schedule(cron, time_zone_value, is_altered) %} | ||
| {%- if cron -%} | ||
| {%- if is_altered -%} | ||
| ALTER SCHEDULE CRON '{{ cron }}'{%- if time_zone_value %} AT TIME ZONE '{{ time_zone_value }}'{%- endif -%} | ||
| {%- else -%} | ||
| ADD SCHEDULE CRON '{{ cron }}'{%- if time_zone_value %} AT TIME ZONE '{{ time_zone_value }}'{%- endif -%} | ||
| {%- endif -%} | ||
| {%- else -%} | ||
| {% macro get_alter_sql_refresh_schedule(refresh) %} | ||
| {%- if not (refresh.cron or refresh.every or refresh.on_update) -%} | ||
| DROP SCHEDULE | ||
| {%- else -%} | ||
| {{- 'ALTER ' if refresh.is_altered else 'ADD ' -}}{{- get_create_sql_refresh_schedule(refresh) -}} | ||
| {%- endif -%} | ||
| {% endmacro %} |
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.