-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Scan multiple parts. * Add multiple parts test case. * Add limit test. * Remove unused include. * Support multiple tags. * Fix license header. * Optimize the extra read operations. * Fix compile error. * Skip invalid tag in one loop. * Avoid extra logical. * Add scan executors. * Add scan entry of match. * Format. * Push filter down to ScanVertices. * Push filter over AppendVertices. * Remove unused code. * Support push limit down to scan vertices. * Fix vfilter push down. * Transforme traverse to get edges. * Push limit to scan edges. * Check limit for scan. * Revert test cases. * Resolve conflict. * Remove redundant line. Co-authored-by: cpw <13495049+CPWstatic@users.noreply.github.com>
- Loading branch information
1 parent
7c4e372
commit bc1aac6
Showing
51 changed files
with
1,724 additions
and
132 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/* Copyright (c) 2021 vesoft inc. All rights reserved. | ||
* | ||
* This source code is licensed under Apache 2.0 License. | ||
*/ | ||
|
||
#include "graph/executor/query/ScanEdgesExecutor.h" | ||
|
||
#include "common/time/ScopedTimer.h" | ||
#include "graph/context/QueryContext.h" | ||
#include "graph/planner/plan/Query.h" | ||
#include "graph/util/SchemaUtil.h" | ||
|
||
using nebula::storage::StorageClient; | ||
using nebula::storage::StorageRpcResponse; | ||
using nebula::storage::cpp2::ScanResponse; | ||
|
||
namespace nebula { | ||
namespace graph { | ||
|
||
folly::Future<Status> ScanEdgesExecutor::execute() { return scanEdges(); } | ||
|
||
folly::Future<Status> ScanEdgesExecutor::scanEdges() { | ||
SCOPED_TIMER(&execTime_); | ||
StorageClient *client = qctx()->getStorageClient(); | ||
auto *se = asNode<ScanEdges>(node()); | ||
if (se->limit() < 0) { | ||
return Status::Error("Scan edges must specify limit number."); | ||
} | ||
|
||
time::Duration scanEdgesTime; | ||
StorageClient::CommonRequestParam param(se->space(), | ||
qctx()->rctx()->session()->id(), | ||
qctx()->plan()->id(), | ||
qctx()->plan()->isProfileEnabled()); | ||
return DCHECK_NOTNULL(client) | ||
->scanEdge(param, *DCHECK_NOTNULL(se->props()), se->limit(), se->filter()) | ||
.via(runner()) | ||
.ensure([this, scanEdgesTime]() { | ||
SCOPED_TIMER(&execTime_); | ||
otherStats_.emplace("total_rpc", folly::sformat("{}(us)", scanEdgesTime.elapsedInUSec())); | ||
}) | ||
.thenValue([this, se](StorageRpcResponse<ScanResponse> &&rpcResp) { | ||
SCOPED_TIMER(&execTime_); | ||
addStats(rpcResp, otherStats_); | ||
return handleResp(std::move(rpcResp), se->colNames()); | ||
}); | ||
} | ||
|
||
} // namespace graph | ||
} // namespace nebula |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/* Copyright (c) 2021 vesoft inc. All rights reserved. | ||
* | ||
* This source code is licensed under Apache 2.0 License. | ||
*/ | ||
|
||
#include "graph/executor/query/GetPropExecutor.h" | ||
|
||
namespace nebula { | ||
namespace graph { | ||
class ScanEdgesExecutor final : public GetPropExecutor { | ||
public: | ||
ScanEdgesExecutor(const PlanNode *node, QueryContext *qctx) | ||
: GetPropExecutor("ScanEdgesExecutor", node, qctx) {} | ||
|
||
folly::Future<Status> execute() override; | ||
|
||
private: | ||
folly::Future<Status> scanEdges(); | ||
}; | ||
|
||
} // namespace graph | ||
} // namespace nebula |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/* Copyright (c) 2021 vesoft inc. All rights reserved. | ||
* | ||
* This source code is licensed under Apache 2.0 License. | ||
*/ | ||
|
||
#include "graph/executor/query/ScanVerticesExecutor.h" | ||
|
||
#include "common/time/ScopedTimer.h" | ||
#include "graph/context/QueryContext.h" | ||
#include "graph/util/SchemaUtil.h" | ||
|
||
using nebula::storage::StorageClient; | ||
using nebula::storage::StorageRpcResponse; | ||
using nebula::storage::cpp2::ScanResponse; | ||
|
||
namespace nebula { | ||
namespace graph { | ||
|
||
folly::Future<Status> ScanVerticesExecutor::execute() { return scanVertices(); } | ||
|
||
folly::Future<Status> ScanVerticesExecutor::scanVertices() { | ||
SCOPED_TIMER(&execTime_); | ||
|
||
auto *sv = asNode<ScanVertices>(node()); | ||
if (sv->limit() < 0) { | ||
return Status::Error("Scan vertices must specify limit number."); | ||
} | ||
StorageClient *storageClient = qctx()->getStorageClient(); | ||
|
||
time::Duration scanVertexTime; | ||
StorageClient::CommonRequestParam param(sv->space(), | ||
qctx()->rctx()->session()->id(), | ||
qctx()->plan()->id(), | ||
qctx()->plan()->isProfileEnabled()); | ||
return DCHECK_NOTNULL(storageClient) | ||
->scanVertex(param, *DCHECK_NOTNULL(sv->props()), sv->limit(), sv->filter()) | ||
.via(runner()) | ||
.ensure([this, scanVertexTime]() { | ||
SCOPED_TIMER(&execTime_); | ||
otherStats_.emplace("total_rpc", folly::sformat("{}(us)", scanVertexTime.elapsedInUSec())); | ||
}) | ||
.thenValue([this, sv](StorageRpcResponse<ScanResponse> &&rpcResp) { | ||
SCOPED_TIMER(&execTime_); | ||
addStats(rpcResp, otherStats_); | ||
return handleResp(std::move(rpcResp), sv->colNames()); | ||
}); | ||
} | ||
|
||
} // namespace graph | ||
} // namespace nebula |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/* Copyright (c) 2021 vesoft inc. All rights reserved. | ||
* | ||
* This source code is licensed under Apache 2.0 License. | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include "graph/executor/query/GetPropExecutor.h" | ||
#include "graph/planner/plan/Query.h" | ||
|
||
namespace nebula { | ||
namespace graph { | ||
|
||
class ScanVerticesExecutor final : public GetPropExecutor { | ||
public: | ||
ScanVerticesExecutor(const PlanNode *node, QueryContext *qctx) | ||
: GetPropExecutor("ScanVerticesExecutor", node, qctx) {} | ||
|
||
folly::Future<Status> execute() override; | ||
|
||
private: | ||
folly::Future<Status> scanVertices(); | ||
}; | ||
|
||
} // namespace graph | ||
} // namespace nebula |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.