OmniSciDB  04ee39c94c
Planner::RootPlan Class Reference

#include <Planner.h>

+ Collaboration diagram for Planner::RootPlan:

Public Types

enum  Dest { kCLIENT, kEXPLAIN, kRENDER }
 

Public Member Functions

 RootPlan (Plan *p, SQLStmtType t, int r, const std::list< int > &c, const Catalog_Namespace::Catalog &cat, int64_t l, int64_t o)
 
const Planget_plan () const
 
SQLStmtType get_stmt_type () const
 
int get_result_table_id () const
 
const std::list< int > & get_result_col_list () const
 
const Catalog_Namespace::CataloggetCatalog () const
 
virtual void print () const
 
int64_t get_limit () const
 
int64_t get_offset () const
 
const std::string & get_render_type () const
 
void set_render_type (std::string t)
 
Dest get_plan_dest () const
 
void set_plan_dest (Dest d)
 
virtual ~RootPlan ()
 

Private Attributes

std::unique_ptr< Planplan
 
SQLStmtType stmt_type
 
int result_table_id
 
std::list< int > result_col_list
 
const Catalog_Namespace::Catalogcatalog
 
int64_t limit
 
int64_t offset
 
std::string render_type
 
Dest plan_dest
 

Detailed Description

Definition at line 270 of file Planner.h.

Member Enumeration Documentation

◆ Dest

Enumerator
kCLIENT 
kEXPLAIN 
kRENDER 

Definition at line 272 of file Planner.h.

Constructor & Destructor Documentation

◆ RootPlan()

Planner::RootPlan::RootPlan ( Plan p,
SQLStmtType  t,
int  r,
const std::list< int > &  c,
const Catalog_Namespace::Catalog cat,
int64_t  l,
int64_t  o 
)
inline

Definition at line 273 of file Planner.h.

280  : plan(p)
281  , stmt_type(t)
282  , result_table_id(r)
283  , result_col_list(c)
284  , catalog(cat)
285  , limit(l)
286  , offset(o)
287  , render_type("NONE")
288  , plan_dest(kCLIENT) {}
const Catalog_Namespace::Catalog & catalog
Definition: Planner.h:311
SQLStmtType stmt_type
Definition: Planner.h:305
void c(const std::string &query_string, const ExecutorDeviceType device_type)
std::list< int > result_col_list
Definition: Planner.h:309
int64_t offset
Definition: Planner.h:313
std::unique_ptr< Plan > plan
Definition: Planner.h:304
int64_t limit
Definition: Planner.h:312
std::string render_type
Definition: Planner.h:314

◆ ~RootPlan()

virtual Planner::RootPlan::~RootPlan ( )
inlinevirtual

Definition at line 301 of file Planner.h.

301 {}

Member Function Documentation

◆ get_limit()

int64_t Planner::RootPlan::get_limit ( ) const
inline

Definition at line 295 of file Planner.h.

295 { return limit; }
int64_t limit
Definition: Planner.h:312

◆ get_offset()

int64_t Planner::RootPlan::get_offset ( ) const
inline

Definition at line 296 of file Planner.h.

296 { return offset; }
int64_t offset
Definition: Planner.h:313

◆ get_plan()

const Plan* Planner::RootPlan::get_plan ( ) const
inline

Definition at line 289 of file Planner.h.

Referenced by MapDHandler::execute_root_plan(), and Executor::executeSimpleInsert().

289 { return plan.get(); }
std::unique_ptr< Plan > plan
Definition: Planner.h:304
+ Here is the caller graph for this function:

◆ get_plan_dest()

Dest Planner::RootPlan::get_plan_dest ( ) const
inline

Definition at line 299 of file Planner.h.

Referenced by Executor::execute(), and MapDHandler::execute_root_plan().

299 { return plan_dest; }
+ Here is the caller graph for this function:

◆ get_render_type()

const std::string& Planner::RootPlan::get_render_type ( ) const
inline

Definition at line 297 of file Planner.h.

297 { return render_type; }
std::string render_type
Definition: Planner.h:314

◆ get_result_col_list()

const std::list<int>& Planner::RootPlan::get_result_col_list ( ) const
inline

Definition at line 292 of file Planner.h.

Referenced by Executor::executeSimpleInsert().

292 { return result_col_list; }
std::list< int > result_col_list
Definition: Planner.h:309
+ Here is the caller graph for this function:

◆ get_result_table_id()

int Planner::RootPlan::get_result_table_id ( ) const
inline

Definition at line 291 of file Planner.h.

Referenced by Executor::execute(), and Executor::executeSimpleInsert().

291 { return result_table_id; }
+ Here is the caller graph for this function:

◆ get_stmt_type()

SQLStmtType Planner::RootPlan::get_stmt_type ( ) const
inline

Definition at line 290 of file Planner.h.

Referenced by Executor::execute().

290 { return stmt_type; }
SQLStmtType stmt_type
Definition: Planner.h:305
+ Here is the caller graph for this function:

◆ getCatalog()

const Catalog_Namespace::Catalog& Planner::RootPlan::getCatalog ( ) const
inline

Definition at line 293 of file Planner.h.

References Planner::Plan::print().

Referenced by Executor::execute(), MapDHandler::execute_root_plan(), Executor::executeSimpleInsert(), and QueryRunner::QueryRunner::parsePlanLegacy().

293 { return catalog; }
const Catalog_Namespace::Catalog & catalog
Definition: Planner.h:311
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ print()

void Planner::RootPlan::print ( ) const
virtual

Definition at line 450 of file Planner.cpp.

References kDELETE, kINSERT, kSELECT, and kUPDATE.

450  {
451  std::cout << "(RootPlan ";
452  switch (stmt_type) {
453  case kSELECT:
454  std::cout << "SELECT" << std::endl;
455  break;
456  case kUPDATE:
457  std::cout << "UPDATE "
458  << "result table: " << result_table_id << " columns: ";
459  for (auto i : result_col_list) {
460  std::cout << i;
461  std::cout << " ";
462  }
463  std::cout << std::endl;
464  break;
465  case kINSERT:
466  std::cout << "INSERT "
467  << "result table: " << result_table_id << " columns: ";
468  for (auto i : result_col_list) {
469  std::cout << i;
470  std::cout << " ";
471  }
472  std::cout << std::endl;
473  break;
474  case kDELETE:
475  std::cout << "DELETE "
476  << "result table: " << result_table_id << std::endl;
477  break;
478  default:
479  break;
480  }
481  plan->print();
482  std::cout << "limit: " << limit;
483  std::cout << " offset: " << offset << ")" << std::endl;
484 }
SQLStmtType stmt_type
Definition: Planner.h:305
std::list< int > result_col_list
Definition: Planner.h:309
int64_t offset
Definition: Planner.h:313
std::unique_ptr< Plan > plan
Definition: Planner.h:304
int64_t limit
Definition: Planner.h:312

◆ set_plan_dest()

void Planner::RootPlan::set_plan_dest ( Dest  d)
inline

Definition at line 300 of file Planner.h.

References anonymous_namespace{ImportTest.cpp}::d().

300 { plan_dest = d; }
void d(const SQLTypes expected_type, const std::string &str)
Definition: ImportTest.cpp:268
+ Here is the call graph for this function:

◆ set_render_type()

void Planner::RootPlan::set_render_type ( std::string  t)
inline

Definition at line 298 of file Planner.h.

298 { render_type = t; }
std::string render_type
Definition: Planner.h:314

Member Data Documentation

◆ catalog

const Catalog_Namespace::Catalog& Planner::RootPlan::catalog
private

Definition at line 311 of file Planner.h.

◆ limit

int64_t Planner::RootPlan::limit
private

Definition at line 312 of file Planner.h.

◆ offset

int64_t Planner::RootPlan::offset
private

Definition at line 313 of file Planner.h.

◆ plan

std::unique_ptr<Plan> Planner::RootPlan::plan
private

Definition at line 304 of file Planner.h.

◆ plan_dest

Dest Planner::RootPlan::plan_dest
private

Definition at line 315 of file Planner.h.

◆ render_type

std::string Planner::RootPlan::render_type
private

Definition at line 314 of file Planner.h.

◆ result_col_list

std::list<int> Planner::RootPlan::result_col_list
private

Definition at line 309 of file Planner.h.

◆ result_table_id

int Planner::RootPlan::result_table_id
private

Definition at line 306 of file Planner.h.

◆ stmt_type

SQLStmtType Planner::RootPlan::stmt_type
private

Definition at line 305 of file Planner.h.


The documentation for this class was generated from the following files: