OmniSciDB  343343d194
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
anonymous_namespace{PlanTest.cpp} Namespace Reference

Functions

void run_ddl_statement (const string &input_str)
 
RootPlanplan_dml (const string &input_str)
 

Function Documentation

RootPlan* anonymous_namespace{PlanTest.cpp}::plan_dml ( const string &  input_str)

Definition at line 53 of file PlanTest.cpp.

References Parser::DMLStmt::analyze(), CHECK, CHECK_EQ, QueryRunner::QueryRunner::get(), Planner::Optimizer::optimize(), run-benchmark-import::parser, and anonymous_namespace{UpdateMetadataTest.cpp}::query.

Referenced by TEST().

53  {
54  SQLParser parser;
55  list<std::unique_ptr<Parser::Stmt>> parse_trees;
56  string last_parsed;
57  CHECK_EQ(parser.parse(input_str, parse_trees, last_parsed), 0);
58  CHECK_EQ(parse_trees.size(), size_t(1));
59  const auto& stmt = parse_trees.front();
60  Parser::DMLStmt* dml = dynamic_cast<Parser::DMLStmt*>(stmt.get());
61  CHECK(dml);
62  Query query;
63  dml->analyze(*QR::get()->getCatalog(), query);
64  Optimizer optimizer(query, *QR::get()->getCatalog());
65  RootPlan* plan = optimizer.optimize();
66  return plan;
67 }
virtual void analyze(const Catalog_Namespace::Catalog &catalog, Analyzer::Query &query) const =0
#define CHECK_EQ(x, y)
Definition: Logger.h:195
static QueryRunner * get()
Definition: QueryRunner.h:118
#define CHECK(condition)
Definition: Logger.h:187

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void anonymous_namespace{PlanTest.cpp}::run_ddl_statement ( const string &  input_str)
inline

Definition at line 49 of file PlanTest.cpp.

References QueryRunner::QueryRunner::get(), and QueryRunner::QueryRunner::runDDLStatement().

49  {
50  QR::get()->runDDLStatement(input_str);
51 }
virtual void runDDLStatement(const std::string &)
static QueryRunner * get()
Definition: QueryRunner.h:118

+ Here is the call graph for this function: