github-actions[bot] commented on code in PR #68573:
URL: https://github.com/apache/doris/pull/68573#discussion_r4121473265
##########
fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/literal/TimestampTzLiteral.java:
##########
@@ -110,8 +110,12 @@ public static TimestampTzLiteral
fromTimeZone(TimeStampTzType dateType, String s
*/
public static TimestampTzLiteral fromTimeZone(TimeStampTzType dateType,
DateTimeV2Literal literal,
String timeZone) {
+ // A rounding carry can leave a DST overlap. Resolve the rounded civil
time as BE does.
+ DateTimeV2Literal roundedLocal = new
DateTimeV2Literal(DateTimeV2Type.of(dateType.getScale()),
Review Comment:
[P2] Avoid rounding zone-less strings twice at a DST overlap.
`StringLikeLiteral.uncheckedCastTo` first parses an unzoned string as
`DATETIMEV2(6)`, rounding its seventh fractional digit. For `CAST('2024-11-03
01:59:59.9994999' AS TIMESTAMPTZ(3))` with session zone `America/New_York`,
that intermediate becomes `.999500`; this new target-scale rounding carries the
local time to 02:00 and folds to 07:00:00.000 UTC. BE parses directly at scale
3 and gets 05:59:59.999 UTC because the raw fourth digit is 4. Preserve the raw
fraction until rounding once at the target scale for string casts, and cover
this overlap case with a string-cast test.
--
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]