feat: add basic MemTable MERGE INTO support - #24195
Open
wirybeaver wants to merge 1 commit into
Open
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #24195 +/- ##
==========================================
- Coverage 81.05% 81.04% -0.01%
==========================================
Files 1106 1106
Lines 382287 382658 +371
Branches 382287 382658 +371
==========================================
+ Hits 309851 310136 +285
- Misses 54121 54162 +41
- Partials 18315 18360 +45 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Which issue does this PR close?
Follow-up to the MERGE INTO review in #22988. No separate issue.
Rationale for this change
MERGE INTOcould be planned, but the built-in in-memory table provider could not execute it, andEXPLAINonly showedop=[MergeInto]without theONcondition orWHENactions. This made the new SQL surface hard to exercise end-to-end with the default provider.What changes are included in this PR?
ON/WHEN ... THEN ...details in text and JSON logical plan output.MemTableMERGE INTOexecution for matched update/delete, not-matched insert, and not-matched-by-source update/delete.MERGE INTOsyntax, provider caveats, and currently unsupported planner syntax.Are these changes tested?
Yes:
cargo fmt --allcargo test -p datafusion-exprcargo test -p datafusion-catalogcargo test -p datafusion --test core_integration merge_into -- --nocapturecargo test -p datafusion-sql plan_merge_into_canonicalizes_qualifiers_and_preserves_quoted_columns -- --nocapturecargo test --profile=ci --test sqllogictests -- merge_into.slt --nocapture./ci/scripts/doc_prettier_check.sh --write --allow-dirtycargo clippy --all-targets --all-features -- -D warningsNote: the plan mentioned
cargo test -p datafusion --test sql, but this repository does not currently have asqltest target; the relevant MERGE SQL tests live undercore_integration.Are there any user-facing changes?
Yes.
MemTablenow supports basicMERGE INTO, andEXPLAINoutput forMERGE INTOincludes the merge condition and clauses. There are no public API signature changes.