OmniSciDB  b24e664e58
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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

Enumerator
kCLIENT 
kEXPLAIN 
kRENDER 

Definition at line 272 of file Planner.h.

Constructor & Destructor Documentation

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
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
virtual Planner::RootPlan::~RootPlan ( )
inlinevirtual

Definition at line 301 of file Planner.h.

301 {}

Member Function Documentation

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

Definition at line 295 of file Planner.h.

References limit.

295 { return limit; }
int64_t limit
Definition: Planner.h:312
int64_t Planner::RootPlan::get_offset ( ) const
inline

Definition at line 296 of file Planner.h.

References offset.

296 { return offset; }
int64_t offset
Definition: Planner.h:313
const Plan* Planner::RootPlan::get_plan ( ) const
inline

Definition at line 289 of file Planner.h.

References plan.

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:

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

Definition at line 299 of file Planner.h.

References plan_dest.

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

299 { return plan_dest; }

+ Here is the caller graph for this function:

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

Definition at line 297 of file Planner.h.

References render_type.

297 { return render_type; }
std::string render_type
Definition: Planner.h:314
const std::list<int>& Planner::RootPlan::get_result_col_list ( ) const
inline

Definition at line 292 of file Planner.h.

References result_col_list.

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:

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

Definition at line 291 of file Planner.h.

References result_table_id.

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

291 { return result_table_id; }

+ Here is the caller graph for this function:

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

Definition at line 290 of file Planner.h.

References stmt_type.

Referenced by Executor::execute().

290 { return stmt_type; }
SQLStmtType stmt_type
Definition: Planner.h:305

+ Here is the caller graph for this function:

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

Definition at line 293 of file Planner.h.

References catalog.

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

293 { return catalog; }
const Catalog_Namespace::Catalog & catalog
Definition: Planner.h:311

+ Here is the caller graph for this function:

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

Definition at line 450 of file Planner.cpp.

References kDELETE, kINSERT, kSELECT, kUPDATE, limit, offset, plan, result_col_list, result_table_id, and stmt_type.

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
void Planner::RootPlan::set_plan_dest ( Dest  d)
inline

Definition at line 300 of file Planner.h.

References plan_dest.

300 { plan_dest = d; }
void Planner::RootPlan::set_render_type ( std::string  t)
inline

Definition at line 298 of file Planner.h.

References render_type.

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

Member Data Documentation

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

Definition at line 311 of file Planner.h.

Referenced by getCatalog().

int64_t Planner::RootPlan::limit
private

Definition at line 312 of file Planner.h.

Referenced by get_limit(), and print().

int64_t Planner::RootPlan::offset
private

Definition at line 313 of file Planner.h.

Referenced by get_offset(), and print().

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

Definition at line 304 of file Planner.h.

Referenced by get_plan(), and print().

Dest Planner::RootPlan::plan_dest
private

Definition at line 315 of file Planner.h.

Referenced by get_plan_dest(), and set_plan_dest().

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

Definition at line 314 of file Planner.h.

Referenced by get_render_type(), and set_render_type().

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

Definition at line 309 of file Planner.h.

Referenced by get_result_col_list(), and print().

int Planner::RootPlan::result_table_id
private

Definition at line 306 of file Planner.h.

Referenced by get_result_table_id(), and print().

SQLStmtType Planner::RootPlan::stmt_type
private

Definition at line 305 of file Planner.h.

Referenced by get_stmt_type(), and print().


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