morrySnow commented on code in PR #63853:
URL: https://github.com/apache/doris/pull/63853#discussion_r3333721966


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/ConvertTz.java:
##########
@@ -107,4 +144,55 @@ public int getMonotonicFunctionChildIndex() {
     public Expression withConstantArgs(Expression literal) {
         return new ConvertTz(literal, child(1), child(2));
     }
+
+    private ZoneId parseZoneId(StringLikeLiteral timeZone) {
+        try {
+            String standardizedTimeZone = 
TimeUtils.checkTimeZoneValidAndStandardize(timeZone.getStringValue());
+            return ZoneId.of(standardizedTimeZone, TimeUtils.timeZoneAliasMap);
+        } catch (DdlException | DateTimeException e) {
+            return null;
+        }
+    }
+
+    private LocalDateTime toLocalDateTime(Literal literal) {
+        return literal instanceof DateLiteral ? ((DateLiteral) 
literal).toJavaDateType() : null;
+    }
+
+    private boolean hasTransitionInLocalRange(ZoneId zoneId, LocalDateTime 
lower, LocalDateTime upper) {
+        if (zoneId.getRules().isFixedOffset() || !lower.isBefore(upper)) {

Review Comment:
   This still lets singleton ranges skip the source-zone transition check. That 
is risky for list partitions or single-value ranges whose value is inside a 
skipped local time. For example `2021-03-28 02:15:00` in `Europe/Paris` is a 
DST gap: Java `LocalDateTime.atZone()` maps it to `2021-03-28T01:15:00Z`, while 
BE uses cctz and `cctz::convert()` maps skipped civil times to the transition 
instant, `2021-03-28T01:00:00Z`. So partition pruning can fold `convert_tz(dt, 
'Europe/Paris', 'UTC')` to `01:15:00` for a singleton partition, but execution 
returns `01:00:00`, causing a predicate on `01:00:00` to prune the matching 
partition. We should either align FE constant folding with BE cctz semantics or 
make this check reject ranges whose endpoint is inside a source-zone 
skipped/repeated interval, including `lower == upper`.



-- 
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]

Reply via email to