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
trino:tpch> select * from region where "$path" = '';
regionkey | name | comment
-----------+------+---------
(0 rows)
trino:tpch> explain select * from region where "$path" = '';
Query 20230511_011103_00032_8v2jg failed: Constraint on an unexpected column 2147483646:$path:varchar
java.lang.IllegalArgumentException: Constraint on an unexpected column 2147483646:$path:varchar
at com.google.common.base.Preconditions.checkArgument(Preconditions.java:220)
at io.trino.plugin.iceberg.ExpressionConverter.toIcebergExpression(ExpressionConverter.java:65)
at io.trino.plugin.iceberg.TableStatisticsReader.makeTableStatistics(TableStatisticsReader.java:142)
at io.trino.plugin.iceberg.TableStatisticsReader.getTableStatistics(TableStatisticsReader.java:95)
at io.trino.plugin.iceberg.IcebergMetadata.lambda$getTableStatistics$77(IcebergMetadata.java:2500)
at java.base/java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1708)
at io.trino.plugin.iceberg.IcebergMetadata.getTableStatistics(IcebergMetadata.java:2481)
at io.trino.plugin.base.classloader.ClassLoaderSafeConnectorMetadata.getTableStatistics(ClassLoaderSafeConnectorMetadata.java:328)
at io.trino.tracing.TracingConnectorMetadata.getTableStatistics(TracingConnectorMetadata.java:316)
at io.trino.metadata.MetadataManager.getTableStatistics(MetadataManager.java:473)
at io.trino.tracing.TracingMetadata.getTableStatistics(TracingMetadata.java:296)
at io.trino.cost.CachingTableStatsProvider.getTableStatistics(CachingTableStatsProvider.java:45)
at io.trino.cost.TableScanStatsRule.doCalculate(TableScanStatsRule.java:62)
at io.trino.cost.TableScanStatsRule.doCalculate(TableScanStatsRule.java:38)
at io.trino.cost.SimpleStatsRule.calculate(SimpleStatsRule.java:39)
at io.trino.cost.ComposableStatsCalculator.calculateStats(ComposableStatsCalculator.java:85)
at io.trino.cost.ComposableStatsCalculator.calculateStats(ComposableStatsCalculator.java:73)
at io.trino.cost.CachingStatsProvider.getStats(CachingStatsProvider.java:82)
at io.trino.cost.OutputStatsRule.calculate(OutputStatsRule.java:41)
at io.trino.cost.OutputStatsRule.calculate(OutputStatsRule.java:27)
at io.trino.cost.ComposableStatsCalculator.calculateStats(ComposableStatsCalculator.java:85)
at io.trino.cost.ComposableStatsCalculator.calculateStats(ComposableStatsCalculator.java:73)
at io.trino.cost.CachingStatsProvider.getStats(CachingStatsProvider.java:82)
at io.trino.cost.StatsAndCosts.create(StatsAndCosts.java:87)
at io.trino.sql.planner.LogicalPlanner.plan(LogicalPlanner.java:289)
at io.trino.sql.analyzer.QueryExplainer.getLogicalPlan(QueryExplainer.java:179)
at io.trino.sql.analyzer.QueryExplainer.getDistributedPlan(QueryExplainer.java:190)
at io.trino.sql.analyzer.QueryExplainer.getPlan(QueryExplainer.java:109)
at io.trino.sql.rewrite.ExplainRewrite$Visitor.getQueryPlan(ExplainRewrite.java:152)
at io.trino.sql.rewrite.ExplainRewrite$Visitor.visitExplain(ExplainRewrite.java:130)
at io.trino.sql.rewrite.ExplainRewrite$Visitor.visitExplain(ExplainRewrite.java:75)
at io.trino.sql.tree.Explain.accept(Explain.java:61)
at io.trino.sql.tree.AstVisitor.process(AstVisitor.java:27)
at io.trino.sql.rewrite.ExplainRewrite.rewrite(ExplainRewrite.java:72)
at io.trino.sql.rewrite.StatementRewrite.rewrite(StatementRewrite.java:55)
at io.trino.sql.analyzer.Analyzer.analyze(Analyzer.java:92)
at io.trino.sql.analyzer.Analyzer.analyze(Analyzer.java:86)
at io.trino.execution.SqlQueryExecution.analyze(SqlQueryExecution.java:271)
at io.trino.execution.SqlQueryExecution.<init>(SqlQueryExecution.java:206)
at io.trino.execution.SqlQueryExecution$SqlQueryExecutionFactory.createQueryExecution(SqlQueryExecution.java:845)
at io.trino.dispatcher.LocalDispatchQueryFactory.lambda$createDispatchQuery$0(LocalDispatchQueryFactory.java:154)
at io.trino.$gen.Trino_testversion____20230511_010815_75.call(Unknown Source)
at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:131)
at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:74)
at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:82)
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)
The text was updated successfully, but these errors were encountered:
@ebyhr Hi, I did some verifications on this, I found it's not related to the EXPLAIN but the iceberg table statistics computing if involving MetadataColumn, If set session collect_plan_statistics_for_all_queries to true the select query would fail as well.
I tried to fix this on my local ( in TableStatisticsReader.makeTableStatistics method):
Remove the meta column predicate in effectivePredicate before pass to ExpressionConverter.toIcebergExpression
Skip scan file tasks if the path not match path(using above filtered path predicate), like the IcebergSplitSource do.
I am not confident about the approach as I have rarely experience about the connector, could you help to check and guide me about this?
findepi
changed the title
EXPLAIN with predicates on Iceberg metadata columns fails
Failure when reading Iceberg statistics and query involves $path column predicate
May 30, 2023
The text was updated successfully, but these errors were encountered: