Fix compilation issues of the merge

This commit is contained in:
Kostas Kyrimis 2022-11-28 13:38:12 +02:00
parent 0f34c49e21
commit ed0b67dfdb
4 changed files with 14 additions and 16 deletions

View File

@ -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);
};

View File

@ -838,14 +838,14 @@ cpp<#
:slk-load (slk-load-ast-vector "Expression"))
(function-name "std::string" :scope :public)
(function "std::function<TypedValue(const TypedValue *, int64_t,
const functions::FunctionContext<msgs::ShardRequestManagerInterface> &)>"
const functions::FunctionContext<ShardRequestManagerInterface> &)>"
:scope :public
:dont-save t
:clone :copy
:slk-load (lambda (member)
#>cpp
self->${member} = functions::NameToFunction<TypedValue,
functions::FunctionContext<msgs::ShardRequestManagerInterface>,
functions::FunctionContext<ShardRequestManagerInterface>,
functions::QueryEngineTag, decltype(ValueToTypedValueFunctor)>(self->function_name_);
cpp<#)))
(:public
@ -869,7 +869,7 @@ cpp<#
const std::vector<Expression *> &arguments)
: arguments_(arguments),
function_name_(function_name),
function_(functions::NameToFunction<TypedValue, functions::FunctionContext<msgs::ShardRequestManagerInterface>,
function_(functions::NameToFunction<TypedValue, functions::FunctionContext<ShardRequestManagerInterface>,
functions::QueryEngineTag, decltype(ValueToTypedValueFunctor)>(function_name_)) {
if (!function_) {
throw SemanticException("Function '{}' doesn't exist.", function_name);

View File

@ -131,8 +131,8 @@ class ShardRequestManagerInterface {
virtual std::optional<storage::v3::PropertyId> MaybeNameToProperty(const std::string &name) const = 0;
virtual std::optional<storage::v3::EdgeTypeId> MaybeNameToEdgeType(const std::string &name) const = 0;
virtual std::optional<storage::v3::LabelId> 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

View File

@ -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<VertexAccessor> Request(
memgraph::msgs::ExecutionState<memgraph::msgs::ScanVerticesRequest> &state) override {
std::vector<VertexAccessor> Request(ExecutionState<memgraph::msgs::ScanVerticesRequest> &state) override {
return {};
}
std::vector<CreateVerticesResponse> Request(memgraph::msgs::ExecutionState<CreateVerticesRequest> &state,
std::vector<CreateVerticesResponse> Request(ExecutionState<CreateVerticesRequest> &state,
std::vector<memgraph::msgs::NewVertex> new_vertices) override {
return {};
}
std::vector<ExpandOneResultRow> Request(memgraph::msgs::ExecutionState<ExpandOneRequest> &state,
ExpandOneRequest request) override {
std::vector<ExpandOneResultRow> Request(ExecutionState<ExpandOneRequest> &state, ExpandOneRequest request) override {
return {};
}
std::vector<CreateExpandResponse> Request(memgraph::msgs::ExecutionState<CreateExpandRequest> &state,
std::vector<CreateExpandResponse> Request(ExecutionState<CreateExpandRequest> &state,
std::vector<NewExpand> new_edges) override {
return {};
}
@ -218,7 +216,7 @@ class ExpressionEvaluatorTest : public ::testing::Test {
SymbolTable symbol_table;
Frame frame{128};
std::unique_ptr<memgraph::msgs::ShardRequestManagerInterface> shard_manager =
std::unique_ptr<ShardRequestManagerInterface> shard_manager =
std::make_unique<MockedShardRequestManager>(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<std::pair<PropertyId, Value>> 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<std::pair<PropertyId, Value>> props,
const memgraph::msgs::ShardRequestManagerInterface *manager) {
const ShardRequestManagerInterface *manager) {
auto edge = Edge{.src = VertexId{{}, {}},
.dst = VertexId{{}, {}},
.properties = std::move(props),