OmniSciDB
085a039ca4
|
#include <ParserWrapper.h>
Public Types | |
enum | DMLType : int { DMLType::Insert = 0, DMLType::Delete, DMLType::Update, DMLType::Upsert, DMLType::NotDML } |
enum | ExplainType { ExplainType::None, ExplainType::IR, ExplainType::OptimizedIR, ExplainType::Calcite, ExplainType::ExecutionPlan, ExplainType::Other } |
enum | QueryType { QueryType::Unknown, QueryType::Read, QueryType::Write, QueryType::SchemaRead, QueryType::SchemaWrite } |
Public Member Functions | |
ParserWrapper (std::string query_string) | |
std::string | process (std::string user, std::string passwd, std::string catalog, std::string sql_string, const bool legacy_syntax) |
virtual | ~ParserWrapper () |
DMLType | getDMLType () const |
ExplainInfo | getExplainInfo () const |
ExplainType | getExplainType () const |
QueryType | getQueryType () const |
bool | isUpdateDelete () const |
bool | isCalciteExplain () const |
bool | isPlanExplain () const |
bool | isSelectExplain () const |
bool | isIRExplain () const |
bool | isCalcitePathPermissable (bool read_only_mode=false) |
bool | isOtherExplain () const |
bool | isCalcitePermissableDml (bool read_only_mode=false) |
bool | isCalcitePermissableDdl (bool read_only_mode) |
bool | isDdl () const |
std::string | ActualQuery () |
Public Attributes | |
bool | is_ddl_ = false |
bool | is_update_dml = false |
bool | is_ctas = false |
bool | is_itas = false |
bool | is_copy = false |
bool | is_copy_to = false |
bool | is_validate = false |
Private Member Functions | |
void | initExplainType (std::string query_string) |
Private Attributes | |
std::string | actual_query_ |
DMLType | dml_type_ = DMLType::NotDML |
ExplainType | explain_type_ = ExplainType::None |
QueryType | query_type_ = QueryType::Unknown |
bool | is_legacy_ddl_ = false |
bool | is_calcite_ddl_ = false |
Static Private Attributes | |
static const std::vector < std::string > | ddl_cmd |
static const std::vector < std::string > | update_dml_cmd |
Definition at line 45 of file ParserWrapper.h.
|
strong |
Enumerator | |
---|---|
Insert | |
Delete | |
Update | |
Upsert | |
NotDML |
Definition at line 48 of file ParserWrapper.h.
|
strong |
Enumerator | |
---|---|
None | |
IR | |
OptimizedIR | |
Calcite | |
ExecutionPlan | |
Other |
Definition at line 50 of file ParserWrapper.h.
|
strong |
Enumerator | |
---|---|
Unknown | |
Read | |
Write | |
SchemaRead | |
SchemaWrite |
Definition at line 52 of file ParserWrapper.h.
ParserWrapper::ParserWrapper | ( | std::string | query_string | ) |
Definition at line 76 of file ParserWrapper.cpp.
References update_dml_cmd, and anonymous_namespace{ParserWrapper.cpp}::validate_no_leading_comments().
|
virtual |
Definition at line 147 of file ParserWrapper.cpp.
|
inline |
|
inline |
Definition at line 72 of file ParserWrapper.h.
References dml_type_.
Referenced by isCalcitePermissableDml().
ExplainInfo ParserWrapper::getExplainInfo | ( | ) | const |
|
inline |
|
inline |
|
private |
Definition at line 149 of file ParserWrapper.cpp.
References anonymous_namespace{ParserWrapper.cpp}::calcite_explain_str, anonymous_namespace{ParserWrapper.cpp}::explain_str, logger::IR, None, anonymous_namespace{ParserWrapper.cpp}::optimized_explain_str, and anonymous_namespace{ParserWrapper.cpp}::plan_explain_str.
|
inline |
|
inline |
Definition at line 98 of file ParserWrapper.h.
References explain_type_, is_ddl_, is_validate, isCalcitePermissableDdl(), isCalcitePermissableDml(), and Other.
|
inline |
Definition at line 120 of file ParserWrapper.h.
References query_type_, SchemaWrite, and Write.
Referenced by isCalcitePathPermissable().
|
inline |
Definition at line 108 of file ParserWrapper.h.
References Delete, getDMLType(), Insert, is_ctas, is_itas, is_update_dml, and Update.
Referenced by isCalcitePathPermissable().
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Definition at line 88 of file ParserWrapper.h.
References Calcite, ExecutionPlan, explain_type_, IR, and OptimizedIR.
Referenced by DBHandler::parse_to_ra().
|
inline |
std::string ParserWrapper::process | ( | std::string | user, |
std::string | passwd, | ||
std::string | catalog, | ||
std::string | sql_string, | ||
const bool | legacy_syntax | ||
) |
|
private |
Definition at line 134 of file ParserWrapper.h.
Referenced by ActualQuery().
|
staticprivate |
Definition at line 140 of file ParserWrapper.h.
|
private |
Definition at line 136 of file ParserWrapper.h.
Referenced by getDMLType(), and isUpdateDelete().
|
private |
Definition at line 137 of file ParserWrapper.h.
Referenced by getExplainType(), isCalciteExplain(), isCalcitePathPermissable(), isIRExplain(), isOtherExplain(), isPlanExplain(), and isSelectExplain().
|
private |
Definition at line 144 of file ParserWrapper.h.
bool ParserWrapper::is_copy = false |
Definition at line 68 of file ParserWrapper.h.
bool ParserWrapper::is_copy_to = false |
Definition at line 69 of file ParserWrapper.h.
bool ParserWrapper::is_ctas = false |
Definition at line 66 of file ParserWrapper.h.
Referenced by isCalcitePermissableDml().
bool ParserWrapper::is_ddl_ = false |
Definition at line 62 of file ParserWrapper.h.
Referenced by isCalcitePathPermissable(), and isDdl().
bool ParserWrapper::is_itas = false |
Definition at line 67 of file ParserWrapper.h.
Referenced by isCalcitePermissableDml().
|
private |
Definition at line 143 of file ParserWrapper.h.
bool ParserWrapper::is_update_dml = false |
Definition at line 65 of file ParserWrapper.h.
Referenced by isCalcitePermissableDml().
bool ParserWrapper::is_validate = false |
Definition at line 70 of file ParserWrapper.h.
Referenced by isCalcitePathPermissable().
|
private |
Definition at line 138 of file ParserWrapper.h.
Referenced by getQueryType(), and isCalcitePermissableDdl().
|
staticprivate |
Definition at line 141 of file ParserWrapper.h.
Referenced by ParserWrapper().