From ed0b67dfdb6d0a6449f48089042b5c0fb565af3d Mon Sep 17 00:00:00 2001 From: Kostas Kyrimis Date: Mon, 28 Nov 2022 13:38:12 +0200 Subject: [PATCH] Fix compilation issues of the merge --- src/query/v2/conversions.hpp | 2 +- src/query/v2/frontend/ast/ast.lcp | 6 +++--- src/query/v2/shard_request_manager.hpp | 4 ++-- tests/unit/query_v2_expression_evaluator.cpp | 18 ++++++++---------- 4 files changed, 14 insertions(+), 16 deletions(-) diff --git a/src/query/v2/conversions.hpp b/src/query/v2/conversions.hpp index baeaf90d5..a1db5ed17 100644 --- a/src/query/v2/conversions.hpp +++ b/src/query/v2/conversions.hpp @@ -56,7 +56,7 @@ inline TypedValue ValueToTypedValue(const msgs::Value &value, ShardRequestManage throw std::runtime_error("Incorrect type in conversion"); } -inline const auto ValueToTypedValueFunctor = [](const msgs::Value &value, msgs::ShardRequestManagerInterface *manager) { +inline const auto ValueToTypedValueFunctor = [](const msgs::Value &value, ShardRequestManagerInterface *manager) { return ValueToTypedValue(value, manager); }; diff --git a/src/query/v2/frontend/ast/ast.lcp b/src/query/v2/frontend/ast/ast.lcp index 209bdfd50..dadcc9fa7 100644 --- a/src/query/v2/frontend/ast/ast.lcp +++ b/src/query/v2/frontend/ast/ast.lcp @@ -838,14 +838,14 @@ cpp<# :slk-load (slk-load-ast-vector "Expression")) (function-name "std::string" :scope :public) (function "std::function &)>" + const functions::FunctionContext &)>" :scope :public :dont-save t :clone :copy :slk-load (lambda (member) #>cpp self->${member} = functions::NameToFunction, + functions::FunctionContext, functions::QueryEngineTag, decltype(ValueToTypedValueFunctor)>(self->function_name_); cpp<#))) (:public @@ -869,7 +869,7 @@ cpp<# const std::vector &arguments) : arguments_(arguments), function_name_(function_name), - function_(functions::NameToFunction, + function_(functions::NameToFunction, functions::QueryEngineTag, decltype(ValueToTypedValueFunctor)>(function_name_)) { if (!function_) { throw SemanticException("Function '{}' doesn't exist.", function_name); diff --git a/src/query/v2/shard_request_manager.hpp b/src/query/v2/shard_request_manager.hpp index 19fb81a08..581dfbcab 100644 --- a/src/query/v2/shard_request_manager.hpp +++ b/src/query/v2/shard_request_manager.hpp @@ -131,8 +131,8 @@ class ShardRequestManagerInterface { virtual std::optional MaybeNameToProperty(const std::string &name) const = 0; virtual std::optional MaybeNameToEdgeType(const std::string &name) const = 0; virtual std::optional MaybeNameToLabel(const std::string &name) const = 0; - virtual bool IsPrimaryLabel(LabelId label) const = 0; - virtual bool IsPrimaryKey(LabelId primary_label, PropertyId property) const = 0; + virtual bool IsPrimaryLabel(storage::v3::LabelId label) const = 0; + virtual bool IsPrimaryKey(storage::v3::LabelId primary_label, storage::v3::PropertyId property) const = 0; }; // TODO(kostasrim)rename this class template diff --git a/tests/unit/query_v2_expression_evaluator.cpp b/tests/unit/query_v2_expression_evaluator.cpp index de324ea2b..c2e0beee7 100644 --- a/tests/unit/query_v2_expression_evaluator.cpp +++ b/tests/unit/query_v2_expression_evaluator.cpp @@ -66,7 +66,7 @@ using memgraph::functions::FunctionRuntimeException; namespace memgraph::query::v2::tests { -class MockedShardRequestManager : public memgraph::msgs::ShardRequestManagerInterface { +class MockedShardRequestManager : public ShardRequestManagerInterface { public: using VertexAccessor = accessors::VertexAccessor; explicit MockedShardRequestManager(ShardMap shard_map) : shards_map_(std::move(shard_map)) { SetUpNameIdMappers(); } @@ -83,22 +83,20 @@ class MockedShardRequestManager : public memgraph::msgs::ShardRequestManagerInte } void StartTransaction() override {} void Commit() override {} - std::vector Request( - memgraph::msgs::ExecutionState &state) override { + std::vector Request(ExecutionState &state) override { return {}; } - std::vector Request(memgraph::msgs::ExecutionState &state, + std::vector Request(ExecutionState &state, std::vector new_vertices) override { return {}; } - std::vector Request(memgraph::msgs::ExecutionState &state, - ExpandOneRequest request) override { + std::vector Request(ExecutionState &state, ExpandOneRequest request) override { return {}; } - std::vector Request(memgraph::msgs::ExecutionState &state, + std::vector Request(ExecutionState &state, std::vector new_edges) override { return {}; } @@ -218,7 +216,7 @@ class ExpressionEvaluatorTest : public ::testing::Test { SymbolTable symbol_table; Frame frame{128}; - std::unique_ptr shard_manager = + std::unique_ptr shard_manager = std::make_unique(CreateDummyShardmap()); ExpressionEvaluator eval{&frame, symbol_table, ctx, shard_manager.get(), memgraph::storage::v3::View::OLD}; @@ -546,13 +544,13 @@ using VertexId = memgraph::msgs::VertexId; using Label = memgraph::msgs::Label; accessors::VertexAccessor CreateVertex(std::vector> props, - const memgraph::msgs::ShardRequestManagerInterface *manager, Label label = {}) { + const ShardRequestManagerInterface *manager, Label label = {}) { static int64_t id = 0; return {Vertex{VertexId{label, {memgraph::msgs::Value(id++)}}, {label}}, std::move(props), manager}; } accessors::EdgeAccessor CreateEdge(std::vector> props, - const memgraph::msgs::ShardRequestManagerInterface *manager) { + const ShardRequestManagerInterface *manager) { auto edge = Edge{.src = VertexId{{}, {}}, .dst = VertexId{{}, {}}, .properties = std::move(props),