-
Notifications
You must be signed in to change notification settings - Fork 49
Support TTL for index #382
Support TTL for index #382
Conversation
73c9bb8
to
12de655
Compare
TODO :
|
12de655
to
30cb073
Compare
Added test cases for storage side. |
test cases changed for graph side : |
Ready to review. |
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.
LGTM, good job. Any related PR?
After this one merged , test case need to correct for graph side : vesoft-inc/nebula-graph#876 |
|
||
StatusOr<Value> CommonUtils::ttlValue(const meta::SchemaProviderIf* schema, RowReader* reader) { | ||
DCHECK(schema != nullptr); | ||
const auto* ns = dynamic_cast<const meta::NebulaSchemaProvider*>(schema); |
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.
We could remove SchemaProviderIf
later if necessary, it is useless now.
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.
We could remove
SchemaProviderIf
later if necessary, it is useless now.
Yes, I see other place that need to be changed, Let me change them later.
continue; | ||
} | ||
|
||
auto ttlProp = CommonUtils::ttlProps(schema.get()); |
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.
Could move to rebuild index task ?
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.
Could move to rebuild index task ?
What's the purpose?
837af26
to
d698e52
Compare
Fixed compile error and rebased master. |
if (prop.get_ttl_col()) { | ||
col = *prop.get_ttl_col(); | ||
} | ||
if (!col.empty() && duration > 0) { |
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.
Can ttl and index coexist?
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.
Aha, they can coexist. I saved the timestamp value to index val.
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.
existIndex
means there is an index,
!col.empty() && duration> 0
means there is ttl
Why is there an error here?
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.
existIndex
means there is an index,
!col.empty() && duration> 0
means there is ttlWhy is there an error here?
if index exists, not allow to alter TTL properties.
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, i know what you mean.
But the prop
schema prop is in the schema
, not the schema prop in AlterTagReq
.
Your current logic is that when alter tag, as long as there is index and ttl, an error will be reported.
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, i know what you mean.
But theprop
schema prop is in theschema
, not the schema prop inAlterTagReq
.Your current logic is that when alter tag, as long as there is index and ttl, an error will be reported.
yes,there should be an error thrown here, either alter ttl
or alter column
(excepted for add column
)
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 mean:
here logic is unreasonable.
As long as there are index and ttl, here are not allowed to alter tag
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.
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 job.
could you add a UT that a tag has already a index and ttl, and then alter this tag(not alter ttl prop)?
Aha, the old test cases are still valid for storage side. for graph side, the below PR to do with what you said. |
|
25cd467
to
4b28c7e
Compare
Addressed panda-sheep's comments. |
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 job!
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 job!
This file |
Not ready to review