osipovartem opened a new pull request, #24969:
URL: https://github.com/apache/datafusion/pull/24969

   ## Which issue does this PR close?
   
   - Part of #19617.
   
   ## Rationale for this change
   
   DataFusion parses and plans `INSERT OVERWRITE`, but `MemTable` rejects 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?
   
   - allow `InsertOp::Overwrite` in `MemTable::insert_into`
   - let `MemSink` replace each target partition after the input stream 
completes successfully
   - continue rejecting the distinct `InsertOp::Replace` operation
   
   ## What 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 -- --nocapture`
   - `cargo clippy -p datafusion -p datafusion-datasource -p datafusion-catalog 
--all-targets --all-features -- -D warnings`
   - `cargo fmt --all -- --check`
   
   ## Are there any user-facing changes?
   
   Yes. `INSERT OVERWRITE` now replaces all existing data in a `MemTable`. 
There are no breaking public API changes.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to