Skip to content
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

Merged
merged 17 commits into from
May 20, 2020
Merged

Correc the alter default value dont't affected. #2003

merged 17 commits into from
May 20, 2020

Conversation

Shylock-Hg
Copy link
Contributor

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?

@Shylock-Hg
Copy link
Contributor Author

TODO: Add cases to https://github.com/vesoft-inc-private/nebula-test

@codecov-io
Copy link

codecov-io commented Mar 27, 2020

Codecov Report

Merging #2003 into master will decrease coverage by 0.06%.
The diff coverage is 79.49%.

Impacted file tree graph

@@            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     
Impacted Files Coverage Δ
src/common/base/ConcurrentLRUCache.h 100.00% <ø> (ø)
src/common/utils/NebulaKeyUtils.cpp 97.45% <0.00%> (-2.55%) ⬇️
src/common/utils/NebulaKeyUtils.h 90.41% <ø> (ø)
src/graph/CloudAuthenticator.cpp 0.00% <0.00%> (ø)
src/kvstore/KVEngine.h 100.00% <ø> (ø)
src/kvstore/NebulaStore.h 91.30% <ø> (ø)
src/kvstore/RocksEngine.h 87.50% <ø> (ø)
src/kvstore/RocksEngineConfig.cpp 75.51% <ø> (ø)
src/kvstore/SnapshotManagerImpl.cpp 0.00% <0.00%> (ø)
src/kvstore/raftex/RaftPart.cpp 77.22% <ø> (-0.75%) ⬇️
... and 47 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7a0152b...66f9f91. Read the comment docs.

src/graph/SchemaHelper.cpp Show resolved Hide resolved
src/graph/SchemaHelper.cpp Outdated Show resolved Hide resolved
src/meta/MetaServiceUtils.cpp Outdated Show resolved Hide resolved
src/meta/MetaServiceUtils.cpp Outdated Show resolved Hide resolved
src/meta/MetaServiceUtils.cpp Outdated Show resolved Hide resolved
src/meta/MetaServiceUtils.h Outdated Show resolved Hide resolved
if (value->getType() != nebula::cpp2::Value::Type::timestamp) {
LOG(ERROR) << "Create Tag Failed: " << name
<< " type mismatch";
return cpp2::ErrorCode::E_CONFLICT;
Copy link
Contributor

Choose a reason for hiding this comment

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

why return E_CONFLICT

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Follow the previous.

Copy link
Contributor

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

Copy link
Contributor Author

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

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.

Copy link
Contributor Author

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

src/meta/processors/schemaMan/AlterEdgeProcessor.cpp Outdated Show resolved Hide resolved
src/meta/processors/schemaMan/AlterEdgeProcessor.cpp Outdated Show resolved Hide resolved
@Shylock-Hg Shylock-Hg requested a review from CPWstatic April 2, 2020 15:17
src/meta/processors/BaseProcessor.h Outdated Show resolved Hide resolved
src/meta/processors/BaseProcessor.inl Outdated Show resolved Hide resolved
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
Copy link
Contributor

Choose a reason for hiding this comment

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

Is the annotation wrong?

Copy link
Contributor Author

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

Choose a reason for hiding this comment

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

ditto

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.

@jude-zhu jude-zhu requested a review from laura-ding May 18, 2020 08:01
Copy link
Contributor

@monadbobo monadbobo left a comment

Choose a reason for hiding this comment

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

LGTM.

@codecov-commenter
Copy link

Codecov Report

Merging #2003 into master will decrease coverage by 0.09%.
The diff coverage is 76.29%.

Impacted file tree graph

@@            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     
Impacted Files Coverage Δ
src/graph/GoExecutor.h 56.25% <ø> (ø)
src/meta/MetaServiceUtils.h 100.00% <ø> (ø)
src/meta/processors/BaseProcessor.h 81.39% <ø> (ø)
.../meta/processors/schemaMan/CreateEdgeProcessor.cpp 74.74% <ø> (ø)
...c/meta/processors/schemaMan/CreateTagProcessor.cpp 76.00% <ø> (ø)
src/meta/MetaServiceUtils.cpp 86.91% <36.36%> (-5.95%) ⬇️
...c/meta/processors/schemaMan/AlterEdgeProcessor.cpp 77.77% <70.00%> (-1.91%) ⬇️
...rc/meta/processors/schemaMan/AlterTagProcessor.cpp 77.77% <70.00%> (-1.91%) ⬇️
src/graph/SchemaHelper.cpp 86.84% <76.56%> (-0.31%) ⬇️
src/graph/GoExecutor.cpp 75.87% <84.61%> (ø)
... and 16 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8aa3ea6...15304cd. Read the comment docs.

@dutor dutor merged commit e8a0030 into vesoft-inc:master May 20, 2020
tong-hao pushed a commit to tong-hao/nebula that referenced this pull request Jun 1, 2021
* 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>
yixinglu pushed a commit to yixinglu/nebula that referenced this pull request Jan 31, 2023
…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-for-testing PR: ready for the CI test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

alter tag with [default] not working.
8 participants