github-actions[bot] commented on code in PR #65219:
URL: https://github.com/apache/doris/pull/65219#discussion_r3628082448


##########
fe/fe-core/src/main/java/org/apache/doris/common/util/PropertyAnalyzer.java:
##########
@@ -409,10 +436,24 @@ public static DataProperty 
analyzeDataProperty(Map<String, String> properties, f
                 }
             } else if (key.equalsIgnoreCase(PROPERTIES_STORAGE_COOLDOWN_TIME)) 
{
                 try {
-                    DateLiteral dateLiteral = 
DateLiteralUtils.createDateLiteral(value,
-                            ScalarType.getDefaultDateType(Type.DATETIME));
-                    cooldownTimestamp = 
dateLiteral.unixTimestamp(TimeUtils.getTimeZone());
-                } catch (AnalysisException e) {
+                    // A value with an explicit timezone offset (e.g.
+                    // "2027-01-01 00:00:00+00:00" or, for TIMESTAMPTZ(6),
+                    // "2027-01-01 00:00:00.000000+00:00") represents an
+                    // unambiguous UTC instant. Parse it directly as a
+                    // ZonedDateTime and convert to epoch millis, bypassing
+                    // the DATETIME-based DateLiteralUtils.createDateLiteral()
+                    // path which uses Instant.now() for the initial offset
+                    // computation and produces incorrect results across DST
+                    // boundaries.
+                    if (TZ_OFFSET_PATTERN.matcher(value).find()) {

Review Comment:
   [P2] Keep the other supported explicit-zone forms instant-aware
   
   The numeric-offset branch is fixed, but this check does not recognize `Z`, 
`UTC`, or `GMT`, even though `DateLiteralUtils.createDateLiteral()` explicitly 
accepts those suffixes. They still take the legacy path, which computes the 
zone shift using `Instant.now()`. With an `America/Chicago` session in July, 
`storage_cooldown_time='2027-01-01 00:00:00Z'` is shifted using UTC-05 to 
`2026-12-31 19:00`, then `unixTimestamp()` interprets that winter wall time at 
UTC-06 and stores `2027-01-01T01:00Z`. Please route every accepted 
explicit-zone spelling through target-instant-aware parsing and add a 
winter-target regression.



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