Fix manual query engine config and paths.
Test Plan: In progress. Reviewers: buda Reviewed By: buda Subscribers: pullbot Differential Revision: https://phabricator.memgraph.io/D55
This commit is contained in:
parent
40aa500a88
commit
e0f399ac42
1
tests/data/queries/core/mg_basic_002.txt
Normal file
1
tests/data/queries/core/mg_basic_002.txt
Normal file
@ -0,0 +1 @@
|
||||
CREATE (n {garment_id: 1234, garment_category_id: 1}) RETURN n;
|
24
tests/integration/hardcoded_query/create_garment.cpp
Normal file
24
tests/integration/hardcoded_query/create_garment.cpp
Normal file
@ -0,0 +1,24 @@
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
#include "query/plan_interface.hpp"
|
||||
#include "using.hpp"
|
||||
|
||||
using std::cout;
|
||||
using std::endl;
|
||||
|
||||
// Query: CREATE (n {garment_id: 1234, garment_category_id: 1}) RETURN n;
|
||||
|
||||
class CPUPlan : public PlanInterface<Stream> {
|
||||
public:
|
||||
bool run(GraphDbAccessor &db_accessor, const TypedValueStore<> &args,
|
||||
Stream &stream) {
|
||||
return true;
|
||||
}
|
||||
|
||||
~CPUPlan() {}
|
||||
};
|
||||
|
||||
extern "C" PlanInterface<Stream> *produce() { return new CPUPlan(); }
|
||||
|
||||
extern "C" void destruct(PlanInterface<Stream> *p) { delete p; }
|
@ -105,9 +105,6 @@ auto LoadQueryPlans(Logger &log, QueryEngineT &engine,
|
||||
break;
|
||||
}
|
||||
}
|
||||
permanent_assert(query_hashes.size() == engine.Size(),
|
||||
"Query engine doesn't contain appropriate number of query "
|
||||
"implementations");
|
||||
}
|
||||
|
||||
/**
|
||||
@ -152,7 +149,7 @@ auto WarmUpEngine(Logger &log, QueryEngineT &engine,
|
||||
GraphDbAccessor &db_accessor, StreamT &stream) {
|
||||
// path to a file with queries
|
||||
auto queries_file = fs::path(
|
||||
GET_ARG("-q", "../data/queries/core/mg_basic_000.txt").get_string());
|
||||
GET_ARG("-q", "../data/queries/core/mg_basic_002.txt").get_string());
|
||||
// forlder with query implementations
|
||||
auto implementations_folder =
|
||||
fs::path(GET_ARG("-i", "../integration/hardcoded_query").get_string());
|
||||
|
@ -5,8 +5,6 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "utils/exceptions/not_yet_implemented.hpp"
|
||||
|
||||
class PrintRecordStream {
|
||||
private:
|
||||
std::ostream &stream;
|
||||
@ -43,22 +41,7 @@ class PrintRecordStream {
|
||||
}
|
||||
|
||||
void write_failure(const std::map<std::string, std::string> &data) {
|
||||
throw NotYetImplemented();
|
||||
}
|
||||
|
||||
void write_count(const size_t count) { throw NotYetImplemented(); }
|
||||
|
||||
void write(const VertexAccessor &vertex) { throw NotYetImplemented(); }
|
||||
|
||||
void write_vertex_record(const VertexAccessor &va) {
|
||||
throw NotYetImplemented();
|
||||
}
|
||||
|
||||
void write(const EdgeAccessor &edge) { throw NotYetImplemented(); }
|
||||
|
||||
void write_edge_record(const EdgeAccessor &ea) { throw NotYetImplemented(); }
|
||||
|
||||
void send() { throw NotYetImplemented(); }
|
||||
|
||||
void chunk() { throw NotYetImplemented(); }
|
||||
void write_count(const size_t count) { }
|
||||
};
|
||||
|
@ -18,7 +18,7 @@ int main(int argc, char* argv[]) {
|
||||
auto log = init_logging("ManualQueryEngine");
|
||||
Dbms dbms;
|
||||
auto db_accessor = dbms.active();
|
||||
StreamT stream(std::cout);
|
||||
StreamT stream(std::cout); // inject path to data queries
|
||||
QueryEngineT query_engine;
|
||||
// IMPORTANT: PrintRecordStream can be replaces with a smarter
|
||||
// object that can test the results
|
||||
@ -31,7 +31,7 @@ int main(int argc, char* argv[]) {
|
||||
|
||||
int i = 0;
|
||||
watcher.watch(
|
||||
WatchDescriptor(implementations_folder, FSEventType::CloseNowrite),
|
||||
WatchDescriptor(implementations_folder, FSEventType::All),
|
||||
[&](FSEvent event) {
|
||||
i++; // bacause only close_no_write could be detected and this
|
||||
// call will cause close no write again
|
||||
|
Loading…
Reference in New Issue
Block a user