Skip to content

Commit

Permalink
lint: clang-format
Browse files Browse the repository at this point in the history
  • Loading branch information
wey-gu committed May 27, 2022
1 parent 5945619 commit 475cf80
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 19 deletions.
29 changes: 17 additions & 12 deletions src/graph/optimizer/rule/GetEdgesTransformLimitRule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,13 @@ GetEdgesTransformLimitRule::GetEdgesTransformLimitRule() {
}

const Pattern &GetEdgesTransformLimitRule::pattern() const {
static Pattern pattern =
Pattern::create(PlanNode::Kind::kProject,
{Pattern::create(PlanNode::Kind::kLimit,
{Pattern::create(PlanNode::Kind::kAppendVertices,
{Pattern::create(PlanNode::Kind::kTraverse,
{Pattern::create(PlanNode::Kind::kScanVertices)})})})});
static Pattern pattern = Pattern::create(
PlanNode::Kind::kProject,
{Pattern::create(
PlanNode::Kind::kLimit,
{Pattern::create(PlanNode::Kind::kAppendVertices,
{Pattern::create(PlanNode::Kind::kTraverse,
{Pattern::create(PlanNode::Kind::kScanVertices)})})})});
return pattern;
}

Expand Down Expand Up @@ -85,9 +86,14 @@ StatusOr<OptRule::TransformResult> GetEdgesTransformLimitRule::transform(

auto appendVerticesGroupNode = matched.dependencies.front().dependencies.front().node;
auto appendVertices = static_cast<const AppendVertices *>(appendVerticesGroupNode->node());
auto traverseGroupNode = matched.dependencies.front().dependencies.front().dependencies.front().node;
auto traverseGroupNode =
matched.dependencies.front().dependencies.front().dependencies.front().node;
auto traverse = static_cast<const Traverse *>(traverseGroupNode->node());
auto scanVerticesGroupNode = matched.dependencies.front().dependencies.front().dependencies.front().dependencies.front().node;
auto scanVerticesGroupNode = matched.dependencies.front()
.dependencies.front()
.dependencies.front()
.dependencies.front()
.node;
auto qctx = ctx->qctx();

auto newAppendVertices = appendVertices->clone();
Expand Down Expand Up @@ -130,8 +136,7 @@ std::string GetEdgesTransformLimitRule::toString() const {
}

/*static*/ graph::ScanEdges *GetEdgesTransformLimitRule::traverseToScanEdges(
const graph::Traverse *traverse,
const int64_t limit_count = -1) {
const graph::Traverse *traverse, const int64_t limit_count = -1) {
const auto *edgeProps = traverse->edgeProps();
if (edgeProps == nullptr) {
return nullptr;
Expand Down Expand Up @@ -160,8 +165,8 @@ std::string GetEdgesTransformLimitRule::toString() const {
}

/*static*/ graph::Project *GetEdgesTransformLimitRule::projectEdges(graph::QueryContext *qctx,
PlanNode *input,
const std::string &colName) {
PlanNode *input,
const std::string &colName) {
auto *yieldColumns = qctx->objPool()->makeAndAdd<YieldColumns>();
auto *edgeExpr = EdgeExpression::make(qctx->objPool());
auto *listEdgeExpr = ListExpression::make(qctx->objPool());
Expand Down
3 changes: 2 additions & 1 deletion src/graph/optimizer/rule/GetEdgesTransformLimitRule.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ class GetEdgesTransformLimitRule final : public OptRule {
private:
GetEdgesTransformLimitRule();

static graph::ScanEdges *traverseToScanEdges(const graph::Traverse *traverse, const int64_t limit_count);
static graph::ScanEdges *traverseToScanEdges(const graph::Traverse *traverse,
const int64_t limit_count);

static graph::Project *projectEdges(graph::QueryContext *qctx,
graph::PlanNode *input,
Expand Down
13 changes: 7 additions & 6 deletions src/graph/optimizer/rule/GetEdgesTransformRule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ GetEdgesTransformRule::GetEdgesTransformRule() {
}

const Pattern &GetEdgesTransformRule::pattern() const {
static Pattern pattern =
Pattern::create(PlanNode::Kind::kProject,
{Pattern::create(PlanNode::Kind::kAppendVertices,
{Pattern::create(PlanNode::Kind::kTraverse,
{Pattern::create(PlanNode::Kind::kScanVertices)})})});
static Pattern pattern = Pattern::create(
PlanNode::Kind::kProject,
{Pattern::create(PlanNode::Kind::kAppendVertices,
{Pattern::create(PlanNode::Kind::kTraverse,
{Pattern::create(PlanNode::Kind::kScanVertices)})})});
return pattern;
}

Expand Down Expand Up @@ -77,7 +77,8 @@ StatusOr<OptRule::TransformResult> GetEdgesTransformRule::transform(
auto appendVertices = static_cast<const AppendVertices *>(appendVerticesGroupNode->node());
auto traverseGroupNode = matched.dependencies.front().dependencies.front().node;
auto traverse = static_cast<const Traverse *>(traverseGroupNode->node());
auto scanVerticesGroupNode = matched.dependencies.front().dependencies.front().dependencies.front().node;
auto scanVerticesGroupNode =
matched.dependencies.front().dependencies.front().dependencies.front().node;
auto qctx = ctx->qctx();

auto newAppendVertices = appendVertices->clone();
Expand Down

0 comments on commit 475cf80

Please sign in to comment.