-
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
Insert vertex only #3335
Insert vertex only #3335
Conversation
How about |
This problem has been initially solved. |
add insert vertex only validator fix grammar adjust insert vertex parser
6ff67a2
to
0f6de68
Compare
@@ -38,6 +38,20 @@ class InsertVerticesValidator final : public Validator { | |||
std::vector<storage::cpp2::NewVertex> vertices_; | |||
}; | |||
|
|||
class InsertVerticesOnlyValidator final : public Validator { |
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.
Why don't reuse InsertVerticesValidator?
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.
The syntax of InsertVerticesOnly
and the syntax of InsertVertices
are quite different in the parser process. This causes the data structure contained in the two Sentences to be different. If both Sentences use InsertVerticesValidator
, two completely different toPlan
logics are also required. So simply use a new InsertVerticesOnlyValidator
. This also ensures that the impact on InsertVertices
is minimal, and other bugs will not be introduced during the modification process.
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.
Line 2839 in df3781c
vertex_row_item |
I think you just need add a new reduce rule like vid { $$ = new VertexRowIten($1, new ValueList())}
in vertex_row_item
rule.
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.
But, InsertVertices
can not use vertexID list as "1,2,3".It needs "1:(),2:(),3:()" instead. So if add a new reduce rule in vertex_row_item
, the parse process of insertVertices
will be very strange.
src/parser/Sentence.h
Outdated
@@ -52,6 +52,7 @@ class Sentence { | |||
kDropTag, | |||
kDropEdge, | |||
kInsertVertices, | |||
kInsertVerticesOnly, |
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.
ditto
Codecov Report
@@ Coverage Diff @@
## master #3335 +/- ##
==========================================
+ Coverage 85.19% 85.22% +0.02%
==========================================
Files 1306 1307 +1
Lines 122158 122239 +81
==========================================
+ Hits 104078 104182 +104
+ Misses 18080 18057 -23
Continue to review full report at Codecov.
|
14a35f7
to
d1ad1c3
Compare
INSERT EDGE e() VALUES 1->2:(),2->3:(); | ||
""" | ||
Then the execution should be successful | ||
When executing query: |
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 like fetch prop on * 1
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.
In previous conversations, there were more files. Just want to make sure this PR contains the files you want. Otherwise, good to go after fixing shylock's comment.
I adjust the implement according to shylock's suggestion and use another way which minimize the changes of previous code. |
@@ -218,11 +218,12 @@ StorageRpcRespFuture<cpp2::GetPropResponse> StorageClient::getProps( | |||
req.set_space_id(param.space); | |||
req.set_parts(std::move(c.second)); | |||
req.set_dedup(dedup); | |||
if (vertexProps != nullptr) { |
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.
Why change this?
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.
wait fix in #3443
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.
The same. Fixing something else?
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.
@cangfengzhs Please check why vertexProp equals to null, maybe not fixed in #3443
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.
FetchVerticesPlanner::buildVertexProps
return a nullptr
when props is empty
…to insert_vertex_only2
What type of PR is this?
What does this PR do?
add
insert vertex only
statementFor example:
About parentheses in statement.at the beginning, I wanted to implement it in the following format, but there was ambiguity:
In stmt1,
t()
represents a function, but in stmt2,t()
represents a tagWhich issue(s)/PR(s) this PR relates to?
part of issue: #3123
need PR: #3328
Special notes for your reviewer, ex. impact of this fix, etc:
Additional context:
Checklist:
Release notes:
Please confirm whether to reflect in release notes and how to describe: