2017-03-06 20:54:39 +08:00
|
|
|
#define HARDCODED_OUTPUT_STREAM
|
|
|
|
|
2017-06-21 17:29:13 +08:00
|
|
|
#include <gflags/gflags.h>
|
2017-06-07 16:15:08 +08:00
|
|
|
|
2017-02-15 21:10:16 +08:00
|
|
|
#include "dbms/dbms.hpp"
|
2017-02-18 18:54:37 +08:00
|
|
|
#include "query_engine_common.hpp"
|
2017-02-14 16:37:32 +08:00
|
|
|
|
2017-06-09 16:34:47 +08:00
|
|
|
DECLARE_bool(interpret);
|
|
|
|
DECLARE_string(compile_directory);
|
2017-07-06 19:53:39 +08:00
|
|
|
DEFINE_string(q, "../data/queries/core/mg_basic_002.txt",
|
|
|
|
"Path to warm up queries");
|
|
|
|
DEFINE_string(i, "../integration/hardcoded_query",
|
|
|
|
"Path to folder with query implementations");
|
2017-06-07 21:23:08 +08:00
|
|
|
|
2017-02-14 16:37:32 +08:00
|
|
|
using namespace std::chrono_literals;
|
|
|
|
using namespace tests::integration;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* IMPORTANT: tests only compilation and executability of implemented
|
|
|
|
* hard code queries (not correctnes of implementation)
|
|
|
|
*
|
|
|
|
* NOTE: The correctnes can be tested by custom Stream object.
|
|
|
|
* NOTE: This test will be usefull to test generated query plans.
|
|
|
|
*/
|
2017-02-18 18:54:37 +08:00
|
|
|
int main(int argc, char *argv[]) {
|
2017-06-21 17:29:13 +08:00
|
|
|
gflags::ParseCommandLineFlags(&argc, &argv, true);
|
2017-02-14 16:37:32 +08:00
|
|
|
|
2017-02-18 18:54:37 +08:00
|
|
|
/**
|
|
|
|
* init engine
|
|
|
|
*/
|
2017-06-21 17:29:13 +08:00
|
|
|
init_logging("IntegrationQueryEngine");
|
2017-03-06 20:54:39 +08:00
|
|
|
// Manually set config compile_path to avoid loading whole config file with
|
|
|
|
// the test.
|
2017-06-09 16:34:47 +08:00
|
|
|
FLAGS_compile_directory = "../compiled/";
|
2017-04-06 21:43:56 +08:00
|
|
|
// Set the interpret to false to avoid calling the interpreter which doesn't
|
|
|
|
// support all the queries yet.
|
2017-06-09 16:34:47 +08:00
|
|
|
FLAGS_interpret = false;
|
2017-02-18 18:54:37 +08:00
|
|
|
Dbms dbms;
|
|
|
|
StreamT stream(std::cout);
|
|
|
|
QueryEngineT query_engine;
|
|
|
|
// IMPORTANT: PrintRecordStream can be replaces with a smarter
|
|
|
|
// object that can test the results
|
2017-02-15 21:10:16 +08:00
|
|
|
|
2017-06-21 17:29:13 +08:00
|
|
|
WarmUpEngine(query_engine, dbms, stream);
|
2017-02-14 16:37:32 +08:00
|
|
|
|
2017-02-18 18:54:37 +08:00
|
|
|
return 0;
|
2017-02-14 16:37:32 +08:00
|
|
|
}
|