Repository navigation
[spark] Delete partitions by value in metadata-only DELETE - #11296
Open
LuciferYang wants to merge 1 commit into
Open
LuciferYang wants to merge 1 commit into
LuciferYang wants to merge 1 commit into
Conversation
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.
Purpose
Fixes #11291. A
DELETEwhose condition covers only partition columns runsTruncatePaimonTableWithFilterExec, which turned the matched partitions back into string specs and let the commit parse them again. A blank value is written as the default partition name and parses back as NULL, a non-UTF-8 BINARY value comes back with other bytes, and a TIMESTAMP's legacy name shifts by a non-UTC JVM's zone offset, so the statement kept rows it matched and could remove rows it did not.The exec now commits the matched
BinaryRows through an empty static overwrite. LikeINSERT OVERWRITE, that commit runs maintenance such as snapshot expiration afterwards. #11226 uses the same commit forDROP PARTITIONandTRUNCATE PARTITION; whichever merges second can share the helper.Tests
PaimonOptimizationTestBase: metadata-only deletes of a blank STRING partition next to a NULL one, of blank and non-UTF-8 BINARY partitions reached through another partition column, and of a TIMESTAMP partition in an Asia/Shanghai JVM whose legacy name parses back as another existing partition. Each checks the truncate exec was planned and only the matched rows are gone. They fail on master.