snuyanzin commented on PR #22775:
URL: https://github.com/apache/flink/pull/22775#issuecomment-2172858716
Thanks for your feedback
>Could we change sth so that we don't lose data when a precision >3 is used?
Could we throw an exception somewhere explicitly?
This seems a questionable thing how Flink should behave.
I checked it for Postgres where for `TIME` the precision `>6` is not
supported and Postgres continues working with loosing data (it puts warning
in it's output log about that)
On the other side MySQL throws an exception.
I checked Flink SQL for
```sql
SELECT CAST('1111-11-11 11:11:11.123456789123' AS timestamp(12))
```
and it fails as
```
Caused by: java.time.format.DateTimeParseException: Text '1111-11-11
11:11:11.123456789123' could not be parsed, unparsed text found at index 29
at
java.base/java.time.format.DateTimeFormatter.parseResolved0(DateTimeFormatter.java:2049)
at
java.base/java.time.format.DateTimeFormatter.parse(DateTimeFormatter.java:1874)
at
org.apache.flink.table.utils.DateTimeUtils.parseTimestampData(DateTimeUtils.java:413)
at
org.apache.flink.table.data.binary.BinaryStringDataUtil.toTimestamp(BinaryStringDataUtil.java:612)
```
I think we could add similar behavior for `TIME`
--
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]