Skip to content
This repository has been archived by the owner on Dec 1, 2022. It is now read-only.

Feature/comment #895

Merged
merged 30 commits into from
May 6, 2021
Merged

Feature/comment #895

merged 30 commits into from
May 6, 2021

Conversation

Shylock-Hg
Copy link
Contributor

@Shylock-Hg Shylock-Hg commented Mar 29, 2021

@Shylock-Hg Shylock-Hg requested review from a team March 29, 2021 10:28
tests/tck/features/schema/Comment.feature Outdated Show resolved Hide resolved
@@ -217,6 +245,11 @@ StatusOr<DataSet> SchemaUtil::toShowCreateSchema(bool isTag,
} else {
createStr += "\"\"";
}
if (prop.__isset.comment) {
createStr += ", comment = \"";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

upper case

Copy link
Contributor Author

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 = \"";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

upper case

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto.

@Shylock-Hg Shylock-Hg added the doc affected Solution: improvements or additions to documentation label Mar 30, 2021
@Shylock-Hg Shylock-Hg requested review from yixinglu and a team March 30, 2021 08:29
@Shylock-Hg
Copy link
Contributor Author

@randomJoe211 Update the document when merged.

@@ -24,6 +24,9 @@ class SchemaUtil final {
SchemaUtil() = delete;

public:
// The length limitation of schema comment field.
static constexpr std::size_t kCommentLengthLimit = 256;
Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change it to gflag?

@@ -11,6 +11,8 @@
namespace nebula {
namespace graph {

/*static*/ constexpr std::size_t SchemaUtil::kCommentLengthLimit;
Copy link
Contributor

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

Copy link
Contributor Author

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.

| 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 {
Copy link
Contributor

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?

Copy link
Contributor Author

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.

@Shylock-Hg Shylock-Hg requested a review from yixinglu April 13, 2021 06:17
@yixinglu yixinglu added the ready-for-testing PR: ready for the CI test label Apr 14, 2021
src/parser/MaintainSentences.h Outdated Show resolved Hide resolved
src/parser/MaintainSentences.h Outdated Show resolved Hide resolved
sentence->setOpts($6);
sentence->setComment($12);
$$ = sentence;
}
Copy link
Contributor

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;
  }
  ;

Copy link
Contributor Author

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.

src/validator/MaintainValidator.cpp Outdated Show resolved Hide resolved
@Shylock-Hg Shylock-Hg requested review from yixinglu and a team April 20, 2021 09:27
yixinglu
yixinglu previously approved these changes Apr 20, 2021
@yixinglu yixinglu requested a review from a team April 20, 2021 13:55
@Shylock-Hg Shylock-Hg requested a review from a team April 25, 2021 06:16
@Aiee
Copy link
Contributor

Aiee commented Apr 25, 2021

Seems this pr introduces a breaking change. Should this be merged together with vesoft-inc/nebula-common#488 ?

@Shylock-Hg
Copy link
Contributor Author

Seems this pr introduces a breaking change. Should this be merged together with vesoft-inc/nebula-common#488 ?

Not related.

@yixinglu yixinglu merged commit 58463a3 into vesoft-inc:master May 6, 2021
@Shylock-Hg Shylock-Hg deleted the feature/comment branch July 13, 2021 05:49
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
doc affected Solution: improvements or additions to documentation ready-for-testing PR: ready for the CI test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants