ethan-tyler opened a new issue, #19617:
URL: https://github.com/apache/datafusion/issues/19617

   ### Is your feature request related to a problem or challenge?
   
   With #19142 merged, DataFusion has TableProvider hooks for DELETE and 
UPDATE. This epic tracks the remaining DML statements needed for a complete SQL 
surface.
   
   Currently missing:
   
   - **MERGE INTO** - downstream projects have to decompose this themselves
   - **INSERT OVERWRITE** - important for partition replacement workflows
   - **TRUNCATE TABLE** - currently requires DELETE WHERE true
   
   ### Describe the solution you'd like
   
   **MERGE statement:**
   
   - sqlparser-rs already parses MERGE (Statement::Merge)
   - Add LogicalPlan::Merge node
   - Physical planning via decomposition to existing DELETE/UPDATE/INSERT hooks
   - TableProvider::merge_into() for storage-native implementations
   
   **INSERT OVERWRITE:**
   
   - Extend insert_into() or add separate hook
   - Support static and dynamic partition overwrite modes
   
   **TRUNCATE:**
   
   - Add TableProvider::truncate() hook
   - More efficient than full table scan + delete
   
   **ON CONFLICT (nice-to-have):**
   
   - PostgreSQL-style INSERT ... ON CONFLICT DO UPDATE/NOTHING
   - Lower priority- rounds out the DML surface
   
   ### Describe alternatives you've considered
   
   Downstream projects can continue implementing MERGE decomposition 
themselves. Works, but duplicates planning logic across integrations and pushes 
SQL semantics outside the query engine.
   
   ### Additional context
   
   Related issues for context:
   
   - #19142
   - #12406
   - #16959
   
   Happy to take this on if there's interest!


-- 
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