OmniSciDB  a5dc49c757
 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::CalciteDetail, 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 isCalciteExplainDetail () const
 
bool isPlanExplain () const
 
bool isOtherExplain () const
 
std::string ActualQuery ()
 
bool isVerbose () const
 

Private Attributes

ExplainType explain_type_ = ExplainType::None
 
std::string actual_query_ = ""
 
bool verbose_ {false}
 

Detailed Description

Definition at line 34 of file ParserWrapper.h.

Member Enumeration Documentation

Enumerator
None 
IR 
OptimizedIR 
Calcite 
CalciteDetail 
ExecutionPlan 
Other 

Definition at line 36 of file ParserWrapper.h.

36  {
37  None,
38  IR,
39  OptimizedIR,
40  Calcite,
41  CalciteDetail,
42  ExecutionPlan,
43  Other
44  };

Constructor & Destructor Documentation

ExplainInfo::ExplainInfo ( )
inline

Definition at line 46 of file ParserWrapper.h.

ExplainInfo::ExplainInfo ( ExplainType  type)
inline

Definition at line 47 of file ParserWrapper.h.

ExplainInfo::ExplainInfo ( std::string  query_string)

Definition at line 41 of file ParserWrapper.cpp.

References anonymous_namespace{ParserWrapper.cpp}::calcite_explain_detailed_str, 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, anonymous_namespace{ParserWrapper.cpp}::plan_explain_detailed_str, and anonymous_namespace{ParserWrapper.cpp}::plan_explain_str.

41  {
42  // sets explain_type_ and caches a trimmed actual_query_
44  actual_query_ = "";
45 
46  if (boost::istarts_with(query_string, explain_str)) {
47  if (boost::istarts_with(query_string, calcite_explain_str)) {
48  if (boost::istarts_with(query_string, calcite_explain_detailed_str)) {
51  boost::trim_copy(query_string.substr(calcite_explain_detailed_str.size()));
52  } else {
53  actual_query_ = boost::trim_copy(query_string.substr(calcite_explain_str.size()));
55  }
56  } else if (boost::istarts_with(query_string, optimized_explain_str)) {
57  actual_query_ = boost::trim_copy(query_string.substr(optimized_explain_str.size()));
59  } else if (boost::istarts_with(query_string, plan_explain_str)) {
60  if (boost::istarts_with(query_string, plan_explain_detailed_str)) {
62  boost::trim_copy(query_string.substr(plan_explain_detailed_str.size()));
63  verbose_ = true;
64  } else {
65  actual_query_ = boost::trim_copy(query_string.substr(plan_explain_str.size()));
66  }
68  } else {
69  actual_query_ = boost::trim_copy(query_string.substr(explain_str.size()));
71  }
72  // override condition: ddl, update_dml
74  if (inner.is_ddl || inner.is_update_dml) {
76  }
77  }
78 }
std::string actual_query_
Definition: ParserWrapper.h:87
ExplainType explain_type_
Definition: ParserWrapper.h:86

Member Function Documentation

std::string ExplainInfo::ActualQuery ( )
inline

Definition at line 81 of file ParserWrapper.h.

References actual_query_.

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

81 { return actual_query_; }
std::string actual_query_
Definition: ParserWrapper.h:87

+ Here is the caller graph for this function:

bool ExplainInfo::isCalciteExplain ( ) const
inline

Definition at line 71 of file ParserWrapper.h.

References Calcite, CalciteDetail, and explain_type_.

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

+ Here is the caller graph for this function:

bool ExplainInfo::isCalciteExplainDetail ( ) const
inline

Definition at line 75 of file ParserWrapper.h.

References CalciteDetail, and explain_type_.

Referenced by DBHandler::processCalciteRequest().

+ Here is the caller graph for this function:

bool ExplainInfo::isExplain ( ) const
inline

Definition at line 50 of file ParserWrapper.h.

References explain_type_, and None.

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

Definition at line 52 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 70 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 79 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 78 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 58 of file ParserWrapper.h.

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

Referenced by DBHandler::processCalciteRequest().

+ Here is the caller graph for this function:

bool ExplainInfo::isVerbose ( ) const
inline

Definition at line 83 of file ParserWrapper.h.

References verbose_.

Referenced by DBHandler::execute_rel_alg().

83 { return verbose_; }

+ Here is the caller graph for this function:

Member Data Documentation

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

Definition at line 87 of file ParserWrapper.h.

Referenced by ActualQuery().

bool ExplainInfo::verbose_ {false}
private

Definition at line 88 of file ParserWrapper.h.

Referenced by isVerbose().


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