Skip to content

Commit

Permalink
support kAttribute
Browse files Browse the repository at this point in the history
match (n) where n in $list_var return n
  • Loading branch information
wey-gu committed Mar 31, 2022
1 parent 614e3a8 commit a3fb923
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/graph/visitor/VidExtractVisitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,8 @@ void VidExtractVisitor::visit(RelationalExpression *expr) {
return;
}
if (expr->left()->kind() != Expression::Kind::kFunctionCall ||
expr->right()->kind() != Expression::Kind::kList ||
!(expr->right()->kind() == Expression::Kind::kList ||
expr->right()->kind() == Expression::Kind::kAttribute) ||
!ExpressionUtils::isEvaluableExpr(expr->right(), qctx_)) {
vidPattern_ = VidPattern{};
return;
Expand Down
10 changes: 9 additions & 1 deletion tests/tck/features/yield/parameter.feature
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Feature: Parameter

Background:
Given a graph with space named "nba"
Given parameters: {"p1":1,"p2":true,"p3":"Tim Duncan","p4":3.3,"p5":[1,true,3],"p6":{"a":3,"b":false,"c":"Tim Duncan"},"p7":{"a":{"b":{"c":"Tim Duncan","d":[1,2,3,true,"Tim Duncan"]}}}, "p8":"Manu Ginobili"}
Given parameters: {"p1":1,"p2":true,"p3":"Tim Duncan","p4":3.3,"p5":[1,true,3],"p6":{"a":3,"b":false,"c":"Tim Duncan"},"p7":{"a":{"b":{"c":"Tim Duncan","d":[1,2,3,true,"Tim Duncan"]}}},"p8":"Manu Ginobili"}

Scenario: return parameters
When executing query:
Expand Down Expand Up @@ -34,6 +34,14 @@ Feature: Parameter
| v |
| "Tim Duncan" |
| "Manu Ginobili" |
When executing query:
"""
MATCH (v) WHERE id(v) IN $p7.a.b.d
RETURN id(v) AS v
"""
Then the result should be, in any order:
| v |
| "Tim Duncan" |
When executing query:
"""
MATCH (v:player)-[:like]->(n) WHERE id(v)==$p3 and n.player.age>$p1+29
Expand Down

0 comments on commit a3fb923

Please sign in to comment.