davidradl commented on code in PR #27793:
URL: https://github.com/apache/flink/pull/27793#discussion_r2964958277
##########
docs/data/sql_functions.yml:
##########
@@ -722,7 +722,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: "Converts date time string string1 with format string2 (by
default: 'yyyy-MM-dd HH:mm:ss') to a timestamp, without time zone."
+ 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:
what happens when the number of S's is not 3, 6 or 9.
--
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]