Skip to content

Commit

Permalink
IMPALA-2015: Add support for nested loop join
Browse files Browse the repository at this point in the history
Implement nested-loop join in Impala with support for multiple join
modes, including inner, outer, semi and anti joins. Null-aware left
anti-join is not currently supported.

Summary of changes:
Introduced the NestedLoopJoinNode class in the FE that represents the nested
loop join. Common functionality between NestedLoopJoinNode and HashJoinNode
(e.g. cardinality estimation) was moved to the JoinNode class.
In the BE, introduced the NestedLoopJoinNode class that implements the nested-loop
join execution strategy.

Change-Id: I238ec7dc0080f661847e5e1b84e30d61c3b0bb5c
Reviewed-on: http://gerrit.cloudera.org:8080/652
Reviewed-by: Dimitris Tsirogiannis <dtsirogiannis@cloudera.com>
Tested-by: Internal Jenkins
  • Loading branch information
skye authored and Internal Jenkins committed Aug 19, 2015
1 parent 63bea74 commit 07589cc
Show file tree
Hide file tree
Showing 36 changed files with 1,738 additions and 1,084 deletions.
4 changes: 2 additions & 2 deletions be/src/exec/CMakeLists.txt
Expand Up @@ -28,7 +28,6 @@ add_library(Exec
base-sequence-scanner.cc
blocking-join-node.cc
catalog-op-executor.cc
cross-join-node.cc
data-sink.cc
data-source-scan-node.cc
delimited-text-parser.cc
Expand Down Expand Up @@ -61,6 +60,7 @@ add_library(Exec
hbase-scan-node.cc
hbase-table-scanner.cc
incr-stats-util.cc
nested-loop-join-node.cc
partitioned-aggregation-node.cc
partitioned-aggregation-node-ir.cc
partitioned-hash-join-node.cc
Expand Down Expand Up @@ -88,4 +88,4 @@ ADD_BE_TEST(read-write-util-test)
ADD_BE_TEST(parquet-plain-test)
ADD_BE_TEST(parquet-version-test)
ADD_BE_TEST(row-batch-list-test)
ADD_BE_TEST(incr-stats-util-test)
ADD_BE_TEST(incr-stats-util-test)
5 changes: 5 additions & 0 deletions be/src/exec/blocking-join-node.cc
Expand Up @@ -38,12 +38,17 @@ BlockingJoinNode::BlockingJoinNode(const string& node_name, const TJoinOp::type
join_op_(join_op),
eos_(false),
probe_side_eos_(false),
probe_batch_pos_(-1),
current_probe_row_(NULL),
semi_join_staging_row_(NULL),
can_add_probe_filters_(false) {
}

Status BlockingJoinNode::Init(const TPlanNode& tnode) {
RETURN_IF_ERROR(ExecNode::Init(tnode));
DCHECK((join_op_ != TJoinOp::LEFT_SEMI_JOIN && join_op_ != TJoinOp::LEFT_ANTI_JOIN &&
join_op_ != TJoinOp::RIGHT_SEMI_JOIN && join_op_ != TJoinOp::RIGHT_ANTI_JOIN &&
join_op_ != TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN) || conjunct_ctxs_.size() == 0);
return Status::OK();
}

Expand Down
179 changes: 0 additions & 179 deletions be/src/exec/cross-join-node.cc

This file was deleted.

87 changes: 0 additions & 87 deletions be/src/exec/cross-join-node.h

This file was deleted.

6 changes: 3 additions & 3 deletions be/src/exec/exec-node.cc
Expand Up @@ -26,13 +26,13 @@
#include "exprs/expr.h"
#include "exec/aggregation-node.h"
#include "exec/analytic-eval-node.h"
#include "exec/cross-join-node.h"
#include "exec/data-source-scan-node.h"
#include "exec/empty-set-node.h"
#include "exec/exchange-node.h"
#include "exec/hash-join-node.h"
#include "exec/hbase-scan-node.h"
#include "exec/hdfs-scan-node.h"
#include "exec/nested-loop-join-node.h"
#include "exec/partitioned-aggregation-node.h"
#include "exec/partitioned-hash-join-node.h"
#include "exec/select-node.h"
Expand Down Expand Up @@ -299,8 +299,8 @@ Status ExecNode::CreateNode(ObjectPool* pool, const TPlanNode& tnode,
*node = pool->Add(new HashJoinNode(pool, tnode, descs));
}
break;
case TPlanNodeType::CROSS_JOIN_NODE:
*node = pool->Add(new CrossJoinNode(pool, tnode, descs));
case TPlanNodeType::NESTED_LOOP_JOIN_NODE:
*node = pool->Add(new NestedLoopJoinNode(pool, tnode, descs));
break;
case TPlanNodeType::EMPTY_SET_NODE:
*node = pool->Add(new EmptySetNode(pool, tnode, descs));
Expand Down

0 comments on commit 07589cc

Please sign in to comment.