Support INSERT OVERWRITE for MemTable - #24969
Open
osipovartem wants to merge 3 commits into
Open
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #24969 +/- ##
=======================================
Coverage 81.67% 81.67%
=======================================
Files 1126 1126
Lines 414842 414919 +77
Branches 414842 414919 +77
=======================================
+ Hits 338841 338905 +64
- Misses 56070 56079 +9
- Partials 19931 19935 +4 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
osipovartem
force-pushed
the
upstream-memtable-insert-overwrite
branch
from
September 6, 2026 16:38
2d7b03b to
2e11c24
Compare
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?
Rationale for this change
DataFusion parses and plans
INSERT OVERWRITE, butMemTablerejects every insert operation except append. Users therefore cannot replace the contents of an in-memory table with the standard overwrite operation.What changes are included in this PR?
InsertOp::OverwriteinMemTable::insert_intoMemSinkreplace each target partition after the input stream completes successfullyInsertOp::ReplaceoperationWhat is the testing strategy for this PR?
Two unit tests verify that overwrite replaces existing rows and that an empty overwrite clears the table.
Validated with:
cargo test -p datafusion --lib test_insert_overwrite -- --nocapturecargo clippy -p datafusion -p datafusion-datasource -p datafusion-catalog --all-targets --all-features -- -D warningscargo fmt --all -- --checkAre there any user-facing changes?
Yes.
INSERT OVERWRITEnow replaces all existing data in aMemTable. There are no breaking public API changes.