[fix](dml) Enforce partition guard for delete - #67252
Open
Yukang-Lian wants to merge 1 commit into
Open
Conversation
### What problem does this PR solve? Issue Number: None Related PR: apache#62944 Problem Summary: Nereids predicate DELETE bypassed delete_without_partition for non-Unique range and list tables after partition pruning moved into the planner. A predicate that did not restrict the target partitions could therefore delete across every partition while the safety switch was false, even though unpartitioned tables must remain allowed. Use the physical scan effective partition-pruning signal to reject only non-Unique partitioned deletes that neither specify nor restrict partitions, while preserving Unique and DELETE USING behavior. ### Release note Nereids DELETE now honors delete_without_partition for non-Unique range and list tables when no effective partition target is specified. ### Check List (For Author) - Test: Unit Test and regression test case - ./run-fe-ut.sh --run org.apache.doris.nereids.trees.plans.commands.DeleteFromCommandTest - ./run-fe-ut.sh --run org.apache.doris.nereids.rules.rewrite.PartitionPrunerTest - Added delete_p0/test_basic_delete_job coverage; not run locally because this worktree has no FE/BE cluster output - Behavior changed: Yes. Unsafe full-partition predicate deletes now require delete_without_partition=true on non-Unique range/list tables; unpartitioned and Unique table behavior is unchanged. - Does this need documentation: No. The change restores the documented safety-switch behavior. Co-authored-by: Siyang Tang <tangsiyang@selectdb.com>
Yukang-Lian
requested review from
924060929,
englefly,
morrySnow and
starocean999
as code owners
August 28, 2026 04:04
Contributor
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
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.
What problem does this PR solve?
Issue Number: None
Related PR: #62944
Problem Summary: Nereids predicate DELETE bypassed delete_without_partition for non-Unique range and list tables after partition pruning moved into the planner. A predicate that did not restrict the target partitions could therefore delete across every partition while the safety switch was false, even though unpartitioned tables must remain allowed. Use the physical scan effective partition-pruning signal to reject only non-Unique partitioned deletes that neither specify nor restrict partitions, while preserving Unique and DELETE USING behavior.
Release note
Nereids DELETE now honors delete_without_partition for non-Unique range and list tables when no effective partition target is specified.
Check List (For Author)
Co-authored-by: Siyang Tang tangsiyang@selectdb.com