-
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
Correc the alter default value dont't affected. #2003
Correc the alter default value dont't affected. #2003
Conversation
TODO: Add cases to https://github.com/vesoft-inc-private/nebula-test |
Codecov Report
@@ Coverage Diff @@
## master #2003 +/- ##
==========================================
- Coverage 86.80% 86.73% -0.07%
==========================================
Files 641 641
Lines 61369 61731 +362
==========================================
+ Hits 53272 53545 +273
- Misses 8097 8186 +89
Continue to review full report at Codecov.
|
if (value->getType() != nebula::cpp2::Value::Type::timestamp) { | ||
LOG(ERROR) << "Create Tag Failed: " << name | ||
<< " type mismatch"; | ||
return cpp2::ErrorCode::E_CONFLICT; |
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 return E_CONFLICT
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.
Follow the previous.
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.
Previous may be an error, this data type or parameter is wrong
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.
Follow the behavior that create the tag/edge.
auto name = col.get_name(); | ||
auto dKey = MetaServiceUtils::defaultKey(spaceId, Id, name); | ||
std::string defaultValue; | ||
if (col.__isset.default_value) { |
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.
Here can encapsulate as a function, and where need it, call it, don't need judge twice.
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 default will be refactor in #2011
LOG(INFO) << "Alter edge " << req.get_edge_name() << ", edgeType " << edgeType; | ||
data.emplace_back(MetaServiceUtils::schemaEdgeKey(spaceId, edgeType, version), | ||
MetaServiceUtils::schemaEdgeVal(req.get_edge_name(), schema)); | ||
resp_.set_id(to(edgeType, EntryType::EDGE)); | ||
// Now we get default value from meta instead of cache |
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.
Is the annotation wrong?
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.
Don't, graph get it from meta directly now, I had a PR #2011 to fix it.
LOG(INFO) << "Alter Tag " << req.get_tag_name() << ", tagId " << tagId; | ||
data.emplace_back(MetaServiceUtils::schemaTagKey(spaceId, tagId, version), | ||
MetaServiceUtils::schemaTagVal(req.get_tag_name(), schema)); | ||
resp_.set_id(to(tagId, EntryType::TAG)); | ||
// Now we get default value from meta instead of cache |
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
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.
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.
Codecov Report
@@ Coverage Diff @@
## master #2003 +/- ##
==========================================
- Coverage 86.84% 86.74% -0.10%
==========================================
Files 641 641
Lines 61651 61830 +179
==========================================
+ Hits 53541 53636 +95
- Misses 8110 8194 +84
Continue to review full report at Codecov.
|
* Correc the alter default value dont't affected. * Treat bitint as unkown error. * Fix one alignment. * Correct the error message. * Fix one alignment. * Fix one alignment. * Fix one alignment. * Correct the default value remove logical. * Return error when unknown type. * Fix one code alignment. * Remove the useless code. * Update to master. * Merge the default value handle code. Co-authored-by: dutor <440396+dutor@users.noreply.github.com>
…oft-inc#2003) Co-authored-by: Sophie <84560950+Sophie-Xie@users.noreply.github.com> Co-authored-by: Doodle <13706157+critical27@users.noreply.github.com> Co-authored-by: Sophie <84560950+Sophie-Xie@users.noreply.github.com>
What changes were proposed in this pull request?
Close #1987
Why are the changes needed?
Does this PR introduce any user-facing change?
NO
How was this patch tested?