diff --git a/src/query/plan/operator.cpp b/src/query/plan/operator.cpp index 85e7472a5..220af4dd3 100644 --- a/src/query/plan/operator.cpp +++ b/src/query/plan/operator.cpp @@ -2733,18 +2733,16 @@ std::unique_ptr ProduceRemote::MakeCursor( } PullRemote::PullRemote(const std::shared_ptr &input, - int64_t plan_id, const std::vector &symbols, - bool pull_local) - : input_(input ? input : std::make_shared()), - plan_id_(plan_id), - symbols_(symbols), - pull_local_(pull_local) {} + int64_t plan_id, const std::vector &symbols) + : input_(input), plan_id_(plan_id), symbols_(symbols) {} ACCEPT_WITH_INPUT(PullRemote); PullRemote::PullRemoteCursor::PullRemoteCursor(const PullRemote &self, database::GraphDbAccessor &db) - : self_(self), db_(db), input_cursor_(self.input_->MakeCursor(db)) { + : self_(self), + db_(db), + input_cursor_(self.input_ ? self.input_->MakeCursor(db) : nullptr) { worker_ids_ = db_.db().remote_pull_clients().GetWorkerIds(); // Remove master from the worker ids list. worker_ids_.erase(std::find(worker_ids_.begin(), worker_ids_.end(), 0)); @@ -2842,7 +2840,7 @@ bool PullRemote::PullRemoteCursor::Pull(Frame &frame, Context &context) { // If there are no remote results available, pull and return local // results. - if (self_.pull_local() && input_cursor_->Pull(frame, context)) { + if (input_cursor_ && input_cursor_->Pull(frame, context)) { return true; } } @@ -2850,7 +2848,7 @@ bool PullRemote::PullRemoteCursor::Pull(Frame &frame, Context &context) { // No more remote results, make sure local results get exhausted. if (!have_remote_results) { - if (self_.pull_local() && input_cursor_->Pull(frame, context)) { + if (input_cursor_ && input_cursor_->Pull(frame, context)) { return true; } return false; diff --git a/src/query/plan/operator.hpp b/src/query/plan/operator.hpp index e51544bee..7f15b92f0 100644 --- a/src/query/plan/operator.hpp +++ b/src/query/plan/operator.hpp @@ -2297,7 +2297,7 @@ class ProduceRemote : public LogicalOperator { class PullRemote : public LogicalOperator { public: PullRemote(const std::shared_ptr &input, int64_t plan_id, - const std::vector &symbols, bool pull_local = true); + const std::vector &symbols); bool Accept(HierarchicalLogicalOperatorVisitor &visitor) override; std::unique_ptr MakeCursor( database::GraphDbAccessor &db) const override; @@ -2307,13 +2307,11 @@ class PullRemote : public LogicalOperator { } const auto &symbols() const { return symbols_; } auto plan_id() const { return plan_id_; } - auto pull_local() const { return pull_local_; } private: std::shared_ptr input_; int64_t plan_id_ = 0; std::vector symbols_; - bool pull_local_ = true; PullRemote() {} @@ -2345,7 +2343,6 @@ class PullRemote : public LogicalOperator { ar &input_; ar &plan_id_; ar &symbols_; - ar &pull_local_; } };