snuyanzin commented on code in PR #27793:
URL: https://github.com/apache/flink/pull/27793#discussion_r2965128659
##########
docs/data/sql_functions_zh.yml:
##########
@@ -848,7 +848,21 @@ temporal:
TO_TIMESTAMP_LTZ('2023-01-01 00:00:00', 'yyyy-MM-dd HH:mm:ss',
'Asia/Shanghai') parses in Shanghai time zone.
- sql: TO_TIMESTAMP(string1[, string2])
table: toTimestamp(STRING1[, STRING2])
- description: 将格式为 string2(默认为:'yyyy-MM-dd HH:mm:ss')的字符串 string1 转换为
timestamp,不带时区。
+ description: |
+ Converts a datetime string to a TIMESTAMP without time zone.
+
+ - string1: the datetime string to parse
+ - string2: the format pattern (default 'yyyy-MM-dd HH:mm:ss'). The
pattern follows Java's DateTimeFormatter syntax, where 'S' represents
fractional seconds (e.g., 'SSS' for milliseconds, 'SSSSSS' for microseconds,
'SSSSSSSSS' for nanoseconds).
+
+ The output precision depends on the variant used:
+ - 1-arg variant: always returns TIMESTAMP(3).
+ - 2-arg variant: precision is inferred from the number of trailing 'S'
characters in the format pattern, with a minimum of 3. E.g., format 'yyyy-MM-dd
HH:mm:ss.SS' returns TIMESTAMP(3), format 'yyyy-MM-dd HH:mm:ss.SSSSSS' returns
TIMESTAMP(6).
Review Comment:
isn't release notes telling it a bit different?
>TO_TIMESTAMP_LTZ() function now supports up to precision 9 for both numeric
and string conversions. While we kept backwards compatibility for numeric
precision 0-3 which always returns TIMESTAMP_LTZ(3), precisions p=4-9 now
return TIMESTAMP_LTZ(p). Function calls taking string formats such as ".SSSS"
now return precision 4 instead of silently loosing sub second information.
--
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]