Closed shawnzhu closed 3 years ago
I can reproduce it locally by using a column with type TIMESTAMP(10)
.
the very problem is this line of code:
where it will throw the :point_up: IllegalArgumentException
like Precision is out of range: 10
if the precision is greater than 9
.
it only supports nanosecond precision (a.k.a., TIMESTAMP(9)
) out of #54.
When source table contains column with type TIMESTAMP(12)
which means picoseconds, this issue will occur.
It should suggest using TIMESTAMP(9)
or with lower precision since nanosecond is the max precision date time function can achieve with JDK 11. see java.time.LocalDateTime
So as the max precision that Trino can support as TIMESTAMP types.
Followed up here to clarify timestamp precision support: https://trinodb.slack.com/archives/CP1MUNEUX/p1618366896274800
PR #71 will fix the code of this connector, the actual fix will depend on https://github.com/trinodb/trino/issues/7590
With #71, it will support precision up to 8
with https://github.com/trinodb/trino/issues/7591 it will support precision up to 9
When querying a Db2 table with column contains type
timestamp(10)
, I got:The stack trace from server log:
Which points to this line of code:
https://github.com/IBM/trino-db2/blob/a4953ceddb58c019b19f4dcb71a3ff36131a0882/src/main/java/io/trino/plugin/db2/DB2Client.java#L98