Fix base column name not present error when dereference pushdown enabled#15469
Merged
zhenxiao merged 2 commits intoprestodb:masterfrom Nov 28, 2020
Merged
Conversation
Contributor
|
@beinan you are right, we should use the name from the assignments. Thanks for fixing this. Could you please add a test? |
Member
Author
Sure, will add a test soon. Thank you for the review! |
Member
Author
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! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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?