You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 5df806a
Browse filesBrowse the repository at this point in the historyBrowse files
Feat : added truncate table support (apache#19633)
## Which issue does this PR close?
- Related to apache#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 planning and integration support for TRUNCATE TABLE in
DataFusion, completing another part of the DML surface alongside
existing DELETE and UPDATE support.
Specifically, it includes:
- SQL parsing support for TRUNCATE TABLE
- Logical plan support via a new WriteOp::Truncate DML operation
- Physical planner routing for TRUNCATE statements
- A new TableProvider::truncate() hook for storage-native
implementations
- Protobuf / DML node support for serializing and deserializing TRUNCATE
operations
- SQL logic tests validating logical and physical planning behavior
The implementation follows the same structure and conventions as the
existing DELETE and UPDATE DML support.
Execution semantics are delegated to individual TableProvider
implementations via the new hook.
## Are these changes tested?
Yes. The PR includes:
SQL logic tests that verify:
- Parsing of TRUNCATE TABLE
- Correct logical plan generation
- Correct physical planner routing
- Clear and consistent errors for providers that do not yet support
TRUNCATE
These tests mirror the existing testing strategy used for unsupported
DELETE and UPDATE operations.
## 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.
0 commit comments