Databricks: Add support for UPDATE SET * and INSERT * in MERGE statements#2325
Merged
iffyio merged 4 commits intoapache:mainfrom May 2, 2026
Merged
Databricks: Add support for UPDATE SET * and INSERT * in MERGE statements#2325iffyio merged 4 commits intoapache:mainfrom
UPDATE SET * and INSERT * in MERGE statements#2325iffyio merged 4 commits intoapache:mainfrom
Conversation
…atements Add parsing support for the Databricks star shorthand syntax in MERGE statements, allowing `UPDATE SET *` and `INSERT *` to reference all columns from the source. - Add `MergeUpdateKind` enum (`Set(Vec<Assignment>)` | `Star`) to replace the previous `assignments` field on `MergeUpdateExpr`, enforcing valid states at the type level - Add `MergeInsertKind::Star` variant for `INSERT *` shorthand - Add `supports_merge_star_syntax()` dialect method for Databricks and Generic
iffyio
reviewed
Apr 29, 2026
| let update_token = self.get_current_token().clone(); | ||
| self.expect_keyword_is(Keyword::SET)?; | ||
| let assignments = self.parse_comma_separated(Parser::parse_assignment)?; | ||
| let kind = if self.dialect.supports_merge_star_syntax() |
Contributor
There was a problem hiding this comment.
I looks like we should be able to drop the dialect method and let the parser accept the * syntax anytime it shows up?
Contributor
Author
There was a problem hiding this comment.
I looks like we should be able to drop the dialect method and let the parser accept the
*syntax anytime it shows up?
done
| } | ||
| } | ||
|
|
||
| #[test] |
Contributor
There was a problem hiding this comment.
the tests can be merged into a single function? (maybe into the existing MERGE tests we have in common)
Contributor
Author
There was a problem hiding this comment.
the tests can be merged into a single function? (maybe into the existing MERGE tests we have in common)
done. Thanks for your suggestions.
Co-authored-by: Ifeanyi Ubah <ify1992@yahoo.com>
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.
Add parsing support for the Databricks star shorthand syntax in MERGE statements, allowing
UPDATE SET *andINSERT *to reference all columns from the source.Syntax
Changes
MergeUpdateKindenum (Set(Vec<Assignment>)|Star) to replace the previousassignmentsfield onMergeUpdateExpr, enforcing valid states at the type levelMergeInsertKind::Starvariant forINSERT *shorthandsupports_merge_star_syntax()dialect method for Databricks and Generic