Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 46710df

Browse files
czpmangoSophie-Xie
andauthored
Fix edge all predicate with rank function (vesoft-inc#5503)
Co-authored-by: Sophie <[email protected]>
1 parent 17de17d commit 46710df

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

src/graph/optimizer/rule/EmbedEdgeAllPredIntoTraverseRule.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,10 @@ bool isEdgeAllPredicate(const Expression* e,
6565
return false;
6666
}
6767
auto ves = graph::ExpressionUtils::collectAll(pe->filter(), {Expression::Kind::kAttribute});
68+
if (ves.empty()) {
69+
// innerVar.prop not exists
70+
return false;
71+
}
6872
for (const auto& ve : ves) {
6973
auto iv = static_cast<const AttributeExpression*>(ve)->left();
7074

tests/tck/features/match/MultiLineMultiQueryParts.feature

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,17 @@ Feature: Multi Line Multi Query Parts
298298
Then the result should be, in order:
299299
| scount | lcount |
300300
| 19 | 110 |
301+
When executing query:
302+
"""
303+
MATCH (m:player{name:"Tim Duncan"})-[e:like*2..3]-(n)--()
304+
WHERE all(i in e where rank(i)==0)
305+
WITH m,count(*) AS lcount
306+
MATCH (m)--(n)
307+
RETURN count(*) AS scount, lcount
308+
"""
309+
Then the result should be, in order:
310+
| scount | lcount |
311+
| 19 | 2888 |
301312
When executing query:
302313
"""
303314
MATCH (m:player{name:"Tim Duncan"})-[:like]-(n)--()

0 commit comments

Comments
 (0)