github-actions[bot] commented on code in PR #65903:
URL: https://github.com/apache/doris/pull/65903#discussion_r3631164161
##########
fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/Cast.java:
##########
@@ -273,10 +281,45 @@ public Expression withConstantArgs(Expression literal) {
@Override
public boolean isMonotonic(Literal lower, Literal upper) {
- // Both upward and downward casting of date types satisfy monotonicity.
- if (child().getDataType() instanceof DateLikeType && targetType
instanceof DateLikeType) {
+ DataType childType = child().getDataType();
+ if (!(childType instanceof DateLikeType && targetType instanceof
DateLikeType)) {
+ return false;
+ }
+
+ if (childType instanceof TimeStampTzType && targetType instanceof
DateTimeV2Type) {
+ return isTimeStampTzToDateTimeV2Monotonic(
+ (TimeStampTzType) childType, (DateTimeV2Type) targetType,
lower, upper);
+ }
+ return true;
+ }
+
+ private boolean isTimeStampTzToDateTimeV2Monotonic(
+ TimeStampTzType sourceType, DateTimeV2Type destinationType,
Literal lower, Literal upper) {
+ ZoneId timeZone;
+ try {
+ timeZone = DateUtils.getTimeZone();
Review Comment:
**[P2] Preserve accepted aliases in RF classification**
`SET time_zone='CST'` is valid and stays stored as `CST`, and BE resolves it
to `Asia/Shanghai`. This new bare `ZoneId.of` lookup rejects that alias, so
`classifyLocalMonotonicity` omits every otherwise eligible
TIMESTAMPTZ-to-DATETIMEV2 RANGE partition and the query loses RF partition
pruning. (Static endpoint pruning already fails closed through its separate
folding parser, so this is RF-specific.) Please preserve Doris's
shared/canonical alias semantics within whatever parity-safe named-zone policy
resolves the existing P1, and cover `CST`; an FE-only alias lookup does not
establish JVM/cctz rule parity.
--
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]