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.28k stars 2.96k forks source link

Analyze command fails on empty partitions #3700

Open andyc-indeed opened 4 years ago

andyc-indeed commented 4 years ago

Receiving error below when running command below on a partition that turns out to be empty: ANALYZE testschema.testtable with (partitions = ARRAY[ARRAY['2020-05-01 21:00:00']])

java.lang.IllegalArgumentException: unsupported type: array<bigint>
    at com.google.common.base.Preconditions.checkArgument(Preconditions.java:216)
    at io.prestosql.plugin.hive.metastore.thrift.ThriftMetastoreUtil.createMetastoreColumnStatistics(ThriftMetastoreUtil.java:818)
    at io.prestosql.plugin.hive.metastore.thrift.ThriftHiveMetastore.lambda$setPartitionColumnStatistics$23(ThriftHiveMetastore.java:493)
    at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
    at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:175)
    at java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:948)
    at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
    at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
    at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
    at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
    at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499)
    at io.prestosql.plugin.hive.metastore.thrift.ThriftHiveMetastore.setPartitionColumnStatistics(ThriftHiveMetastore.java:494)
    at io.prestosql.plugin.hive.metastore.thrift.ThriftHiveMetastore.updatePartitionStatistics(ThriftHiveMetastore.java:477)
    at io.prestosql.plugin.hive.metastore.thrift.BridgingHiveMetastore.updatePartitionStatistics(BridgingHiveMetastore.java:119)
    at io.prestosql.plugin.hive.metastore.cache.CachingHiveMetastore.updatePartitionStatistics(CachingHiveMetastore.java:358)
    at io.prestosql.plugin.hive.metastore.cache.CachingHiveMetastore.updatePartitionStatistics(CachingHiveMetastore.java:358)
    at io.prestosql.plugin.hive.metastore.SemiTransactionalHiveMetastore.lambda$null$8(SemiTransactionalHiveMetastore.java:318)
    at com.google.common.collect.SingletonImmutableBiMap.forEach(SingletonImmutableBiMap.java:65)
    at io.prestosql.plugin.hive.metastore.SemiTransactionalHiveMetastore.lambda$setPartitionStatistics$9(SemiTransactionalHiveMetastore.java:317)
    at io.prestosql.plugin.hive.metastore.SemiTransactionalHiveMetastore.commit(SemiTransactionalHiveMetastore.java:895)
    at io.prestosql.plugin.hive.HiveMetadata.commit(HiveMetadata.java:2212)
    at io.prestosql.plugin.hive.HiveConnector.commit(HiveConnector.java:198)
    at io.prestosql.transaction.InMemoryTransactionManager$TransactionMetadata$ConnectorTransactionMetadata.commit(InMemoryTransactionManager.java:595)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125)
    at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:57)
    at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78)
    at io.airlift.concurrent.BoundedExecutor.drainQueue(BoundedExecutor.java:78)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)
shandeep00 commented 4 years ago

@andyc-indeed @findepi can anyone tell the steps to reproduce this.