Skip to content

Fix base column name not present error when dereference pushdown enabled#15469

Merged
zhenxiao merged 2 commits intoprestodb:masterfrom
beinan:beinan/fix_base_column_name_error
Nov 28, 2020
Merged

Fix base column name not present error when dereference pushdown enabled#15469
zhenxiao merged 2 commits intoprestodb:masterfrom
beinan:beinan/fix_base_column_name_error

Conversation

@beinan
Copy link
Copy Markdown
Member

@beinan beinan commented Nov 22, 2020

We're seeing the error below when the dereference push down is enabled

java.lang.IllegalArgumentException: nested column [SOME_COLUMN_455.SOME_SUBFIELD]'s base column SOME_COLUMN_455 is not present in table scan output at com.facebook.presto.hive.rule.HiveParquetDereferencePushDown$Visitor.visitProject(HiveParquetDereferencePushDown.java:357) at com.facebook.presto.hive.rule.HiveParquetDereferencePushDown$Visitor.visitProject(HiveParquetDereferencePushDown.java:288) at com.facebook.presto.spi.plan.ProjectNode.accept(ProjectNode.java:92) at com.facebook.presto.hive.rule.HiveParquetDereferencePushDown$Visitor.visitPlan(HiveParquetDereferencePushDown.java:308) at com.facebook.presto.hive.rule.HiveParquetDereferencePushDown$Visitor.visitProject(HiveParquetDereferencePushDown.java:325) at com.facebook.presto.hive.rule.HiveParquetDereferencePushDown$Visitor.visitProject(HiveParquetDereferencePushDown.java:288) at com.facebook.presto.spi.plan.ProjectNode.accept(ProjectNode.java:92) at com.facebook.presto.hive.rule.HiveParquetDereferencePushDown$Visitor.visitPlan(HiveParquetDereferencePushDown.java:308) at com.facebook.presto.hive.rule.HiveParquetDereferencePushDown$Visitor.visitPlan(HiveParquetDereferencePushDown.java:288) at com.facebook.presto.spi.plan.PlanVisitor.visitFilter(PlanVisitor.java:35) at com.facebook.presto.spi.plan.FilterNode.accept(FilterNode.java:80) at com.facebook.presto.hive.rule.HiveParquetDereferencePushDown$Visitor.visitPlan(HiveParquetDereferencePushDown.java:308) at com.facebook.presto.hive.rule.HiveParquetDereferencePushDown$Visitor.visitProject(HiveParquetDereferencePushDown.java:325) at com.facebook.presto.hive.rule.HiveParquetDereferencePushDown$Visitor.visitProject(HiveParquetDereferencePushDown.java:288) at com.facebook.presto.spi.plan.ProjectNode.accept(ProjectNode.java:92) at com.facebook.presto.hive.rule.HiveParquetDereferencePushDown$Visitor.visitPlan(HiveParquetDereferencePushDown.java:308) at com.facebook.presto.hive.rule.HiveParquetDereferencePushDown$Visitor.visitProject(HiveParquetDereferencePushDown.java:325) at com.facebook.presto.hive.rule.HiveParquetDereferencePushDown$Visitor.visitProject(HiveParquetDereferencePushDown.java:288) at com.facebook.presto.spi.plan.ProjectNode.accept(ProjectNode.java:92) at com.facebook.presto.hive.rule.HiveParquetDereferencePushDown$Visitor.visitPlan(HiveParquetDereferencePushDown.java:308) at com.facebook.presto.hive.rule.HiveParquetDereferencePushDown$Visitor.visitProject(HiveParquetDereferencePushDown.java:325) at com.facebook.presto.hive.rule.HiveParquetDereferencePushDown$Visitor.visitProject(HiveParquetDereferencePushDown.java:288) at com.facebook.presto.spi.plan.ProjectNode.accept(ProjectNode.java:92) at com.facebook.presto.hive.rule.HiveParquetDereferencePushDown.optimize(HiveParquetDereferencePushDown.java:175) at com.facebook.presto.sql.planner.optimizations.ApplyConnectorOptimization.optimize(ApplyConnectorOptimization.java:134) at com.facebook.presto.sql.planner.LogicalPlanner.plan(LogicalPlanner.java:187) at com.facebook.presto.sql.planner.LogicalPlanner.plan(LogicalPlanner.java:176) at com.facebook.presto.execution.SqlQueryExecution.doAnalyzeQuery(SqlQueryExecution.java:392) at com.facebook.presto.execution.SqlQueryExecution.analyzeQuery(SqlQueryExecution.java:378) at com.facebook.presto.execution.SqlQueryExecution.start(SqlQueryExecution.java:328) at com.facebook.presto.$gen.Presto_0_241_66578ef____20201121_034334_1.run(Unknown Source) at com.facebook.presto.execution.SqlQueryManager.createQuery(SqlQueryManager.java:242) at com.facebook.presto.dispatcher.LocalDispatchQuery.lambda$startExecution$5(LocalDispatchQuery.java:114) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:834)

So I think we should use SOME_COLUMN_SOME_NUMBER instead of SOME_COLUMN as the key of the map regularHiveColumnHandles

@vkorukanti and @zhenxiao, could you guys help take a look?

== NO RELEASE NOTE ==

@vkorukanti
Copy link
Copy Markdown
Contributor

@beinan you are right, we should use the name from the assignments. Thanks for fixing this. Could you please add a test?

@beinan
Copy link
Copy Markdown
Member Author

beinan commented Nov 23, 2020

@beinan you are right, we should use the name from the assignments. Thanks for fixing this. Could you please add a test?

Sure, will add a test soon. Thank you for the review!

@beinan
Copy link
Copy Markdown
Member Author

beinan commented Nov 25, 2020

@beinan you are right, we should use the name from the assignments. Thanks for fixing this. Could you please add a test?

Just added a test case of self join which would cover the base name with a number in the assignments, @vkorukanti could you have a second look? Thanks!

Copy link
Copy Markdown
Collaborator

@zhenxiao zhenxiao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good. thanks for fixing it, @beinan

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants