Skip to content

Commit

Permalink
Fix edge all predicate with rank function (#5503)
Browse files Browse the repository at this point in the history
Co-authored-by: Sophie <84560950+Sophie-Xie@users.noreply.github.com>
  • Loading branch information
czpmango and Sophie-Xie committed Apr 19, 2023
1 parent ae3c5d2 commit 9ce7a6f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/graph/optimizer/rule/EmbedEdgeAllPredIntoTraverseRule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ bool isEdgeAllPredicate(const Expression* e,
return false;
}
auto ves = graph::ExpressionUtils::collectAll(pe->filter(), {Expression::Kind::kAttribute});
if (ves.empty()) {
// innerVar.prop not exists
return false;
}
for (const auto& ve : ves) {
auto iv = static_cast<const AttributeExpression*>(ve)->left();

Expand Down
11 changes: 11 additions & 0 deletions tests/tck/features/match/MultiLineMultiQueryParts.feature
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,17 @@ Feature: Multi Line Multi Query Parts
Then the result should be, in order:
| scount | lcount |
| 19 | 110 |
When executing query:
"""
MATCH (m:player{name:"Tim Duncan"})-[e:like*2..3]-(n)--()
WHERE all(i in e where rank(i)==0)
WITH m,count(*) AS lcount
MATCH (m)--(n)
RETURN count(*) AS scount, lcount
"""
Then the result should be, in order:
| scount | lcount |
| 19 | 2888 |
When executing query:
"""
MATCH (m:player{name:"Tim Duncan"})-[:like]-(n)--()
Expand Down

0 comments on commit 9ce7a6f

Please sign in to comment.