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

Support Index Operations #1459

Merged
merged 6 commits into from
Jan 6, 2020
Merged

Support Index Operations #1459

merged 6 commits into from
Jan 6, 2020

Conversation

darionyaphet
Copy link
Contributor

No description provided.

@jude-zhu
Copy link
Contributor

Jenkins go

@nebula-community-bot
Copy link
Member

Unit testing failed.

src/graph/DeleteEdgesExecutor.cpp Outdated Show resolved Hide resolved
src/graph/DeleteVertexExecutor.cpp Outdated Show resolved Hide resolved
src/meta/client/MetaClient.cpp Outdated Show resolved Hide resolved
src/meta/client/MetaClient.cpp Outdated Show resolved Hide resolved
auto items = std::move(resp).value();
resp_ = std::make_unique<cpp2::ExecutionResponse>();
std::vector<cpp2::RowValue> rows;
std::vector<std::string> header{"Index ID", "Name"};
Copy link
Contributor

Choose a reason for hiding this comment

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

The Index ID should not be known to the user, modify to TagName, WDYT?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

actually it's the index's name :)

src/graph/ShowExecutor.cpp Outdated Show resolved Hide resolved
@nebula-community-bot
Copy link
Member

Unit testing passed.

@bright-starry-sky
Copy link
Contributor

Please resolve the conflicts, thanks.

}

auto *mc = ectx()->getMetaClient();
auto *name = sentence_->indexName();
Copy link
Contributor

Choose a reason for hiding this comment

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

const is better?

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 don't know what's the practical use ?

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't know what's the practical use ?
Actually it's just my code like, here's what I think :
Reason 1 : The method sentence_->indexName() return value is a const string *.
Reason 2 : This value is an immutable constant.

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 the index name is immutable. The compiler maybe have some optimization for the const auto* .

src/graph/CreateEdgeIndexExecutor.cpp Outdated Show resolved Hide resolved
src/graph/CreateEdgeIndexExecutor.cpp Show resolved Hide resolved
src/graph/CreateEdgeIndexExecutor.cpp Outdated Show resolved Hide resolved
src/graph/CreateEdgeIndexExecutor.h Outdated Show resolved Hide resolved
src/graph/CreateTagIndexExecutor.cpp Show resolved Hide resolved
src/graph/CreateTagIndexExecutor.cpp Outdated Show resolved Hide resolved
src/graph/DeleteEdgesExecutor.cpp Show resolved Hide resolved
src/graph/DeleteVertexExecutor.cpp Show resolved Hide resolved
src/graph/DescribeEdgeIndexExecutor.cpp Show resolved Hide resolved
src/graph/DescribeTagIndexExecutor.cpp Show resolved Hide resolved
src/graph/DropEdgeIndexExecutor.cpp Show resolved Hide resolved
src/graph/DropTagIndexExecutor.cpp Show resolved Hide resolved
src/graph/RebuildEdgeIndexExecutor.cpp Outdated Show resolved Hide resolved
src/graph/SchemaHelper.cpp Show resolved Hide resolved
src/graph/ShowExecutor.cpp Show resolved Hide resolved
src/graph/ShowExecutor.cpp Show resolved Hide resolved
auto cb = [this] (auto &&resp) {
if (!resp.ok()) {
DCHECK(onError_);
onError_(std::move(resp).status());
Copy link
Contributor

Choose a reason for hiding this comment

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

std::forward

Copy link
Contributor Author

Choose a reason for hiding this comment

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

std::move takes an object and allows you to treat it as a temporary.

std::forward has a single use case: to cast a templated function parameter to the value category the caller used to pass it.

When the parameter is an rvalue, they are treated are the same.

src/graph/ShowExecutor.cpp Show resolved Hide resolved
src/graph/ShowExecutor.cpp Show resolved Hide resolved
src/parser/MaintainSentences.cpp Show resolved Hide resolved
src/parser/MaintainSentences.h Outdated Show resolved Hide resolved
src/parser/MaintainSentences.h Outdated Show resolved Hide resolved
src/parser/parser.yy Show resolved Hide resolved
src/parser/parser.yy Show resolved Hide resolved
src/parser/parser.yy Show resolved Hide resolved
src/parser/parser.yy Show resolved Hide resolved
src/parser/parser.yy Show resolved Hide resolved
@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 passed.

Conflicts:
	src/graph/SchemaHelper.cpp
	src/parser/parser.yy
@nebula-community-bot
Copy link
Member

Unit testing passed.

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

Unit testing passed.

properties.emplace(std::move(edgeName), std::move(fields));
return createEdgeIndex(spaceID,
std::move(indexName),
std::move(properties),
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 support create index on multi fields? It seems storage only support index on first field?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

actually I have update to single schema in another PR

}


void DescribeEdgeIndexExecutor::execute() {
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 need desc for index, show index is enough?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

SHOW TAG/EDGE INDEXES will display an index list.

@Amber1990Zhang Amber1990Zhang mentioned this pull request Jan 2, 2020
@nebula-community-bot
Copy link
Member

Unit testing passed.

return edgeName_.get();
}

std::vector<std::string> names() const {
Copy link
Contributor

Choose a reason for hiding this comment

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

naming columns is better?

src/parser/scanner.lex Outdated Show resolved Hide resolved
@nebula-community-bot
Copy link
Member

Unit testing failed.

@nebula-community-bot
Copy link
Member

Unit testing passed.

@darionyaphet
Copy link
Contributor Author

Reference document : #1578

@darionyaphet darionyaphet changed the title Support index in query layer Support Index Operations Jan 6, 2020
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. The pr lgtm

Copy link
Contributor

@liuyu85cn liuyu85cn left a comment

Choose a reason for hiding this comment

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

LGTM

@nebula-community-bot
Copy link
Member

Unit testing passed.

@dutor dutor merged commit 59f90ba into vesoft-inc:master Jan 6, 2020
@nebula-community-bot
Copy link
Member

Unit testing passed.

@jude-zhu
Copy link
Contributor

close #470

@jude-zhu
Copy link
Contributor

jude-zhu commented Feb 13, 2020

relate to #463

tong-hao pushed a commit to tong-hao/nebula that referenced this pull request Jun 1, 2021
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.

None yet

9 participants