trinodb / trino

Official repository of Trino, the distributed SQL query engine for big data, formerly known as PrestoSQL (https://trino.io)
https://trino.io
Apache License 2.0
10.49k stars 3.02k forks source link

Cannot insert varbinary values into partitioned columns in Delta Lake #24155

Open ebyhr opened 4 days ago

ebyhr commented 4 days ago
CREATE TABLE test_varbinary (x int, part varbinary) WITH (partitioned_by = ARRAY['part']);
INSERT INTO test_varbinary VALUES (1, x'12');
Query 20241118_064727_00025_s9tsj failed: Unsupported type for partition: varbinary
io.trino.spi.TrinoException: Unsupported type for partition: varbinary
    at io.trino.plugin.deltalake.util.DeltaLakeWriteUtils.toPartitionValue(DeltaLakeWriteUtils.java:129)
    at io.trino.plugin.deltalake.util.DeltaLakeWriteUtils.createPartitionValues(DeltaLakeWriteUtils.java:72)
    at io.trino.plugin.deltalake.AbstractDeltaLakePageSink.createPartitionValues(AbstractDeltaLakePageSink.java:466)
    at io.trino.plugin.deltalake.AbstractDeltaLakePageSink.getWriterIndexes(AbstractDeltaLakePageSink.java:370)
    at io.trino.plugin.deltalake.AbstractDeltaLakePageSink.writePage(AbstractDeltaLakePageSink.java:280)
    at io.trino.plugin.deltalake.AbstractDeltaLakePageSink.appendPage(AbstractDeltaLakePageSink.java:272)
    at io.trino.plugin.base.classloader.ClassLoaderSafeConnectorPageSink.appendPage(ClassLoaderSafeConnectorPageSink.java:68)
    at io.trino.operator.TableWriterOperator.addInput(TableWriterOperator.java:276)
    at io.trino.operator.Driver.processInternal(Driver.java:408)
    at io.trino.operator.Driver.lambda$process$8(Driver.java:306)
    at io.trino.operator.Driver.tryWithLock(Driver.java:709)
    at io.trino.operator.Driver.process(Driver.java:298)
    at io.trino.operator.Driver.processForDuration(Driver.java:269)
    at io.trino.execution.SqlTaskExecution$DriverSplitRunner.processFor(SqlTaskExecution.java:890)
    at io.trino.execution.executor.dedicated.SplitProcessor.run(SplitProcessor.java:77)
    at io.trino.execution.executor.dedicated.TaskEntry$VersionEmbedderBridge.lambda$run$0(TaskEntry.java:201)
    at io.trino.$gen.Trino_464_195_gdd02ee9____20241118_045105_2.run(Unknown Source)
    at io.trino.execution.executor.dedicated.TaskEntry$VersionEmbedderBridge.run(TaskEntry.java:202)
    at io.trino.execution.executor.scheduler.FairScheduler.runTask(FairScheduler.java:172)
    at io.trino.execution.executor.scheduler.FairScheduler.lambda$submit$0(FairScheduler.java:159)
    at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:572)
    at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:131)
    at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:76)
    at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:82)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
    at java.base/java.lang.Thread.run(Thread.java:1575)