Nachiket-Roy opened a new pull request, #19633: URL: https://github.com/apache/datafusion/pull/19633
## Which issue does this PR close? - Related to #19617 ## Rationale for this change DataFusion recently added TableProvider hooks for row-level DML operations such as DELETE and UPDATE, but TRUNCATE TABLE was still unsupported. ## What changes are included in this PR? This PR adds end-to-end support for TRUNCATE TABLE, including: - SQL parsing and logical plan support for TRUNCATE TABLE - A new WriteOp::Truncate DML operation - Physical planner routing for TRUNCATE operations - A new TableProvider::truncate() hook for storage-native implementations - A reference implementation of TRUNCATE for MemTable - Protobuf / DML node support for serializing and deserializing TRUNCATE operations - SQL logic tests covering both planning (truncate.slt) and execution behavior (dml_truncate.slt) The implementation follows the same structure and conventions as existing DELETE and UPDATE support. ## Are these changes tested? Yes. The PR includes: SQL logic tests verifying logical and physical planning of TRUNCATE TABLE Execution tests validating MemTable behavior, including: - Removing all rows - Preserving table schema - Repeated TRUNCATE operations - Inserting data after TRUNCATE All tests pass locally. ## Are there any user-facing changes? Yes. Users can now execute TRUNCATE TABLE statements in DataFusion for tables whose TableProvider supports the new truncate() hook. Tables that do not support TRUNCATE will return a clear NotImplemented error. -- 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]
