-
Notifications
You must be signed in to change notification settings - Fork 132
Conversation
@@ -217,6 +245,11 @@ StatusOr<DataSet> SchemaUtil::toShowCreateSchema(bool isTag, | |||
} else { | |||
createStr += "\"\""; | |||
} | |||
if (prop.__isset.comment) { | |||
createStr += ", comment = \""; |
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.
upper 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.
It's same with properties like ttl_col, ttl_duration.
} | ||
if (!indexItem.fields.empty()) { | ||
createStr.resize(createStr.size() -2); | ||
createStr += "\n"; | ||
} | ||
createStr += ")"; | ||
if (indexItem.__isset.comment) { | ||
createStr += " comment = \""; |
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.
upper 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.
ditto.
@randomJoe211 Update the document when merged. |
src/util/SchemaUtil.h
Outdated
@@ -24,6 +24,9 @@ class SchemaUtil final { | |||
SchemaUtil() = delete; | |||
|
|||
public: | |||
// The length limitation of schema comment field. | |||
static constexpr std::size_t kCommentLengthLimit = 256; |
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.
Maybe we can allow a longer length limit, i feel 256
is not enough since it could not be configured.
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.
Change it to gflag?
src/util/SchemaUtil.cpp
Outdated
@@ -11,6 +11,8 @@ | |||
namespace nebula { | |||
namespace graph { | |||
|
|||
/*static*/ constexpr std::size_t SchemaUtil::kCommentLengthLimit; |
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.
It seems not necessary to define it again
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 lead to compile error.
src/parser/parser.yy
Outdated
| KW_CREATE KW_SPACE opt_if_not_exists name_label KW_ON name_label { | ||
auto sentence = new CreateSpaceSentence($4, $3); | ||
sentence->setGroupName($6); | ||
$$ = sentence; | ||
} | ||
| KW_CREATE KW_SPACE opt_if_not_exists name_label KW_ON name_label KW_COMMENT ASSIGN STRING { |
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.
Need we to add a comma between group and comment? @CPWstatic @dutor any suggestion?
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 think we should add comma between comment
and successor field.And don't need add after group name.
sentence->setOpts($6); | ||
sentence->setComment($12); | ||
$$ = sentence; | ||
} |
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.
Maybe you need to refactor the create_space_sentence
syntax implementation:
create_space_without_group_sentence
: ... {
}
;
create_space_without_comment_sentence
: create_space_without_group_sentence {
$$ = $1;
}
| create_space_without_group_sentence KW_ON name_label {
$1->setGroup($3);
$$ = $1;
}
;
create_space_sentence
: create_space_without_comment_sentence {
$$ = $1;
}
| create_space_without_comment_sentence KW_COMMENT ASSIGN STRING {
$1->setComment($4);
$$ = $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.
This should refactor in a separate PR.
…into feature/comment
…into feature/comment
Seems this pr introduces a breaking change. Should this be merged together with vesoft-inc/nebula-common#488 ? |
Not related. |
ONCALL-46
Require vesoft-inc/nebula-common#475
vesoft-inc/nebula-storage#411