From 544c75c212f8bcac954406c45c1cdfaead8e4b61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A1nos=20Benjamin=20Antal?= Date: Fri, 20 Jan 2023 23:04:33 +0100 Subject: [PATCH] Add explanation about limitations of current implementation --- src/query/v2/plan/operator.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/query/v2/plan/operator.cpp b/src/query/v2/plan/operator.cpp index 4461ab580..ad91da728 100644 --- a/src/query/v2/plan/operator.cpp +++ b/src/query/v2/plan/operator.cpp @@ -2841,14 +2841,19 @@ class DistributedExpandCursor : public Cursor { } void InitEdgesMultiple(ExecutionContext &context) { - TypedValue &vertex_value = (*own_frames_it_)[self_.input_symbol_]; + // This function won't work if any vertex id is duplicated in the input, because: + // 1. vertex_id_to_result_row is not a multimap + // 2. if self_.common_.existing_node is true, then we erase edges that might be necessary for the input vertex on a + // later frame + const auto &frame = (*own_frames_it_); + const auto &vertex_value = frame[self_.input_symbol_]; if (vertex_value.IsNull()) { return; } ExpectType(self_.input_symbol_, vertex_value, TypedValue::Type::Vertex); - auto &vertex = vertex_value.ValueVertex(); + const auto &vertex = vertex_value.ValueVertex(); const auto convert_edges = [&vertex, &context]( std::vector &&edge_messages,