You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 20, 2023. It is now read-only.
When query table table contains columns with data type TIMESTAMP(3), TIMESTAMP(6) and TIMESTAMP(9), when running select statement, it will report exception like:
May 5 11:43:20 trino-coordinator-cf87bd8bb-pz77v trino-coordinator ERROR remote-task-callback-32 io.trino.execution.StageStateMachine Stage 20210505_154318_00007_zhr9s.1 failed
io.trino.spi.TrinoException: [jcc][t4][1092][13956][4.25.13] Invalid data conversion: Wrong result column type for requested conversion. ERRORCODE=-4461, SQLSTATE=42815
at io.trino.plugin.jdbc.JdbcRecordCursor.handleSqlException(JdbcRecordCursor.java:299)
at io.trino.plugin.jdbc.JdbcRecordCursor.getObject(JdbcRecordCursor.java:238)
at io.trino.spi.connector.RecordPageSource.getNextPage(RecordPageSource.java:116)
at io.trino.operator.TableScanOperator.getOutput(TableScanOperator.java:301)
at io.trino.operator.Driver.processInternal(Driver.java:387)
at io.trino.operator.Driver.lambda$processFor$9(Driver.java:291)
at io.trino.operator.Driver.tryWithLock(Driver.java:683)
at io.trino.operator.Driver.processFor(Driver.java:284)
at io.trino.execution.SqlTaskExecution$DriverSplitRunner.processFor(SqlTaskExecution.java:1075)
at io.trino.execution.executor.PrioritizedSplitRunner.process(PrioritizedSplitRunner.java:163)
at io.trino.execution.executor.TaskExecutor$TaskRunner.run(TaskExecutor.java:484)
at io.trino.$gen.Trino_356____20210505_151828_2.run(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: com.ibm.db2.jcc.am.SqlSyntaxErrorException: [jcc][t4][1092][13956][4.25.13] Invalid data conversion: Wrong result column type for requested conversion. ERRORCODE=-4461, SQLSTATE=42815
at com.ibm.db2.jcc.am.b6.a(b6.java:810)
at com.ibm.db2.jcc.am.b6.a(b6.java:66)
at com.ibm.db2.jcc.am.b6.a(b6.java:133)
at com.ibm.db2.jcc.am.ResultSet.getObject(ResultSet.java:1961)
at io.trino.plugin.jdbc.StandardColumnMappings.lambda$longTimestampReadFunction$24(StandardColumnMappings.java:508)
at io.trino.plugin.jdbc.ObjectReadFunction$1.readObject(ObjectReadFunction.java:46)
at io.trino.plugin.jdbc.JdbcRecordCursor.getObject(JdbcRecordCursor.java:235)
... 13 more
It will support resultSet.getTimestamp(int columnIndex), resultSet.getObject(int columnIndex), but NOT resultSet.getObject(int columnIndex, Class<T> type).
Given trino 356 and trino-db 356:
When query table table contains columns with data type
TIMESTAMP(3)
,TIMESTAMP(6)
andTIMESTAMP(9)
, when running select statement, it will report exception like:It will work if the value of the row is
NULL
.So I suspect it's a driver specific implementation that it can not use
ResultSet.getObject()
on data type like Timestamp. see https://github.com/trinodb/trino/blob/3219bc9c810c897dcfeb97ea1b0c5dc21ae5dd79/plugin/trino-base-jdbc/src/main/java/io/trino/plugin/jdbc/StandardColumnMappings.java#L496-L509The text was updated successfully, but these errors were encountered: