-
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
add unwind & check vidType when executing not validate #4456
Conversation
Codecov Report
@@ Coverage Diff @@
## master #4456 +/- ##
==========================================
+ Coverage 84.55% 84.61% +0.05%
==========================================
Files 1344 1346 +2
Lines 134103 134189 +86
==========================================
+ Hits 113397 113545 +148
+ Misses 20706 20644 -62
Continue to review full report at Codecov.
|
Why change this? |
user need to use unwind in nGql, convert a list to a column and pipe to the next statement |
When executing query: | ||
""" | ||
LOOKUP ON player | ||
WHERE player.name == 'Tim Duncan' | ||
YIELD player.age as age, id(vertex) as vid | ||
| UNWIND $-.vid as a RETURN a | ||
| UNWIND $-.vid as a | YIELD $-.a AS a |
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.
Will the column age
be passed on?
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.
will not be passed to the next statement in nGql
@@ -26,7 +26,7 @@ folly::Future<Status> UnwindExecutor::execute() { | |||
std::vector<Value> vals = extractList(list); | |||
for (auto &v : vals) { | |||
Row row; | |||
if (!emptyInput) { | |||
if (!unwind->fromPipe() && !emptyInput) { |
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.
How to support multiple variable?
This may break the variable passing ability of ngql's pipe.
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.
Unwind does not support multiple variables in parser
Then a SyntaxError should be raised at runtime: syntax error near `UNWIND' | ||
Then the result should be, in any order, with relax comparison: | ||
| a | | ||
| "Tim Duncan" | | ||
When executing query: | ||
""" | ||
GET SUBGRAPH 2 STEPS FROM "Tim Duncan" BOTH like YIELD edges as e |
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.
Add test case:
LOOKUP ... YIELD age,id(vertex) AS vid | UNWIND $-.vid as a MATCH (v)--(n) ...
This unwind has different semantics from cypher unwind? If so, will you consider redesigning the syntax? |
The unwind in ngql is soooooooooo very useful and it helped me make impossible things possible today, thanks again @nevermore3 |
* fix lookup (#4552) fix Co-authored-by: jimingquan <[email protected]> Co-authored-by: Sophie <[email protected]> * fix split brain in raft (#4479) Co-authored-by: Sophie <[email protected]> * fix invalid filter in GetProp make storage crashed (#4568) Co-authored-by: haowen <[email protected]> * fix scan vertex/edge do not handle ttl (#4578) * fix scan vertex/edge do not handle ttl * use ErrorCode to unify community version and end version * Fix #1212. Return FoldConstantExprVisitor, if status_ already failed due to found syantax errors. (#4607) Co-authored-by: jie.wang <[email protected]> * Avoid fatal when expression illegal. (#4618) * Fix concurrent exception related to multi-match statement (#4605) * fix filter executor * Fix concurrency exception of multi-match statements fix iterator fix small delete small delete skip iterator type handle for concurrency small delete fix scan edges small delete small delete fix small delete small change small change fix ut small fix Co-authored-by: Sophie <[email protected]> * Prune properties(#4523) * fix conflict * extract attribute from properties function (#4604) * extract attribute from properties function * fix error * fix subscript error * add test case * process scanEdges * fix test error * add unwind & check vidType when executing not validate (#4456) * Update AppendVerticesExecutor.cpp fix conflict * Update AppendVerticesExecutor.cpp * Replace obsolete RocksDB API (#4395) Co-authored-by: Sophie <[email protected]> * Update PrunePropertiesRule.feature * remove useless dc (#4533) * Update PrunePropertiesRule.feature * fix test error Co-authored-by: kyle.cao <[email protected]> Co-authored-by: jimingquan <[email protected]> Co-authored-by: liwenhui-soul <[email protected]> Co-authored-by: Doodle <[email protected]> Co-authored-by: haowen <[email protected]> Co-authored-by: Cheng Xuntao <[email protected]> Co-authored-by: jie.wang <[email protected]> Co-authored-by: shylock <[email protected]> Co-authored-by: Qiaolin Yu <[email protected]>
What type of PR is this?
What problem(s) does this PR solve?
Issue(s) number:
Description:
affect GO、Fetch prop on vertices 、Fetch prop on edges、Find Path 、Get Subgraph
check vidType when executing. not validate
2、add unwindSentence, use unwind in nGql
Special notes for your reviewer, ex. impact of this fix, design document, etc:
Checklist:
Tests:
Affects:
Release notes:
Please confirm whether to be reflected in release notes and how to describe: