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

add scan edge/vertex in storage #1381

Merged
merged 4 commits into from
Jan 10, 2020
Merged

Conversation

critical27
Copy link
Contributor

@critical27 critical27 commented Dec 5, 2019

Support scan edge/vertex in storage, later for spark job.

We can retrieve data of a part limited by single vertexId and time range. We could enhance it by adding complicated filter and group of vertex later.

@critical27 critical27 added the do not review PR: not ready for the code review yet label Dec 5, 2019
@critical27 critical27 changed the title add scan edge add scan edge/vertex in storage Dec 10, 2019
@critical27 critical27 added ready-for-testing PR: ready for the CI test and removed do not review PR: not ready for the code review yet labels Dec 10, 2019
@critical27
Copy link
Contributor Author

Jenkins go

@nebula-community-bot
Copy link
Member

Unit testing passed.

1 similar comment
@nebula-community-bot
Copy link
Member

Unit testing passed.

@nebula-community-bot
Copy link
Member

Unit testing failed.

@nebula-community-bot
Copy link
Member

Unit testing passed.

@nebula-community-bot
Copy link
Member

Unit testing passed.

CPWstatic
CPWstatic previously approved these changes Dec 20, 2019
Copy link
Contributor

@CPWstatic CPWstatic left a comment

Choose a reason for hiding this comment

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

Thanks, scanVertex is totally meet my requirements.

@nebula-community-bot
Copy link
Member

Unit testing passed.

@nebula-community-bot
Copy link
Member

Unit testing passed.

src/meta/NebulaSchemaProvider.cpp Outdated Show resolved Hide resolved
src/kvstore/RocksEngine.h Outdated Show resolved Hide resolved
src/storage/BaseProcessor.inl Show resolved Hide resolved
@nebula-community-bot
Copy link
Member

Unit testing passed.


~RocksRangeWithPrefixIter() = default;

bool valid() const override {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why override the method? It looks the same.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

}

EdgeType edgeType = NebulaKeyUtils::getEdgeType(key);
if (edgeType < 0) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Sounds good to me.


if (returnAllColumns_) {
// return all columns
edgeContexts_.emplace(edgeType, std::move(propContexts));
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we really need to set edgeContexts_ and edgeSchema_ when returning all columns

Copy link
Contributor Author

Choose a reason for hiding this comment

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

edgeContexts_ and edgeSchema_ are used to store related edgeType, so we can check if we need to scan this edge

@nebula-community-bot
Copy link
Member

Unit testing passed.

@nebula-community-bot
Copy link
Member

Unit testing passed.

@nebula-community-bot
Copy link
Member

Unit testing passed.

@nebula-community-bot
Copy link
Member

Unit testing passed.

@nebula-community-bot
Copy link
Member

Unit testing passed.

src/kvstore/NebulaStore.cpp Show resolved Hide resolved
src/storage/query/ScanEdgeProcessor.cpp Outdated Show resolved Hide resolved
@nebula-community-bot
Copy link
Member

Unit testing passed.

@@ -185,6 +185,12 @@ class NebulaKeyUtils final {
return readInt<EdgeRanking>(rawKey.data() + offset, sizeof(EdgeRanking));
}

static int64_t getVersion(const folly::StringPiece& rawKey) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it better to use a macro definition instead of int64_t? like VertexID, EdgeRanking

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We use int64_t as timestamp for now, maybe we can unify them with a macro later in another PR, WDYT?

Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry, I just found out that the macro has already existed.
Using SchemaVer

Copy link
Contributor

Choose a reason for hiding this comment

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

I thought about it later, SchemaVer is used in tag or edge schema to indicate version. Should we define a DataVer to indicate the version of tag or edge data?

std::string cursor = "";
int32_t rowCount = 0, expectRowCount = 100;
checkResponse(partId, resp, cursor, rowCount, expectRowCount, 0, false, true);
EXPECT_EQ(rowCount, 100);
Copy link
Contributor

Choose a reason for hiding this comment

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

For edges, when no output column attributes are specified. What is output?
Does it output the following four fields:_src, _rank, _dst, _type?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We only return the key, aka, src, type and dst (we don't return rank for now)

@nebula-community-bot
Copy link
Member

Unit testing passed.

auto f = processor->getFuture();
processor->process(req);
auto resp = std::move(f).get();
++batchCount;
Copy link
Contributor

Choose a reason for hiding this comment

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

batchCount is not used.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Never mind, we have count the total rows returned

src/storage/test/ScanEdgeTest.cpp Show resolved Hide resolved
src/storage/test/ScanEdgeTest.cpp Show resolved Hide resolved
src/storage/test/ScanVertexTest.cpp Show resolved Hide resolved
src/storage/test/ScanVertexTest.cpp Show resolved Hide resolved
src/storage/test/ScanVertexTest.cpp Show resolved Hide resolved
Copy link
Contributor

@dangleptr dangleptr left a comment

Choose a reason for hiding this comment

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

Well done. LGTM now

Copy link
Contributor

@panda-sheep panda-sheep left a comment

Choose a reason for hiding this comment

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

Woohoo,brilliant!

@dangleptr dangleptr merged commit 9222944 into vesoft-inc:master Jan 10, 2020
@critical27 critical27 deleted the scan branch January 10, 2020 02:08
tong-hao pushed a commit to tong-hao/nebula that referenced this pull request Jun 1, 2021
* add scan edge/vertex, rebased

* refactor scan edge/vertex

* address @panda-sheep's comments

Co-authored-by: dangleptr <37216992+dangleptr@users.noreply.github.com>
yixinglu pushed a commit to yixinglu/nebula that referenced this pull request Jan 31, 2023
Co-authored-by: jimingquan <mingquan.ji@vesoft.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.

9 participants