BiteTheDDDDt opened a new pull request, #65903:
URL: https://github.com/apache/doris/pull/65903
### What problem does this PR solve?
Issue Number: None
Related PR: None
Problem Summary: A TIMESTAMPTZ range-partitioned scan could lose rows when a
runtime filter or static predicate targeted `CAST(part_col AS DATETIMEV2)` in a
session timezone that crosses a daylight-saving fall-back transition. The
monotonicity check treated all date-like casts as unconditionally monotonic.
Pruning then folded both partition endpoints; at the fall-back boundary the
projected local time moved backward, producing an invalid range and pruning a
partition that contained a matching value.
Make TIMESTAMPTZ-to-DATETIMEV2 monotonicity range-aware. Fixed-offset zones
remain monotonic. For dynamic zones, partitions with finite bounds remain
eligible only when `(lower, upper]` contains no fall-back transition; unbounded
ranges conservatively skip the monotonic shortcut. Add unit coverage and a
regression covering runtime-filter and static partition pruning.
### Release note
Fix incorrect partition pruning for TIMESTAMPTZ-to-DATETIMEV2 casts across
daylight-saving fall-back transitions.
### Check List (For Author)
- Test: Regression test and Unit Test
- `./run-regression-test.sh --run -d datatype_p0/timestamptz -s
test_timestamptz_rf_partition_prune_dst`
- `./run-fe-ut.sh --run
org.apache.doris.nereids.trees.expressions.CastMonotonicityTest,org.apache.doris.nereids.trees.expressions.CastTest,org.apache.doris.nereids.trees.expressions.functions.scalar.ConvertTzTest`
- `./build.sh --fe`
- Behavior changed: Yes. Unsafe partition pruning is disabled for affected
ranges.
- Does this need documentation: No
--
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]