Xiang Yang has uploaded a new patch set (#11) to the change originally created
by Jian Zhang. ( http://gerrit.cloudera.org:8080/18705 )
Change subject: IMPALA-11417: Support outer join elimination optimization
......................................................................
IMPALA-11417: Support outer join elimination optimization
When two tables are outer joined but only fields from the outer side
table are used and the join key of the inner side table is guaranteed to
be unique, the query can be simplified to only scan the outer table:
drop table if exists t;
drop table if exists s;
create table t(sid bigint, value bigint);
create table s(id bigint, value bigint, primary key(id));
-- the test SQL:
select t.* from t left join s on t.sid = s.id;
The above query can be simplified to:
select t.* from t;
This optimization utilizes the primary key constraint when creating join
nodes, eliminates the inner side when the join key on inner side is the
primary key and only the slots from the outer side are used by the
parent.
Change-Id: If2e68263a029ac84a4f35b0846b22aa42d7ceece
Signed-off-by: Jian Zhang <[email protected]>
---
M be/src/service/query-options.cc
M be/src/service/query-options.h
M common/thrift/ImpalaService.thrift
M common/thrift/Query.thrift
M fe/src/main/java/org/apache/impala/analysis/Analyzer.java
M fe/src/main/java/org/apache/impala/analysis/SlotDescriptor.java
M fe/src/main/java/org/apache/impala/planner/SingleNodePlanner.java
M fe/src/test/java/org/apache/impala/planner/PlannerTest.java
A
testdata/workloads/functional-planner/queries/PlannerTest/outer-join-elimination.test
A testdata/workloads/tpcds/queries/outer-join-elimination.test
M tests/query_test/test_join_queries.py
11 files changed, 535 insertions(+), 4 deletions(-)
git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/05/18705/11
--
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: newpatchset
Gerrit-Change-Id: If2e68263a029ac84a4f35b0846b22aa42d7ceece
Gerrit-Change-Number: 18705
Gerrit-PatchSet: 11
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: Kurt Deschler <[email protected]>
Gerrit-Reviewer: Quanlong Huang <[email protected]>
Gerrit-Reviewer: Xiang Yang <[email protected]>