Skip to content

Commit

Permalink
fix push efilter down
Browse files Browse the repository at this point in the history
  • Loading branch information
jievince committed Dec 7, 2022
1 parent de02384 commit efcacb6
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/graph/optimizer/rule/PushEFilterDownRule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ std::string PushEFilterDownRule::toString() const {
const storage::cpp2::EdgeProp &edge,
meta::SchemaManager *schemaMng,
ObjectPool *pool) {
auto edgeNameResult = schemaMng->toEdgeName(spaceId, edge.get_type());
auto edgeNameResult = schemaMng->toEdgeName(spaceId, std::abs(edge.get_type()));
if (!edgeNameResult.ok()) {
return nullptr;
}
Expand Down
28 changes: 28 additions & 0 deletions tests/tck/features/optimizer/PushEFilterDownRule.feature
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,34 @@ Feature: Push EFilter down rule
| 8 | Traverse | 7 | {"edge filter": "", "filter": "(like.likeness==95)"} |
| 7 | IndexScan | 0 | |
| 0 | Start | | |
When profiling query:
"""
MATCH (v:player{name: 'Tim Duncan'})<-[e:like{likeness: 95}]-() return v.player.name AS name
"""
Then the result should be, in any order:
| name |
| "Tim Duncan" |
| "Tim Duncan" |
And the execution plan should be:
| id | name | dependencies | operator info |
| 5 | Project | 8 | |
| 8 | Traverse | 7 | {"edge filter": "", "filter": "(like.likeness==95)"} |
| 7 | IndexScan | 0 | |
| 0 | Start | | |
When profiling query:
"""
MATCH (v:player{name: 'Tim Duncan'})-[e:like{likeness: 95}]-() return v.player.name AS name
"""
Then the result should be, in any order:
| name |
| "Tim Duncan" |
| "Tim Duncan" |
And the execution plan should be:
| id | name | dependencies | operator info |
| 5 | Project | 8 | |
| 8 | Traverse | 7 | {"edge filter": "", "filter": "(like.likeness==95)"} |
| 7 | IndexScan | 0 | |
| 0 | Start | | |
When profiling query:
"""
MATCH (v:player{name: 'Tim Duncan'})-[e:like*1..2{likeness: 95}]->() return v.player.name AS name
Expand Down

0 comments on commit efcacb6

Please sign in to comment.