-
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
Support Time-to-live in query(syntax) #330
Conversation
ayyt
commented
May 7, 2019
•
edited
Loading
edited
- support Time-to-live in syntax
- also extend to support other schema options
- improve create/alter edge for using TTL
Can one of the admins verify this patch? |
src/parser/MaintainSentences.h
Outdated
items_.emplace_back(item); | ||
} | ||
|
||
std::vector<std::unique_ptr<SchemaOptItem>> getOpt() { |
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 about getOpts()
or opts()
?
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.
good catch!
src/parser/MaintainSentences.h
Outdated
items_.emplace_back(item); | ||
} | ||
|
||
std::vector<std::unique_ptr<SchemaOptItem>> getOpt() { |
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.
Returning std::vector<SchemaOptItem*>
is more reasonable. WDYT?
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.
Yeah, You are right.
src/parser/MaintainSentences.h
Outdated
@@ -93,18 +244,25 @@ class CreateTagSentence final : public Sentence { | |||
return columns_->columnSpecs(); | |||
} | |||
|
|||
std::vector<std::unique_ptr<SchemaOptItem>> getSchemaOpts() { |
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
src/parser/MaintainSentences.h
Outdated
@@ -197,17 +363,25 @@ class AlterTagSentence final : public Sentence { | |||
return opts_->alterTagItems(); | |||
} | |||
|
|||
std::vector<std::unique_ptr<SchemaOptItem>> getSchemaOpts() { |
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
src/parser/parser.yy
Outdated
} | ||
; | ||
|
||
alter_tag_sentence | ||
: KW_ALTER KW_TAG LABEL alter_tag_opt_list { | ||
$$ = new AlterTagSentence($3, $4); | ||
: KW_ALTER KW_TAG LABEL alter_schema_opt_list alter_tag_opt_list { |
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.
putting alter_tag_opt_list
in front of alter_schema_opt_list
seems more reasonable.
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.
refer mysql , the order of alter_tag_opt_list and alter_schema_opt_list doesn't matter
src/parser/test/ParserTest.cpp
Outdated
} | ||
{ | ||
GQLParser parser; | ||
std::string query = "alter TAG womann ttl_duration = 50, ttl_col = age"; |
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 ttl_col
property should be time typed property. In order to avoid misunderstanding, using an appropriate property instead of age
in the test case.
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.
I don't think so. 64bit type can set ttl_col
Fixed and rebased master, please review, thx. |
Close this PR, use new PR #403. |