OmniSciDB  c0231cc57d
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ExplainInfo Class Reference

#include <ParserWrapper.h>

+ Collaboration diagram for ExplainInfo:

Public Types

enum  ExplainType {
  ExplainType::None, ExplainType::IR, ExplainType::OptimizedIR, ExplainType::Calcite,
  ExplainType::ExecutionPlan, ExplainType::Other
}
 

Public Member Functions

 ExplainInfo ()
 
 ExplainInfo (ExplainType type)
 
 ExplainInfo (std::string query_string)
 
bool isExplain () const
 
bool isJustExplain () const
 
bool isSelectExplain () const
 
bool isIRExplain () const
 
bool isOptimizedExplain () const
 
bool isCalciteExplain () const
 
bool isPlanExplain () const
 
bool isOtherExplain () const
 
std::string ActualQuery ()
 

Private Attributes

ExplainType explain_type_ = ExplainType::None
 
std::string actual_query_ = ""
 

Detailed Description

Definition at line 30 of file ParserWrapper.h.

Member Enumeration Documentation

Enumerator
None 
IR 
OptimizedIR 
Calcite 
ExecutionPlan 
Other 

Definition at line 32 of file ParserWrapper.h.

Constructor & Destructor Documentation

ExplainInfo::ExplainInfo ( )
inline

Definition at line 34 of file ParserWrapper.h.

ExplainInfo::ExplainInfo ( ExplainType  type)
inline

Definition at line 35 of file ParserWrapper.h.

ExplainInfo::ExplainInfo ( std::string  query_string)

Definition at line 39 of file ParserWrapper.cpp.

References anonymous_namespace{ParserWrapper.cpp}::calcite_explain_str, anonymous_namespace{ParserWrapper.cpp}::explain_str, logger::IR, anonymous_namespace{ExtensionFunctionsGeo.hpp}::None, anonymous_namespace{ParserWrapper.cpp}::optimized_explain_str, and anonymous_namespace{ParserWrapper.cpp}::plan_explain_str.

39  {
40  // sets explain_type_ and caches a trimmed actual_query_
42  actual_query_ = "";
43 
44  if (boost::istarts_with(query_string, explain_str)) {
45  if (boost::istarts_with(query_string, calcite_explain_str)) {
46  actual_query_ = boost::trim_copy(query_string.substr(calcite_explain_str.size()));
48  } else if (boost::istarts_with(query_string, optimized_explain_str)) {
49  actual_query_ = boost::trim_copy(query_string.substr(optimized_explain_str.size()));
51  } else if (boost::istarts_with(query_string, plan_explain_str)) {
52  actual_query_ = boost::trim_copy(query_string.substr(plan_explain_str.size()));
54  } else {
55  actual_query_ = boost::trim_copy(query_string.substr(explain_str.size()));
57  }
58  // override condition: ddl, update_dml
60  if (inner.is_ddl || inner.is_update_dml) {
62  }
63  }
64 }
std::string actual_query_
Definition: ParserWrapper.h:66
ExplainType explain_type_
Definition: ParserWrapper.h:65

Member Function Documentation

std::string ExplainInfo::ActualQuery ( )
inline

Definition at line 62 of file ParserWrapper.h.

References actual_query_.

Referenced by DBHandler::parse_to_ra(), and DBHandler::sql_execute_impl().

62 { return actual_query_; }
std::string actual_query_
Definition: ParserWrapper.h:66

+ Here is the caller graph for this function:

bool ExplainInfo::isCalciteExplain ( ) const
inline

Definition at line 58 of file ParserWrapper.h.

References Calcite, and explain_type_.

Referenced by DBHandler::execute_rel_alg(), DBHandler::parse_to_ra(), and DBHandler::sql_execute_impl().

+ Here is the caller graph for this function:

bool ExplainInfo::isExplain ( ) const
inline

Definition at line 38 of file ParserWrapper.h.

References explain_type_, and None.

bool ExplainInfo::isIRExplain ( ) const
inline
bool ExplainInfo::isJustExplain ( ) const
inline

Definition at line 40 of file ParserWrapper.h.

References ExecutionPlan, explain_type_, IR, and OptimizedIR.

Referenced by DBHandler::execute_rel_alg().

+ Here is the caller graph for this function:

bool ExplainInfo::isOptimizedExplain ( ) const
inline

Definition at line 57 of file ParserWrapper.h.

References explain_type_, and OptimizedIR.

Referenced by DBHandler::execute_rel_alg().

+ Here is the caller graph for this function:

bool ExplainInfo::isOtherExplain ( ) const
inline

Definition at line 60 of file ParserWrapper.h.

References explain_type_, and Other.

Referenced by ParserWrapper::ParserWrapper().

+ Here is the caller graph for this function:

bool ExplainInfo::isPlanExplain ( ) const
inline

Definition at line 59 of file ParserWrapper.h.

References ExecutionPlan, and explain_type_.

Referenced by DBHandler::execute_rel_alg().

+ Here is the caller graph for this function:

bool ExplainInfo::isSelectExplain ( ) const
inline

Definition at line 46 of file ParserWrapper.h.

References Calcite, ExecutionPlan, explain_type_, IR, and OptimizedIR.

Referenced by DBHandler::parse_to_ra().

+ Here is the caller graph for this function:

Member Data Documentation

std::string ExplainInfo::actual_query_ = ""
private

Definition at line 66 of file ParserWrapper.h.

Referenced by ActualQuery().


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