-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix match multiple id error #3899
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -973,3 +973,68 @@ Feature: Match By Id | |
| ("Warriors" :team{name: "Warriors"}) | | ||
| ("Hornets" :team{name: "Hornets"}) | | ||
| ("Spurs" :team{name: "Spurs"}) | | ||
|
||
Scenario: match by multiple id | ||
When executing query: | ||
""" | ||
MATCH (a)-[e:like]->(b) | ||
WHERE id(a) == 'Tim Duncan' OR id(b) == 'Tony Parker' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should add integer vid test case too. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ok, add case in next pr There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why don't add in this PR directly? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @Sophie-Xie waiting for this PR to publish test version |
||
RETURN id(a) as src, e, id(b) as dst | ||
""" | ||
Then the result should be, in any order, with relax comparison: | ||
| src | e | dst | | ||
| "Tim Duncan" | [:like "Tim Duncan"->"Manu Ginobili" @0 {likeness: 95}] | "Manu Ginobili" | | ||
| "Tim Duncan" | [:like "Tim Duncan"->"Tony Parker" @0 {likeness: 95}] | "Tony Parker" | | ||
| "Boris Diaw" | [:like "Boris Diaw"->"Tony Parker" @0 {likeness: 80}] | "Tony Parker" | | ||
| "LaMarcus Aldridge" | [:like "LaMarcus Aldridge"->"Tony Parker" @0 {likeness: 75}] | "Tony Parker" | | ||
| "Dejounte Murray" | [:like "Dejounte Murray"->"Tony Parker" @0 {likeness: 99}] | "Tony Parker" | | ||
| "Marco Belinelli" | [:like "Marco Belinelli"->"Tony Parker" @0 {likeness: 50}] | "Tony Parker" | | ||
When executing query: | ||
""" | ||
MATCH (a)-[e:like]->(b) | ||
WHERE id(a) == 'Tim Duncan' AND id(b) == 'Tony Parker' | ||
RETURN id(a) as src, e, id(b) as dst | ||
""" | ||
Then the result should be, in any order, with relax comparison: | ||
| src | e | dst | | ||
| "Tim Duncan" | [:like "Tim Duncan"->"Tony Parker" @0 {likeness: 95}] | "Tony Parker" | | ||
When executing query: | ||
""" | ||
MATCH (a)--(b) | ||
WHERE id(a) == 'Tim Duncan' AND id(b) == 'Tony Parker' | ||
RETURN id(a) as src, id(b) as dst | ||
""" | ||
Then the result should be, in any order, with relax comparison: | ||
| src | dst | | ||
| "Tim Duncan" | "Tony Parker" | | ||
| "Tim Duncan" | "Tony Parker" | | ||
| "Tim Duncan" | "Tony Parker" | | ||
| "Tim Duncan" | "Tony Parker" | | ||
When executing query: | ||
""" | ||
MATCH (v1)-[:like]->(v2:player)-[:serve]->(v3) | ||
WHERE id(v3) == 'Spurs' AND id(v1) == 'Tony Parker' | ||
RETURN v1, v2, v3 | ||
""" | ||
Then the result should be, in any order, with relax comparison: | ||
| v1 | v2 | v3 | | ||
| ("Tony Parker" :player{age: 36, name: "Tony Parker"}) | ("Manu Ginobili" :player{age: 41, name: "Manu Ginobili"}) | ("Spurs" :team{name: "Spurs"}) | | ||
| ("Tony Parker" :player{age: 36, name: "Tony Parker"}) | ("LaMarcus Aldridge" :player{age: 33, name: "LaMarcus Aldridge"}) | ("Spurs" :team{name: "Spurs"}) | | ||
| ("Tony Parker" :player{age: 36, name: "Tony Parker"}) | ("Tim Duncan" :bachelor{name: "Tim Duncan", speciality: "psychology"} :player{age: 42, name: "Tim Duncan"}) | ("Spurs" :team{name: "Spurs"}) | | ||
When executing query: | ||
""" | ||
MATCH (a)--(b) WHERE id(b) == 'Tony Parker' RETURN DISTINCT id(a) | ||
UNION | ||
MATCH (a)--(b) WHERE id(b) == 'Tony Parker' RETURN DISTINCT id(a) | ||
""" | ||
Then the result should be, in any order, with relax comparison: | ||
| id(a) | | ||
| "Hornets" | | ||
| "Marco Belinelli" | | ||
| "Spurs" | | ||
| "Dejounte Murray" | | ||
| "Tim Duncan" | | ||
| "Boris Diaw" | | ||
| "Manu Ginobili" | | ||
| "Kyle Anderson" | | ||
| "LaMarcus Aldridge" | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should report error
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use like index not vertexIDseek
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Emm. It's not related to this VIdSeek, better not put in this file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And you should add fail case of or expression.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's ok to put this case here