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 6: (4 comments) http://gerrit.cloudera.org:8080/#/c/18705/6/fe/src/main/java/org/apache/impala/analysis/Analyzer.java File fe/src/main/java/org/apache/impala/analysis/Analyzer.java: http://gerrit.cloudera.org:8080/#/c/18705/6/fe/src/main/java/org/apache/impala/analysis/Analyzer.java@3178 PS6, Line 3178: public Set<TupleDescriptor> materializeSlots(List<Expr> exprs, boolean areJoinOnConds) { > I think that it would be better to keep a materializeSlots(List<Expr> expr Done. I used the first method to reduce the change size. http://gerrit.cloudera.org:8080/#/c/18705/6/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/6/fe/src/main/java/org/apache/impala/planner/SingleNodePlanner.java@2117 PS6, Line 2117: while (conjunctIter.hasNext()) { > since you didn't remove eqJoinConjuncts's element, you can use 'for (Binary Done http://gerrit.cloudera.org:8080/#/c/18705/6/fe/src/main/java/org/apache/impala/planner/SingleNodePlanner.java@2123 PS6, Line 2123: SlotRef innerSlotRef = eq.getChild(1).unwrapSlotRef(true); > is the 2nd child must belong to the right table? Right, only left joins are optimized at present. http://gerrit.cloudera.org:8080/#/c/18705/6/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/6/testdata/workloads/functional-planner/queries/PlannerTest/outer-join-elimination.test@1 PS6, Line 1: select catalog_sales.cs_item_sk, catalog_sales.cs_order_number > Can you add a few more tests? I was thinking about the following cases: Done. Some unoptimized cases can be optimized in the following changes, for example, right outer join, join on inline view, only distinct values of the outer table are used (no matter whether the inner join key is unique or not), etc. -- 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: 6 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: Sat, 08 Oct 2022 12:14:58 +0000 Gerrit-HasComments: Yes
