shuke987 opened a new pull request, #64523:
URL: https://github.com/apache/doris/pull/64523
## Problem
`one_col_range_partition` fails on branch-4.1 P0 at the multi-branch CASE
WHEN assertion (~line 256). The CASE WHEN simplifies to `dt >= '2021-05-01'`,
but the table's data only spans 2020-01-01 ~ 2021-02-20 (10000 hours), so that
range contains **no data**. The optimizer now correctly prunes the all-empty
partitions to `0:VEMPTYSET`, so the stale `contains("partitions=417/1826")` no
longer matches.
**This is not a correctness bug** — the result is correct (0 rows, nothing
matches). Verified on a branch-4.1 cluster:
- a plain `WHERE dt >= '2021-05-01'` also prunes to `VEMPTYSET` (data-driven
empty-partition pruning);
- inserting a row `dt = '2021-06-15'` immediately flips the plan to
`partitions=1/1826` and the row is returned — so VEMPTYSET never drops real
data.
## Fix
Change the CASE WHEN's second threshold to `'2021-1-15'` (inside the data
range) so it prunes to a real, non-empty partition set, and update the expected
count to `partitions=37/1826`. This keeps the assertion verifying that a
multi-branch CASE WHEN is correctly pushed into partition pruning.
Scope check: this is the **only** stale assertion in the suite — the sibling
CASE WHEN near line 261 still yields `417/1826` and is left unchanged.
## Verification
On a branch-4.1 cluster the rewritten CASE WHEN deterministically prunes to
`partitions=37/1826` (matching `dt >= '2021-01-15'`).
🤖 Generated with [Claude Code](https://claude.com/claude-code)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]