Skip to content
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

[LDBC] Fix argument when the input is NULL #5007

Merged
merged 3 commits into from
Dec 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/graph/executor/logic/ArgumentExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ folly::Future<Status> ArgumentExecutor::execute() {
std::unordered_set<Value> unique;
for (; iter->valid(); iter->next()) {
auto &val = iter->getColumn(alias);
if (!val.isVertex()) {
if (val.isNull()) {
continue;
} else if (!val.isVertex()) {
return Status::Error("Argument only support vertex, but got %s, which is type %s, ",
val.toString().c_str(),
val.typeName().c_str());
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 @@ -294,6 +294,17 @@ Feature: Multi Line Multi Query Parts
Then the result should be, in any order:
| count |
| 4 |
# When the input of argument is NULL
When executing query:
"""
MATCH (v1:player) WHERE id(v1) IN ["Tony Parker", "Tim Duncan"]
OPTIONAL MATCH (v1)-[e:like{likeness:90}]->(v2) MATCH (v2)-[e2:serve]->(v3)
RETURN *
"""
Then the result should be, in any order:
| v1 | e | v2 | e2 | v3 |
| ("Tony Parker" :player{age: 36, name: "Tony Parker"}) | [:like "Tony Parker"->"LaMarcus Aldridge" @0 {}] | ("LaMarcus Aldridge" :player{}) | [:serve "LaMarcus Aldridge"->"Spurs" @0 {}] | ("Spurs" :team{}) |
| ("Tony Parker" :player{age: 36, name: "Tony Parker"}) | [:like "Tony Parker"->"LaMarcus Aldridge" @0 {}] | ("LaMarcus Aldridge" :player{}) | [:serve "LaMarcus Aldridge"->"Trail Blazers" @0 {}] | ("Trail Blazers" :team{}) |

Scenario: Multi Line Multi Query Parts
When executing query:
Expand Down