github-actions[bot] commented on code in PR #68573:
URL: https://github.com/apache/doris/pull/68573#discussion_r4122965106
##########
fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/literal/TimestampTzLiteral.java:
##########
@@ -102,16 +105,37 @@ public static TimestampTzLiteral
fromTimeZone(TimeStampTzType dateType, String s
if (DateTimeChecker.hasTimeZone(s)) {
return new TimestampTzLiteral(dateType, s);
}
- return fromTimeZone(dateType, new DateTimeV2Literal(s), timeZone);
+ // Keep the seventh fractional digit until rounding to the target
scale.
+ TemporalAccessor parsed = DateLiteral.parseDateTime(s).get();
Review Comment:
[P2] Preserve the parsed zone in this string path.
`DateTimeChecker.hasTimeZone` misses valid inputs such as `2024-01-15 12:00:00
America/Port-au-Prince` (the checker excludes `-` in zone names), while
`DateLiteral.parseDateTime` accepts them and records the zone. The new code
reads only civil fields, then resolves them in the session zone; in a UTC
session, this CAST now yields 12:00 UTC instead of 17:00 UTC. The previous
`DateTimeV2Literal(s)` path honored the parsed zone. Use
`TemporalQueries.zone()` here or normalize before the zone check, and cover
this cast path.
--
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]