Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve error message when creating tables or adding columns using row type without field names in Delta #17549

Open
ebyhr opened this issue May 18, 2023 · 2 comments
Labels
delta-lake Delta Lake connector good first issue Good for newcomers

Comments

@ebyhr
Copy link
Member

ebyhr commented May 18, 2023

trino:tpch> create table test as select row(123) as c1;
java.lang.NullPointerException: null value in entry: name=null
	at com.google.common.collect.CollectPreconditions.checkEntryNotNull(CollectPreconditions.java:33)
	at com.google.common.collect.ImmutableMapEntry.<init>(ImmutableMapEntry.java:54)
	at com.google.common.collect.ImmutableMap.entryOf(ImmutableMap.java:339)
	at com.google.common.collect.ImmutableMap$Builder.put(ImmutableMap.java:449)
	at io.trino.plugin.deltalake.transactionlog.DeltaLakeSchemaSupport.serializeStructField(DeltaLakeSchemaSupport.java:188)
	at io.trino.plugin.deltalake.transactionlog.DeltaLakeSchemaSupport.lambda$serializeStructType$5(DeltaLakeSchemaSupport.java:251)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
	at java.base/java.util.AbstractList$RandomAccessSpliterator.forEachRemaining(AbstractList.java:720)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
	at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:921)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:682)
	at io.trino.plugin.deltalake.transactionlog.DeltaLakeSchemaSupport.serializeStructType(DeltaLakeSchemaSupport.java:251)
	at io.trino.plugin.deltalake.transactionlog.DeltaLakeSchemaSupport.serializeColumnType(DeltaLakeSchemaSupport.java:212)
	at io.trino.plugin.deltalake.transactionlog.DeltaLakeSchemaSupport.serializeStructField(DeltaLakeSchemaSupport.java:189)
	at io.trino.plugin.deltalake.transactionlog.DeltaLakeSchemaSupport.lambda$serializeStructType$2(DeltaLakeSchemaSupport.java:171)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
	at java.base/java.util.Collections$2.tryAdvance(Collections.java:4853)
	at java.base/java.util.Collections$2.forEachRemaining(Collections.java:4861)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
	at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:921)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:682)
	at io.trino.plugin.deltalake.transactionlog.DeltaLakeSchemaSupport.serializeStructType(DeltaLakeSchemaSupport.java:178)
	at io.trino.plugin.deltalake.transactionlog.DeltaLakeSchemaSupport.serializeSchemaAsJson(DeltaLakeSchemaSupport.java:151)
	at io.trino.plugin.deltalake.DeltaLakePageSinkProvider.createPageSink(DeltaLakePageSinkProvider.java:103)
	at io.trino.plugin.base.classloader.ClassLoaderSafeConnectorPageSinkProvider.createPageSink(ClassLoaderSafeConnectorPageSinkProvider.java:49)
	at io.trino.split.PageSinkManager.createPageSink(PageSinkManager.java:49)
	at io.trino.operator.TableWriterOperator$TableWriterOperatorFactory.createPageSink(TableWriterOperator.java:123)
	at io.trino.operator.TableWriterOperator$TableWriterOperatorFactory.createOperator(TableWriterOperator.java:117)
	at io.trino.operator.DriverFactory.createDriver(DriverFactory.java:106)
	at io.trino.execution.SqlTaskExecution$DriverSplitRunnerFactory.createDriver(SqlTaskExecution.java:666)
	at io.trino.execution.SqlTaskExecution$DriverSplitRunner.processFor(SqlTaskExecution.java:877)
	at io.trino.execution.executor.PrioritizedSplitRunner.process(PrioritizedSplitRunner.java:187)
	at io.trino.execution.executor.TaskExecutor$TaskRunner.run(TaskExecutor.java:561)
	at io.trino.$gen.Trino_testversion____20230518_052710_1.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)

trino:tpch> create table test as select row(123) as c1;
Query 20230518_052801_00031_u2ykj failed: null value in entry: name=null
java.lang.NullPointerException: null value in entry: name=null
	at com.google.common.collect.CollectPreconditions.checkEntryNotNull(CollectPreconditions.java:33)
	at com.google.common.collect.ImmutableMapEntry.<init>(ImmutableMapEntry.java:54)
	at com.google.common.collect.ImmutableMap.entryOf(ImmutableMap.java:339)
	at com.google.common.collect.ImmutableMap$Builder.put(ImmutableMap.java:449)
	at io.trino.plugin.deltalake.transactionlog.DeltaLakeSchemaSupport.serializeStructField(DeltaLakeSchemaSupport.java:188)
	at io.trino.plugin.deltalake.transactionlog.DeltaLakeSchemaSupport.lambda$serializeStructType$5(DeltaLakeSchemaSupport.java:251)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
	at java.base/java.util.AbstractList$RandomAccessSpliterator.forEachRemaining(AbstractList.java:720)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
	at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:921)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:682)
	at io.trino.plugin.deltalake.transactionlog.DeltaLakeSchemaSupport.serializeStructType(DeltaLakeSchemaSupport.java:251)
	at io.trino.plugin.deltalake.transactionlog.DeltaLakeSchemaSupport.serializeColumnType(DeltaLakeSchemaSupport.java:212)
	at io.trino.plugin.deltalake.transactionlog.DeltaLakeSchemaSupport.serializeStructField(DeltaLakeSchemaSupport.java:189)
	at io.trino.plugin.deltalake.transactionlog.DeltaLakeSchemaSupport.lambda$serializeStructType$2(DeltaLakeSchemaSupport.java:171)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
	at java.base/java.util.Collections$2.tryAdvance(Collections.java:4853)
	at java.base/java.util.Collections$2.forEachRemaining(Collections.java:4861)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
	at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:921)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:682)
	at io.trino.plugin.deltalake.transactionlog.DeltaLakeSchemaSupport.serializeStructType(DeltaLakeSchemaSupport.java:178)
	at io.trino.plugin.deltalake.transactionlog.DeltaLakeSchemaSupport.serializeSchemaAsJson(DeltaLakeSchemaSupport.java:151)
	at io.trino.plugin.deltalake.DeltaLakePageSinkProvider.createPageSink(DeltaLakePageSinkProvider.java:103)
	at io.trino.plugin.base.classloader.ClassLoaderSafeConnectorPageSinkProvider.createPageSink(ClassLoaderSafeConnectorPageSinkProvider.java:49)
	at io.trino.split.PageSinkManager.createPageSink(PageSinkManager.java:49)
	at io.trino.operator.TableWriterOperator$TableWriterOperatorFactory.createPageSink(TableWriterOperator.java:123)
	at io.trino.operator.TableWriterOperator$TableWriterOperatorFactory.createOperator(TableWriterOperator.java:117)
	at io.trino.operator.DriverFactory.createDriver(DriverFactory.java:106)
	at io.trino.execution.SqlTaskExecution$DriverSplitRunnerFactory.createDriver(SqlTaskExecution.java:666)
	at io.trino.execution.SqlTaskExecution$DriverSplitRunner.processFor(SqlTaskExecution.java:877)
	at io.trino.execution.executor.PrioritizedSplitRunner.process(PrioritizedSplitRunner.java:187)
	at io.trino.execution.executor.TaskExecutor$TaskRunner.run(TaskExecutor.java:561)
	at io.trino.$gen.Trino_testversion____20230518_052710_1.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)

trino:tpch> alter table test add column c3 row(int);
Query 20230518_053744_00027_6d3qe failed: Unable to add 'c3' column for: tpch.test
io.trino.spi.TrinoException: Unable to add 'c3' column for: tpch.test
	at io.trino.plugin.deltalake.DeltaLakeMetadata.addColumn(DeltaLakeMetadata.java:1260)
	at io.trino.plugin.base.classloader.ClassLoaderSafeConnectorMetadata.addColumn(ClassLoaderSafeConnectorMetadata.java:336)
	at io.trino.tracing.TracingConnectorMetadata.addColumn(TracingConnectorMetadata.java:442)
	at io.trino.metadata.MetadataManager.addColumn(MetadataManager.java:767)
	at io.trino.tracing.TracingMetadata.addColumn(TracingMetadata.java:449)
	at io.trino.execution.AddColumnTask.execute(AddColumnTask.java:137)
	at io.trino.execution.AddColumnTask.execute(AddColumnTask.java:54)
	at io.trino.execution.DataDefinitionExecution.start(DataDefinitionExecution.java:146)
	at io.trino.execution.SqlQueryManager.createQuery(SqlQueryManager.java:257)
	at io.trino.dispatcher.LocalDispatchQuery.startExecution(LocalDispatchQuery.java:145)
	at io.trino.dispatcher.LocalDispatchQuery.lambda$waitForMinimumWorkers$2(LocalDispatchQuery.java:129)
	at io.airlift.concurrent.MoreFutures.lambda$addSuccessCallback$12(MoreFutures.java:569)
	at io.airlift.concurrent.MoreFutures$3.onSuccess(MoreFutures.java:544)
	at com.google.common.util.concurrent.Futures$CallbackListener.run(Futures.java:1138)
	at io.trino.$gen.Trino_testversion____20230518_053713_75.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)
Caused by: java.lang.NullPointerException: null value in entry: name=null
	at com.google.common.collect.CollectPreconditions.checkEntryNotNull(CollectPreconditions.java:33)
	at com.google.common.collect.ImmutableMapEntry.<init>(ImmutableMapEntry.java:54)
	at com.google.common.collect.ImmutableMap.entryOf(ImmutableMap.java:339)
	at com.google.common.collect.ImmutableMap$Builder.put(ImmutableMap.java:449)
	at io.trino.plugin.deltalake.transactionlog.DeltaLakeSchemaSupport.serializeStructField(DeltaLakeSchemaSupport.java:188)
	at io.trino.plugin.deltalake.transactionlog.DeltaLakeSchemaSupport.lambda$serializeStructType$5(DeltaLakeSchemaSupport.java:251)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
	at java.base/java.util.AbstractList$RandomAccessSpliterator.forEachRemaining(AbstractList.java:720)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
	at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:921)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:682)
	at io.trino.plugin.deltalake.transactionlog.DeltaLakeSchemaSupport.serializeStructType(DeltaLakeSchemaSupport.java:251)
	at io.trino.plugin.deltalake.transactionlog.DeltaLakeSchemaSupport.serializeColumnType(DeltaLakeSchemaSupport.java:212)
	at io.trino.plugin.deltalake.transactionlog.DeltaLakeSchemaSupport.serializeStructField(DeltaLakeSchemaSupport.java:189)
	at io.trino.plugin.deltalake.transactionlog.DeltaLakeSchemaSupport.lambda$serializeStructType$2(DeltaLakeSchemaSupport.java:171)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
	at java.base/java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:992)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
	at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:921)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:682)
	at io.trino.plugin.deltalake.transactionlog.DeltaLakeSchemaSupport.serializeStructType(DeltaLakeSchemaSupport.java:178)
	at io.trino.plugin.deltalake.transactionlog.DeltaLakeSchemaSupport.serializeSchemaAsJson(DeltaLakeSchemaSupport.java:151)
	at io.trino.plugin.deltalake.DeltaLakeMetadata.appendTableEntries(DeltaLakeMetadata.java:1283)
	at io.trino.plugin.deltalake.DeltaLakeMetadata.addColumn(DeltaLakeMetadata.java:1243)
	... 17 more
@sardorjumamuratov
Copy link

Hi,

How can I work on this issue?

Could you please guide me through the problem? I would love to help!

@MdJunaidAhmed16
Copy link

Hi, is this issue still open? I could see it was marked closed but then again it is showing open.
If it is open I can work on this !!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
delta-lake Delta Lake connector good first issue Good for newcomers
3 participants