From 7e99f32adb080bea62149d4ec200a5b7ea479236 Mon Sep 17 00:00:00 2001 From: gvolfing Date: Mon, 6 Feb 2023 15:47:18 +0100 Subject: [PATCH] Remove uncommented, useless code --- src/query/v2/interpreter.cpp | 3 +-- src/query/v2/plan/operator.cpp | 37 +--------------------------------- 2 files changed, 2 insertions(+), 38 deletions(-) diff --git a/src/query/v2/interpreter.cpp b/src/query/v2/interpreter.cpp index 40c3fced4..aa220d764 100644 --- a/src/query/v2/interpreter.cpp +++ b/src/query/v2/interpreter.cpp @@ -812,8 +812,7 @@ std::optional PullPlan::PullMultiple(AnyStrea std::optional PullPlan::Pull(AnyStream *stream, std::optional n, const std::vector &output_symbols, std::map *summary) { - // auto should_pull_multiple = false; // TODO on the long term, we will only use PullMultiple - auto should_pull_multiple = false; + auto should_pull_multiple = false; // TODO on the long term, we will only use PullMultiple if (should_pull_multiple) { return PullMultiple(stream, n, output_symbols, summary); } diff --git a/src/query/v2/plan/operator.cpp b/src/query/v2/plan/operator.cpp index 5397d6735..beca89b13 100644 --- a/src/query/v2/plan/operator.cpp +++ b/src/query/v2/plan/operator.cpp @@ -761,7 +761,7 @@ class DistributedScanByPrimaryKeyCursor : public Cursor { output_frame[output_symbol_] = TypedValue(it->second); populated_any = true; ++output_frame_it; - } + } own_frames_it_->MakeInvalid(); } break; @@ -1350,19 +1350,6 @@ bool IsExpansionOk(Frame &frame, const Symbol &expand_symbol, const std::vector< bool EdgeUniquenessFilter::EdgeUniquenessFilterCursor::Pull(Frame &frame, ExecutionContext &context) { SCOPED_PROFILE_OP("EdgeUniquenessFilter"); - // // TODO (gvolfing) Make the simple Pull method use the function instead of the lambda as well. - // auto expansion_ok = [&]() { - // const auto &expand_value = frame[self_.expand_symbol_]; - // for (const auto &previous_symbol : self_.previous_symbols_) { - // const auto &previous_value = frame[previous_symbol]; - // // This shouldn't raise a TypedValueException, because the planner - // // makes sure these are all of the expected type. In case they are not - // // an error should be raised long before this code is executed. - // if (ContainsSameEdge(previous_value, expand_value)) return false; - // } - // return true; - // }; - while (input_cursor_->Pull(frame, context)) if (IsExpansionOk(frame, self_.expand_symbol_, self_.previous_symbols_)) return true; return false; @@ -1422,28 +1409,6 @@ bool EdgeUniquenessFilter::EdgeUniquenessFilterCursor::PullMultiple(MultiFrame & own_frames_it_->MakeInvalid(); } ++output_frame_it; - - ///////////////////////////////////////////////// - /* - ExpressionEvaluator evaluator(&*own_frames_it_, context.symbol_table, context.evaluation_context, - context.request_router, storage::v3::View::NEW); - - std::vector pk; - for (auto *primary_property : primary_key_) { - pk.push_back(TypedValueToValue(primary_property->Accept(evaluator))); - } - - const msgs::Label label = {.id = msgs::LabelId::FromUint(label_.AsUint())}; - auto vertex_id = std::make_pair(label, std::move(pk)); - - if (const auto it = id_to_accessor_mapping_.find(vertex_id); it != id_to_accessor_mapping_.end()) { - output_frame = *own_frames_it_; - output_frame[output_symbol_] = TypedValue(it->second); - populated_any = true; - ++output_frame_it; - } - own_frames_it_->MakeInvalid(); - */ } break; }