Commit 8bfa077
[fix](fe) Enforce partition guard for Nereids delete
### 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)
- 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>1 parent 18e939b commit 8bfa077
3 files changed
Lines changed: 91 additions & 0 deletions
File tree
- fe/fe-core/src
- main/java/org/apache/doris/nereids/trees/plans/commands
- test/java/org/apache/doris/nereids/trees/plans/commands
- regression-test/suites/delete_p0
Lines changed: 8 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
302 | 302 | | |
303 | 303 | | |
304 | 304 | | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
305 | 313 | | |
306 | 314 | | |
307 | 315 | | |
| |||
Lines changed: 70 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
20 | 25 | | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
21 | 29 | | |
22 | 30 | | |
23 | 31 | | |
| 32 | + | |
24 | 33 | | |
25 | 34 | | |
26 | 35 | | |
27 | 36 | | |
| 37 | + | |
28 | 38 | | |
29 | 39 | | |
30 | 40 | | |
| |||
68 | 78 | | |
69 | 79 | | |
70 | 80 | | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
71 | 132 | | |
72 | 133 | | |
73 | 134 | | |
| |||
77 | 138 | | |
78 | 139 | | |
79 | 140 | | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
80 | 150 | | |
Lines changed: 13 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| 40 | + | |
40 | 41 | | |
41 | 42 | | |
42 | 43 | | |
| |||
70 | 71 | | |
71 | 72 | | |
72 | 73 | | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
73 | 79 | | |
74 | 80 | | |
75 | 81 | | |
| |||
117 | 123 | | |
118 | 124 | | |
119 | 125 | | |
| 126 | + | |
120 | 127 | | |
121 | 128 | | |
122 | 129 | | |
| |||
142 | 149 | | |
143 | 150 | | |
144 | 151 | | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
145 | 157 | | |
146 | 158 | | |
147 | 159 | | |
| |||
187 | 199 | | |
188 | 200 | | |
189 | 201 | | |
| 202 | + | |
190 | 203 | | |
0 commit comments