Skip to content

Commit

Permalink
Fix the check of query plan nodes (#5330)
Browse files Browse the repository at this point in the history
* Fix the check of query plan node

* Cleanup Response movable functions
  • Loading branch information
yixinglu authored Feb 10, 2023
1 parent c30f52b commit 6bc7c1f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 37 deletions.
36 changes: 3 additions & 33 deletions src/common/graph/Response.h
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,7 @@ struct AuthResponse {
struct ProfilingStats {
ProfilingStats() = default;
ProfilingStats(ProfilingStats &&) = default;
ProfilingStats &operator=(ProfilingStats &&rhs) = default;

void __clear() {
rows = 0;
Expand All @@ -267,14 +268,6 @@ struct ProfilingStats {
__clear();
}

auto &operator=(ProfilingStats &&rhs) {
this->rows = rhs.rows;
this->execDurationInUs = rhs.execDurationInUs;
this->totalDurationInUs = rhs.totalDurationInUs;
this->otherStats = std::move(rhs.otherStats);
return *this;
}

bool operator==(const ProfilingStats &rhs) const {
if (rows != rhs.rows) {
return false;
Expand Down Expand Up @@ -321,12 +314,6 @@ struct PlanNodeBranchInfo {
__clear();
}

auto &operator=(const PlanNodeBranchInfo &rhs) {
this->isDoBranch = rhs.isDoBranch;
this->conditionNodeId = rhs.conditionNodeId;
return *this;
}

bool operator==(const PlanNodeBranchInfo &rhs) const {
return isDoBranch == rhs.isDoBranch && conditionNodeId == rhs.conditionNodeId;
}
Expand Down Expand Up @@ -371,6 +358,7 @@ struct Pair {
struct PlanNodeDescription {
PlanNodeDescription() = default;
PlanNodeDescription(PlanNodeDescription &&) = default;
PlanNodeDescription &operator=(PlanNodeDescription &&rhs) = default;

void __clear() {
name.clear();
Expand All @@ -386,17 +374,6 @@ struct PlanNodeDescription {
__clear();
}

auto &operator=(PlanNodeDescription &&rhs) {
this->name = std::move(rhs.name);
this->id = rhs.id;
this->outputVar = std::move(rhs.outputVar);
this->description = std::move(rhs.description);
this->profiles = std::move(rhs.profiles);
this->branchInfo = std::move(rhs.branchInfo);
this->dependencies = std::move(rhs.dependencies);
return *this;
}

bool operator==(const PlanNodeDescription &rhs) const;

std::string name;
Expand Down Expand Up @@ -447,6 +424,7 @@ struct PlanNodeDescription {
struct PlanDescription {
PlanDescription() = default;
PlanDescription(PlanDescription &&rhs) = default;
PlanDescription &operator=(PlanDescription &&rhs) = default;

void __clear() {
planNodeDescs.clear();
Expand All @@ -459,14 +437,6 @@ struct PlanDescription {
__clear();
}

auto &operator=(PlanDescription &&rhs) {
this->planNodeDescs = std::move(rhs.planNodeDescs);
this->nodeIndexMap = std::move(rhs.nodeIndexMap);
this->format = std::move(rhs.format);
this->optimize_time_in_us = rhs.optimize_time_in_us;
return *this;
}

bool operator==(const PlanDescription &rhs) const {
return planNodeDescs == rhs.planNodeDescs && nodeIndexMap == rhs.nodeIndexMap &&
format == rhs.format;
Expand Down
7 changes: 3 additions & 4 deletions src/graph/planner/plan/PlanNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ class PlanNode {
kGetNeighbors,
kGetVertices,
kGetEdges,
kGetDstBySrc,
kTraverse,
kAppendVertices,
kShortestPath,
Expand Down Expand Up @@ -74,10 +75,10 @@ class PlanNode {
kArgument,

// Logic
kStart,
kSelect,
kLoop,
kPassThrough,
kStart,

// schema related
kCreateSpace,
Expand Down Expand Up @@ -183,12 +184,10 @@ class PlanNode {

kShowQueries,
kKillQuery,

kGetDstBySrc,
};

bool isQueryNode() const {
return kind_ < Kind::kStart;
return kind_ <= Kind::kStart;
}

// Describe plan node
Expand Down

0 comments on commit 6bc7c1f

Please sign in to comment.