Skip to content

Commit

Permalink
Fix PushFilterDownHashInnerJoinRule (vesoft-inc#2057)
Browse files Browse the repository at this point in the history
Co-authored-by: Cheng Xuntao <[email protected]>
  • Loading branch information
nebula-bots and xtcyclist authored Dec 29, 2022
1 parent 16898e5 commit aefc1f5
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ StatusOr<OptRule::TransformResult> PushFilterDownHashInnerJoinRule::transform(
newGroupNode->dependsOn(const_cast<OptGroup*>(newJoinGroup));
} else {
newInnerJoinNode->setOutputVar(oldFilterNode->outputVar());
newInnerJoinNode->setColNames(oldFilterNode->colNames());
newInnerJoinNode->setColNames(oldInnerJoinNode->colNames());
}

TransformResult result;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -253,3 +253,39 @@ Feature: Push Filter down HashInnerJoin rule
| 10 | Traverse | 8 | |
| 8 | Argument | 9 | |
| 9 | Start | | |

Scenario: push filter down hash join bug fix
Given an empty graph
And load "test" csv data to a new space
When profiling query:
"""
MATCH (v1:Label_6:Label_3)<-[e2:Rel_1]-(:Label_5)-[e3]->(v2)
WHERE (id(v1) in [20, 28, 31, 6, 4, 18, 15, 25, 9, 19, 21])
MATCH p0 = (v2)<-[e4]-()-[e5]->(v3:Label_6)
WITH min(v3.Label_6.Label_6_4_Int) AS pa0,
v3.Label_6.Label_6_1_Bool AS pa2
WHERE pa2
RETURN pa2
"""
Then the result should be, in any order:
| pa2 |
| true |
And the execution plan should be:
| id | name | dependencies | operator info |
| 17 | project | 19 | |
| 19 | aggregate | 24 | |
| 24 | HashInnerJoin | 21,29 | |
| 21 | project | 20 | |
| 20 | filter | 6 | |
| 6 | AppendVertices | 26 | |
| 26 | Traverse | 25 | |
| 25 | Traverse | 2 | |
| 2 | Dedup | 1 | |
| 1 | PassThrough | 3 | |
| 3 | Start | | |
| 29 | project | 28 | |
| 28 | Filter | 27 | {"condition": "$-.v3.Label_6.Label_6_1_Bool"} |
| 27 | AppendVertices | 11 | |
| 11 | Traverse | 10 | |
| 10 | Traverse | 9 | |
| 9 | Argument | | |

0 comments on commit aefc1f5

Please sign in to comment.