Jian Zhang has posted comments on this change. ( http://gerrit.cloudera.org:8080/18705 )
Change subject: IMPALA-11417: Support outer join elimination optimization ...................................................................... Patch Set 8: (3 comments) http://gerrit.cloudera.org:8080/#/c/18705/8/fe/src/main/java/org/apache/impala/planner/SingleNodePlanner.java File fe/src/main/java/org/apache/impala/planner/SingleNodePlanner.java: http://gerrit.cloudera.org:8080/#/c/18705/8/fe/src/main/java/org/apache/impala/planner/SingleNodePlanner.java@2135 PS8, Line 2135: != > Shouldn't we enable <= ? So if all primary key columns are included in the Sure. We should change it to >. The outer join should not be eliminated if the amount of primary key columns is greater than the amount of join's equal conditions. A test is also added for this case. http://gerrit.cloudera.org:8080/#/c/18705/8/testdata/workloads/functional-planner/queries/PlannerTest/outer-join-elimination.test File testdata/workloads/functional-planner/queries/PlannerTest/outer-join-elimination.test: http://gerrit.cloudera.org:8080/#/c/18705/8/testdata/workloads/functional-planner/queries/PlannerTest/outer-join-elimination.test@43 PS8, Line 43: not > According to the plan the right side was actually eliminated. It's a bug caused by mistakenly validating whether the slots are only used in join conjuncts. Slots in equal and other conjuncts should update their `isOnlyInJoinConds_` to true before validating whether the outer join can be eliminated. I've fixed it in the newest patch. http://gerrit.cloudera.org:8080/#/c/18705/8/testdata/workloads/functional-planner/queries/PlannerTest/outer-join-elimination.test@59 PS8, Line 59: Left outer join an inline view > Can you add another one with an inline view where the whole JOIN is include Done. But since there is no column pruning before this optimization, the outer join in the inline view is not eliminated now. I'll record this as a further optimization in Jira. -- To view, visit http://gerrit.cloudera.org:8080/18705 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: If2e68263a029ac84a4f35b0846b22aa42d7ceece Gerrit-Change-Number: 18705 Gerrit-PatchSet: 8 Gerrit-Owner: Jian Zhang <[email protected]> Gerrit-Reviewer: Csaba Ringhofer <[email protected]> Gerrit-Reviewer: Impala Public Jenkins <[email protected]> Gerrit-Reviewer: Jian Zhang <[email protected]> Gerrit-Reviewer: Quanlong Huang <[email protected]> Gerrit-Reviewer: Xiang Yang <[email protected]> Gerrit-Comment-Date: Mon, 10 Oct 2022 08:38:19 +0000 Gerrit-HasComments: Yes
