apache / paimon

Apache Paimon is a lake format that enables building a Realtime Lakehouse Architecture with Flink and Spark for both streaming and batch operations.
https://paimon.apache.org/
Apache License 2.0
2.44k stars 959 forks source link

[Bug] Error in querying table with timestamp(6) type column under trino 422 #2095

Closed macdoor closed 1 year ago

macdoor commented 1 year ago

Search before asking

Paimon version

paimon-trino-422-0.6-20231007.082435-32.jar

Compute Engine

Linux hb3-dev-gem-bnpmp-000 5.10.0-60.91.0.115.oe2203.x86_64 https://github.com/apache/incubator-paimon/pull/1 SMP Thu Apr 20 07:08:44 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

openjdk version "1.8.0_352" OpenJDK Runtime Environment Bisheng (build 1.8.0_352-b08) OpenJDK 64-Bit Server VM Bisheng (build 25.352-b08, mixed mode)

Flink 1.17.1

Trino 422 - 428

Minimal reproduce step

create a table

drop table if exists svc1_paimon_prod.dxx.with_timestamp;
CREATE TABLE svc1_paimon_prod.dxx.with_timestamp (  
id string, 
ts timestamp
);

insert 1 row data

insert into svc1_paimon_prod.dxx.without_timestamp values ('1', localtimestamp);

What doesn't meet your expectations?

query in sql-client.sh

SELECT t.* FROM dxx.without_timestamp t

throw exception

[2023-10-07 20:58:37] [65536] Query failed (#20231007_125837_00123_nfjhb): Unhandled type for long: timestamp(6)
[2023-10-07 20:58:37] io.trino.spi.TrinoException: Unhandled type for long: timestamp(6)

Anything else?

Full exception

2023-10-07T20:58:38.068+0800    ERROR   SplitRunner-127-238 io.trino.execution.executor.timesharing.TimeSharingTaskExecutor Error processing Split 20231007_125837_00123_nfjhb.1.0.0-0 {} (start = 4.659907365758682E9, wall = 43 ms, cpu = 0 ms, wait = 0 ms, calls = 1): GENERIC_INTERNAL_ERROR: Unhandled type for long: timestamp(6)
io.trino.spi.TrinoException: Unhandled type for long: timestamp(6)
    at org.apache.paimon.trino.TrinoPageSourceBase.appendTo(TrinoPageSourceBase.java:188)
    at org.apache.paimon.trino.TrinoPageSourceBase.nextPage(TrinoPageSourceBase.java:139)
    at org.apache.paimon.trino.TrinoPageSourceBase.lambda$getNextPage$0(TrinoPageSourceBase.java:120)
    at org.apache.paimon.trino.ClassLoaderUtils.runWithContextClassLoader(ClassLoaderUtils.java:30)
    at org.apache.paimon.trino.TrinoPageSourceBase.getNextPage(TrinoPageSourceBase.java:117)
    at io.trino.operator.TableScanOperator.getOutput(TableScanOperator.java:299)
    at io.trino.operator.Driver.processInternal(Driver.java:395)
    at io.trino.operator.Driver.lambda$process$8(Driver.java:298)
    at io.trino.operator.Driver.tryWithLock(Driver.java:694)
    at io.trino.operator.Driver.process(Driver.java:290)
    at io.trino.operator.Driver.processForDuration(Driver.java:261)
    at io.trino.execution.SqlTaskExecution$DriverSplitRunner.processFor(SqlTaskExecution.java:887)
    at io.trino.execution.executor.timesharing.PrioritizedSplitRunner.process(PrioritizedSplitRunner.java:187)
    at io.trino.execution.executor.timesharing.TimeSharingTaskExecutor$TaskRunner.run(TimeSharingTaskExecutor.java:565)
    at io.trino.$gen.Trino_428____20231007_124942_2.run(Unknown Source)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
    at java.base/java.lang.Thread.run(Thread.java:833)

2023-10-07T20:58:38.069+0800    ERROR   remote-task-callback-6  io.trino.execution.scheduler.PipelinedStageExecution    Pipelined stage execution for stage 20231007_125837_00123_nfjhb.1 failed
io.trino.spi.TrinoException: Unhandled type for long: timestamp(6)
    at org.apache.paimon.trino.TrinoPageSourceBase.appendTo(TrinoPageSourceBase.java:188)
    at org.apache.paimon.trino.TrinoPageSourceBase.nextPage(TrinoPageSourceBase.java:139)
    at org.apache.paimon.trino.TrinoPageSourceBase.lambda$getNextPage$0(TrinoPageSourceBase.java:120)
    at org.apache.paimon.trino.ClassLoaderUtils.runWithContextClassLoader(ClassLoaderUtils.java:30)
    at org.apache.paimon.trino.TrinoPageSourceBase.getNextPage(TrinoPageSourceBase.java:117)
    at io.trino.operator.TableScanOperator.getOutput(TableScanOperator.java:299)
    at io.trino.operator.Driver.processInternal(Driver.java:395)
    at io.trino.operator.Driver.lambda$process$8(Driver.java:298)
    at io.trino.operator.Driver.tryWithLock(Driver.java:694)
    at io.trino.operator.Driver.process(Driver.java:290)
    at io.trino.operator.Driver.processForDuration(Driver.java:261)
    at io.trino.execution.SqlTaskExecution$DriverSplitRunner.processFor(SqlTaskExecution.java:887)
    at io.trino.execution.executor.timesharing.PrioritizedSplitRunner.process(PrioritizedSplitRunner.java:187)
    at io.trino.execution.executor.timesharing.TimeSharingTaskExecutor$TaskRunner.run(TimeSharingTaskExecutor.java:565)
    at io.trino.$gen.Trino_428____20231007_124942_2.run(Unknown Source)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
    at java.base/java.lang.Thread.run(Thread.java:833)

2023-10-07T20:58:38.069+0800    ERROR   stage-scheduler io.trino.execution.scheduler.PipelinedQueryScheduler    Failure in distributed stage for query 20231007_125837_00123_nfjhb
io.trino.spi.TrinoException: Unhandled type for long: timestamp(6)
    at org.apache.paimon.trino.TrinoPageSourceBase.appendTo(TrinoPageSourceBase.java:188)
    at org.apache.paimon.trino.TrinoPageSourceBase.nextPage(TrinoPageSourceBase.java:139)
    at org.apache.paimon.trino.TrinoPageSourceBase.lambda$getNextPage$0(TrinoPageSourceBase.java:120)
    at org.apache.paimon.trino.ClassLoaderUtils.runWithContextClassLoader(ClassLoaderUtils.java:30)
    at org.apache.paimon.trino.TrinoPageSourceBase.getNextPage(TrinoPageSourceBase.java:117)
    at io.trino.operator.TableScanOperator.getOutput(TableScanOperator.java:299)
    at io.trino.operator.Driver.processInternal(Driver.java:395)
    at io.trino.operator.Driver.lambda$process$8(Driver.java:298)
    at io.trino.operator.Driver.tryWithLock(Driver.java:694)
    at io.trino.operator.Driver.process(Driver.java:290)
    at io.trino.operator.Driver.processForDuration(Driver.java:261)
    at io.trino.execution.SqlTaskExecution$DriverSplitRunner.processFor(SqlTaskExecution.java:887)
    at io.trino.execution.executor.timesharing.PrioritizedSplitRunner.process(PrioritizedSplitRunner.java:187)
    at io.trino.execution.executor.timesharing.TimeSharingTaskExecutor$TaskRunner.run(TimeSharingTaskExecutor.java:565)
    at io.trino.$gen.Trino_428____20231007_124942_2.run(Unknown Source)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
    at java.base/java.lang.Thread.run(Thread.java:833)

2023-10-07T20:58:38.070+0800    ERROR   stage-scheduler io.trino.execution.StageStateMachine    Stage 20231007_125837_00123_nfjhb.1 failed
io.trino.spi.TrinoException: Unhandled type for long: timestamp(6)
    at org.apache.paimon.trino.TrinoPageSourceBase.appendTo(TrinoPageSourceBase.java:188)
    at org.apache.paimon.trino.TrinoPageSourceBase.nextPage(TrinoPageSourceBase.java:139)
    at org.apache.paimon.trino.TrinoPageSourceBase.lambda$getNextPage$0(TrinoPageSourceBase.java:120)
    at org.apache.paimon.trino.ClassLoaderUtils.runWithContextClassLoader(ClassLoaderUtils.java:30)
    at org.apache.paimon.trino.TrinoPageSourceBase.getNextPage(TrinoPageSourceBase.java:117)
    at io.trino.operator.TableScanOperator.getOutput(TableScanOperator.java:299)
    at io.trino.operator.Driver.processInternal(Driver.java:395)
    at io.trino.operator.Driver.lambda$process$8(Driver.java:298)
    at io.trino.operator.Driver.tryWithLock(Driver.java:694)
    at io.trino.operator.Driver.process(Driver.java:290)
    at io.trino.operator.Driver.processForDuration(Driver.java:261)
    at io.trino.execution.SqlTaskExecution$DriverSplitRunner.processFor(SqlTaskExecution.java:887)
    at io.trino.execution.executor.timesharing.PrioritizedSplitRunner.process(PrioritizedSplitRunner.java:187)
    at io.trino.execution.executor.timesharing.TimeSharingTaskExecutor$TaskRunner.run(TimeSharingTaskExecutor.java:565)
    at io.trino.$gen.Trino_428____20231007_124942_2.run(Unknown Source)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
    at java.base/java.lang.Thread.run(Thread.java:833)

Are you willing to submit a PR?

macdoor commented 1 year ago

solved with paimon-trino-422-0.6-20231009.000450-35.jar