Ducklake truncate operator#825
Draft
jprafael wants to merge 8 commits into
Draft
Conversation
Mytherin
reviewed
Mar 12, 2026
Contributor
Mytherin
left a comment
There was a problem hiding this comment.
Thanks! Looks good - good idea. Can we add some extra tests?
- Verify ROLLBACK works correctly
- Verify transactionality works correctly (i.e. other connections don't yet see the changes)
- Add tests verifying this works correctly with inlined data
- Look at the return value of
TRUNCATEto verify it's returning the correct number of rows, also when a table already has deletes within a file - Verify time travel works
28c03cf to
5e3b0ca
Compare
e699b0e to
c3f8935
Compare
Contributor
Author
Thanks for the test pushback! Indeed there were some issues with the code that warranted a rewrite. The new version adds tests for the cases you mentioned and is more organized in the way that DuckLakeTruncate iterates through the data sources (files, inline, local inline). There is also |
c3f8935 to
d4d987a
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.
Current implementation of
DELETE FROM tableorTRUNCATE tablescans the entire table to be deleted and captures row_ids in memory which for large tables is expensive.This is an optimization for the case where the full table needs to be deleted, in which case we can do it by manipulating metadata alone.
This was LLM generated.