github-actions[bot] commented on code in PR #65219:
URL: https://github.com/apache/doris/pull/65219#discussion_r3549232676
##########
fe/fe-core/src/main/java/org/apache/doris/common/util/PropertyAnalyzer.java:
##########
@@ -409,10 +411,25 @@ 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") 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 (value.length() > 6
+ && (value.charAt(value.length() - 6) == '+'
+ || value.charAt(value.length() - 6) == '-')) {
+ cooldownTimestamp = ZonedDateTime.parse(value,
Review Comment:
This offset-aware branch still rejects cooldown strings that include
fractional seconds. `DynamicPartitionScheduler.convertToUtcTimestamp()`
preserves the partition column scale when it calls
`TimeStampTzType.of(((ScalarType) column.getType()).getScalarScale())`, and
`TimestampTzLiteral.getStringValue()` renders TIMESTAMPTZ values with that
scale before appending `+00:00`. For a `TIMESTAMPTZ(6)` dynamic partition, the
generated hot-partition cooldown is therefore shaped like `2027-01-01
00:00:00.000000+00:00`, but this formatter only accepts `yyyy-MM-dd
HH:mm:ssXXX`. The parse failure is caught below and converted to
`DataProperty.MAX_COOLDOWN_TIME_MS`, so the SSD partition silently loses its
intended cooldown. Please accept optional fractional seconds here, or reuse a
TIMESTAMPTZ/offset parser that preserves the instant, and add a
`TIMESTAMPTZ(6)` cooldown 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]