Impala Public Jenkins has submitted this change and it was merged. ( http://gerrit.cloudera.org:8080/24597 )
Change subject: IMPALA-7996: Optimize constant-false outer joins ...................................................................... IMPALA-7996: Optimize constant-false outer joins Constant FALSE or NULL ON conjuncts eliminate usable equi-join predicates during expression rewriting. The classic planner then chooses a nested-loop join although the join cannot produce a match. Add a synthetic non-matching hash predicate for outer joins and drop redundant remaining ON conjuncts. The predicate is what keeps this a hash join: left where the analyzer put it, among the other conjuncts, the FALSE leaves the planner choosing a nested loop join, and the constant buys nothing. Replace the non-preserved input of left and right outer joins with EmptySetNode. Broadcast the empty build for constant-false left outer joins, even with a SHUFFLE hint. Invert right outer joins so their empty input also becomes the broadcast build. Keep full outer joins partitioned and use random distribution on both inputs to avoid constant-key skew. Add planner coverage for single-node and distributed plans with literal, folded, and typed NULL predicates. Add query tests with constant inline views to verify preserved-side row counts. Change-Id: I6505825fc958720eec12e13d546661834f221b80 Assisted-by: gpt-5.6-sol (OpenAI Codex) Reviewed-on: http://gerrit.cloudera.org:8080/24597 Reviewed-by: Impala Public Jenkins <[email protected]> Tested-by: Impala Public Jenkins <[email protected]> --- M fe/src/main/java/org/apache/impala/planner/DistributedPlanner.java M fe/src/main/java/org/apache/impala/planner/HashJoinNode.java M fe/src/main/java/org/apache/impala/planner/Planner.java M fe/src/main/java/org/apache/impala/planner/SingleNodePlanner.java M testdata/workloads/functional-planner/queries/PlannerTest/empty.test M testdata/workloads/functional-query/queries/QueryTest/outer-joins.test 6 files changed, 210 insertions(+), 36 deletions(-) Approvals: Impala Public Jenkins: Looks good to me, approved; Verified -- To view, visit http://gerrit.cloudera.org:8080/24597 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I6505825fc958720eec12e13d546661834f221b80 Gerrit-Change-Number: 24597 Gerrit-PatchSet: 10 Gerrit-Owner: Aleksandr Efimov <[email protected]> Gerrit-Reviewer: Aleksandr Efimov <[email protected]> Gerrit-Reviewer: Aman Sinha <[email protected]> Gerrit-Reviewer: Csaba Ringhofer <[email protected]> Gerrit-Reviewer: Impala Public Jenkins <[email protected]> Gerrit-Reviewer: Michael Smith <[email protected]> Gerrit-Reviewer: Paul Rogers <[email protected]> Gerrit-Reviewer: Steve Carlin <[email protected]> Gerrit-Reviewer: Yifan Zhang <[email protected]>
