Skip to content

Commit

Permalink
Rename BiInnerJoin to hash join
Browse files Browse the repository at this point in the history
  • Loading branch information
yixinglu committed Dec 4, 2022
1 parent a36909c commit 72218de
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
8 changes: 4 additions & 4 deletions src/graph/optimizer/rule/PushFilterDownHashInnerJoinRule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const Pattern& PushFilterDownHashInnerJoinRule::pattern() const {
static Pattern pattern = Pattern::create(
PlanNode::Kind::kFilter,
{Pattern::create(
PlanNode::Kind::kBiInnerJoin,
PlanNode::Kind::kHashInnerJoin,
{Pattern::create(PlanNode::Kind::kUnknown), Pattern::create(PlanNode::Kind::kUnknown)})});
return pattern;
}
Expand All @@ -40,8 +40,8 @@ StatusOr<OptRule::TransformResult> PushFilterDownHashInnerJoinRule::transform(
DCHECK_EQ(oldFilterNode->kind(), PlanNode::Kind::kFilter);

auto* innerJoinNode = matched.planNode({0, 0});
DCHECK_EQ(innerJoinNode->kind(), PlanNode::Kind::kBiInnerJoin);
auto* oldInnerJoinNode = static_cast<const graph::BiInnerJoin*>(innerJoinNode);
DCHECK_EQ(innerJoinNode->kind(), PlanNode::Kind::kHashInnerJoin);
auto* oldInnerJoinNode = static_cast<const graph::HashInnerJoin*>(innerJoinNode);

const auto* condition = static_cast<graph::Filter*>(oldFilterNode)->condition();
DCHECK(condition);
Expand All @@ -62,7 +62,7 @@ StatusOr<OptRule::TransformResult> PushFilterDownHashInnerJoinRule::transform(
rightGroup = rightGroup ? rightGroup : const_cast<OptGroup*>(rightResult.node->group());

// produce new InnerJoin node
auto* newInnerJoinNode = static_cast<graph::BiInnerJoin*>(oldInnerJoinNode->clone());
auto* newInnerJoinNode = static_cast<graph::HashInnerJoin*>(oldInnerJoinNode->clone());
auto newJoinGroup = rightFilterUnpicked ? OptGroup::create(octx) : filterGroupNode->group();
auto newGroupNode = OptGroupNode::create(octx, newInnerJoinNode, newJoinGroup);
newGroupNode->dependsOn(leftGroup);
Expand Down
2 changes: 1 addition & 1 deletion src/graph/optimizer/rule/PushFilterDownHashInnerJoinRule.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
namespace nebula {
namespace opt {

// Push down the filter items from the left subplan of [[BiInnerJoin]]
// Push down the filter items from the left subplan of [[HashInnerJoin]]
class PushFilterDownHashInnerJoinRule final : public OptRule {
public:
const Pattern &pattern() const override;
Expand Down
2 changes: 1 addition & 1 deletion tests/tck/features/match/AllShortestPaths.feature
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@ Feature: allShortestPaths
And the execution plan should be:
| id | name | dependencies | operator info |
| 19 | Project | 18 | |
| 18 | BiInnerJoin | 10,17 | |
| 18 | HashInnerJoin | 10,17 | |
| 10 | Project | 9 | |
| 9 | BiCartesianProduct | 24,25 | |
| 24 | AppendVertices | 20 | |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Feature: Push Filter down HashInnerJoin rule
Background:
Given a graph with space named "nba"

Scenario: push filter down BiInnerJoin
Scenario: push filter down HashInnerJoin
When profiling query:
"""
MATCH (v:player)
Expand Down Expand Up @@ -35,7 +35,7 @@ Feature: Push Filter down HashInnerJoin rule
| id | name | dependencies | operator info |
| 30 | Sort | 14 | |
| 14 | Project | 19 | |
| 19 | BiInnerJoin | 6,22 | |
| 19 | HashInnerJoin | 6,22 | |
| 6 | Project | 20 | |
| 20 | AppendVertices | 2 | |
| 2 | Dedup | 1 | |
Expand Down Expand Up @@ -75,7 +75,7 @@ Feature: Push Filter down HashInnerJoin rule
| id | name | dependencies | operator info |
| 30 | Sort | 14 | |
| 14 | Project | 19 | |
| 19 | BiInnerJoin | 6,11 | |
| 19 | HashInnerJoin | 6,11 | |
| 6 | Project | 16 | |
| 16 | Filter | 20 | { "condition": "(v.player.age>0)" } |
| 20 | AppendVertices | 2 | |
Expand Down Expand Up @@ -115,7 +115,7 @@ Feature: Push Filter down HashInnerJoin rule
| id | name | dependencies | operator info |
| 30 | Sort | 14 | |
| 14 | Project | 20 | |
| 20 | BiInnerJoin | 23,25 | |
| 20 | HashInnerJoin | 23,25 | |
| 23 | Project | 22 | |
| 22 | Filter | 21 | {"condition": "(v.player.age>0)"} |
| 21 | AppendVertices | 2 | |
Expand Down Expand Up @@ -156,7 +156,7 @@ Feature: Push Filter down HashInnerJoin rule
| id | name | dependencies | operator info |
| 30 | Sort | 14 | |
| 14 | Project | 19 | |
| 19 | BiInnerJoin | 6,22 | |
| 19 | HashInnerJoin | 6,22 | |
| 6 | Project | 20 | |
| 20 | AppendVertices | 2 | |
| 2 | Dedup | 1 | |
Expand All @@ -169,7 +169,7 @@ Feature: Push Filter down HashInnerJoin rule
| 7 | Argument | 8 | |
| 8 | Start | | |

Scenario: NOT push filter down BiInnerJoin
Scenario: NOT push filter down HashInnerJoin
When profiling query:
"""
MATCH (v:player)-[]-(vv)
Expand All @@ -191,7 +191,7 @@ Feature: Push Filter down HashInnerJoin rule
| 20 | TopN | 15 | |
| 15 | Project | 14 | |
| 14 | Filter | 13 | { "condition": "(($e.likeness>90) OR (vv.team.start_year>2000))" } |
| 13 | BiInnerJoin | 16,12 | |
| 13 | HashInnerJoin | 16,12 | |
| 16 | Project | 5 | |
| 5 | AppendVertices | 17 | |
| 17 | Traverse | 2 | |
Expand Down

0 comments on commit 72218de

Please sign in to comment.