Class ParserWrapper

class ParserWrapper

Public Types

enum DMLType

Values:

Insert = 0
Delete
Update
Upsert
NotDML
enum ExplainType

Values:

None
IR
OptimizedIR
Calcite
ExecutionPlan
Other
enum QueryType

Values:

Unknown
Read
Write
SchemaRead
SchemaWrite

Public 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)
~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 isCalciteDdl() const

Public Members

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_optimize = false
bool is_validate = false
std::string actual_query

Private Members

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

Private Static Attributes

const std::vector<std::string> ddl_cmd = {"ARCHIVE", , , , , , , , , , , , , , , , , }
const std::vector<std::string> update_dml_cmd = {"INSERT", , , ,}
const std::string explain_str = {"explain"}
const std::string calcite_explain_str = {"explain calcite"}
const std::string optimized_explain_str = {"explain optimized"}
const std::string plan_explain_str = {"explain plan"}
const std::string optimize_str = {"optimize"}
const std::string validate_str = {"validate"}