23 #ifndef PARSER_NODE_H_
24 #define PARSER_NODE_H_
31 #include <boost/algorithm/string/predicate.hpp>
32 #include <boost/process/search_path.hpp>
50 namespace query_state {
78 : ddl_utils::
SqlType(t, p1, p2, a, array_size) {}
80 : ddl_utils::
SqlType(t, -1, 0, a, array_size) {}
95 virtual std::shared_ptr<Analyzer::Expr>
analyze(
99 virtual std::string
to_string()
const = 0;
108 std::shared_ptr<Analyzer::Expr>
analyze(
112 std::string
to_string()
const override = 0;
122 std::shared_ptr<Analyzer::Expr>
analyze(
126 std::string
to_string()
const override {
return "NULL"; }
137 std::shared_ptr<Analyzer::Expr>
analyze(
141 static std::shared_ptr<Analyzer::Expr>
analyzeValue(
const std::string& stringval,
157 std::shared_ptr<Analyzer::Expr>
analyze(
161 static std::shared_ptr<Analyzer::Expr>
analyzeValue(
const int64_t intval);
163 return boost::lexical_cast<std::string>(
intval_);
178 std::shared_ptr<Analyzer::Expr>
analyze(
182 static std::shared_ptr<Analyzer::Expr>
analyzeValue(
const int64_t numericval,
184 const int precision);
199 std::shared_ptr<Analyzer::Expr>
analyze(
204 return boost::lexical_cast<std::string>(
floatval_);
219 std::shared_ptr<Analyzer::Expr>
analyze(
224 return boost::lexical_cast<std::string>(
doubleval_);
238 std::shared_ptr<Analyzer::Expr>
analyze(
242 static std::shared_ptr<Analyzer::Expr>
get(
const int64_t);
260 std::shared_ptr<Analyzer::Expr>
analyze(
264 static std::shared_ptr<Analyzer::Expr>
get(
const std::string&);
265 std::string
to_string()
const override {
return "USER"; }
277 for (
const auto e : *v) {
283 std::shared_ptr<Analyzer::Expr>
analyze(
306 std::shared_ptr<Analyzer::Expr>
analyze(
310 static std::shared_ptr<Analyzer::Expr>
normalize(
313 std::shared_ptr<Analyzer::Expr> left_expr,
314 std::shared_ptr<Analyzer::Expr> right_expr,
315 const Executor* executor =
nullptr);
336 std::shared_ptr<Analyzer::Expr>
analyze(
350 std::shared_ptr<Analyzer::Expr>
analyze(
370 std::shared_ptr<Analyzer::Expr>
analyze(
389 std::shared_ptr<Analyzer::Expr>
analyze(
407 for (
const auto e : *v) {
413 std::shared_ptr<Analyzer::Expr>
analyze(
435 std::shared_ptr<Analyzer::Expr>
analyze(
458 std::shared_ptr<Analyzer::Expr>
analyze(
478 std::shared_ptr<Analyzer::Expr>
analyze(
500 std::shared_ptr<Analyzer::Expr>
analyze(
504 static std::shared_ptr<Analyzer::Expr>
get(std::shared_ptr<Analyzer::Expr> arg_expr,
505 std::shared_ptr<Analyzer::Expr> like_expr,
506 std::shared_ptr<Analyzer::Expr> escape_expr,
518 static void check_like_expr(
const std::string& like_str,
char escape_char);
535 std::shared_ptr<Analyzer::Expr>
analyze(
539 static std::shared_ptr<Analyzer::Expr>
get(std::shared_ptr<Analyzer::Expr> arg_expr,
540 std::shared_ptr<Analyzer::Expr> pattern_expr,
541 std::shared_ptr<Analyzer::Expr> escape_expr,
563 std::shared_ptr<Analyzer::Expr>
analyze(
567 static std::shared_ptr<Analyzer::Expr>
get(
568 std::shared_ptr<Analyzer::Expr> target_value,
571 std::shared_ptr<Analyzer::Expr> partition_count);
591 std::shared_ptr<Analyzer::Expr>
analyze(
595 static std::shared_ptr<Analyzer::Expr>
get(std::shared_ptr<Analyzer::Expr> arg_expr,
614 std::shared_ptr<Analyzer::Expr>
analyze(
634 std::shared_ptr<Analyzer::Expr>
analyze(
657 std::shared_ptr<Analyzer::Expr>
analyze(
672 std::shared_ptr<Analyzer::Expr>
analyze(
677 return "CAST(" +
arg_->to_string() +
" AS " +
target_type_->to_string() +
")";
700 for (
const auto e : *w) {
705 std::shared_ptr<Analyzer::Expr>
analyze(
709 static std::shared_ptr<Analyzer::Expr>
normalize(
711 std::pair<std::shared_ptr<Analyzer::Expr>, std::shared_ptr<Analyzer::Expr>>>&,
712 const std::shared_ptr<Analyzer::Expr>,
713 const Executor* executor =
nullptr);
764 bool read_only_mode) = 0;
857 for (
const auto s : *cl) {
878 ForeignKeyDef(std::list<std::string*>* cl, std::string* t, std::list<std::string*>* fcl)
881 for (
const auto s : *cl) {
886 for (
const auto s : *fcl) {
927 const std::string& foreign_table,
928 const std::string foreign_column)
977 virtual const std::string*
get_table()
const = 0;
989 const std::string* storage,
990 std::list<TableElement*>* table_elems,
993 std::list<NameValueAssign*>* s)
996 for (
const auto e : *table_elems) {
1001 for (
const auto e : *s) {
1017 bool read_only_mode)
override;
1020 std::list<ColumnDescriptor>& columns,
1021 std::vector<SharedDictionaryDef>& shared_dict_defs);
1035 std::string& sql_query_string) = 0;
1037 std::string& sql_query_string,
1038 std::vector<size_t> outer_frag_indices,
1039 bool allow_interrupt) = 0;
1048 std::string& sql_query_string,
1049 std::vector<size_t> outer_frag_indices,
1051 bool allow_interrupt);
1053 std::string& sql_query_string,
1054 std::vector<size_t> outer_frag_indices,
1055 bool allow_interrupt)
override;
1058 size_t leafCount()
override {
return LocalInsertConnector::leafCount(); }
1061 const size_t leaf_idx,
1063 return LocalInsertConnector::insertChunksToLeaf(
1064 parent_session_info, leaf_idx, insert_chunks);
1067 const size_t leaf_idx,
1069 return LocalInsertConnector::insertDataToLeaf(
1070 parent_session_info, leaf_idx, insert_data);
1073 int tableId)
override {
1074 return LocalInsertConnector::checkpoint(parent_session_info, tableId);
1077 int tableId)
override {
1078 return LocalInsertConnector::rollback(parent_session_info, tableId);
1089 std::list<TableElement*>* table_elems,
1091 std::list<NameValueAssign*>* s)
1094 for (
const auto e : *table_elems) {
1099 for (
const auto e : *s) {
1114 bool read_only_mode)
override;
1132 const std::string* select_query,
1133 std::list<std::string*>* c)
1143 delete select_query;
1148 bool validate_table,
1149 bool for_CTAS =
false);
1151 bool read_only_mode)
override;
1173 const std::string* select_query,
1174 const bool is_temporary,
1175 const bool if_not_exists,
1176 std::list<NameValueAssign*>* s)
1181 for (
const auto& e : *s) {
1189 bool read_only_mode)
override;
1216 bool read_only_mode)
override;
1233 bool read_only_mode)
override;
1243 throw std::runtime_error(
"Table name is required for OPTIMIZE command.");
1246 for (
const auto e : *o) {
1258 if (boost::iequals(*(e->get_name()),
"VACUUM")) {
1266 bool read_only_mode)
override;
1283 bool read_only_mode)
override {
1302 bool read_only_mode)
override;
1317 bool read_only_mode)
override;
1327 std::pair<std::unique_ptr<std::string>, std::unique_ptr<std::string>>;
1336 RenameTableStmt(std::list<std::pair<std::string, std::string>> tableNames);
1339 bool read_only_mode)
override;
1350 bool read_only_mode)
override;
1362 for (
const auto coldef : *coldefs) {
1363 this->
coldefs_.emplace_back(coldef);
1368 bool read_only_mode)
override;
1382 for (
const auto col : *cols) {
1388 bool read_only_mode)
override;
1400 bool read_only_mode)
override;
1422 const bool is_restore);
1442 bool read_only_mode)
override;
1453 bool read_only_mode)
override;
1462 CopyTableStmt(std::string* t, std::string*
f, std::list<NameValueAssign*>* o);
1466 bool read_only_mode)
override;
1468 bool read_only_mode,
1469 const std::function<std::unique_ptr<import_export::AbstractImporter>(
1486 std::string& file_name,
1488 std::string& partitions) {
1518 bool read_only_mode)
override;
1534 bool read_only_mode)
override;
1542 std::vector<std::string>& v) {
1544 for (
auto str : *l) {
1560 std::list<std::string*>* g)
1572 bool read_only_mode)
override;
1590 std::list<std::string*>* g)
1602 bool read_only_mode)
override;
1623 bool read_only_mode)
override;
1646 bool read_only_mode)
override;
1668 bool read_only_mode)
override;
1723 std::list<SelectEntry*>* s,
1724 std::list<TableRef*>*
f,
1726 std::list<Expr*>* g,
1730 for (
const auto e : *s) {
1736 for (
const auto e : *f) {
1741 for (
const auto e : *g) {
1811 for (
const auto e : *o) {
1840 for (
const auto e : *o) {
1848 bool read_only_mode)
override;
1861 std::string& layer_name,
1873 const std::string& select_query,
1874 const bool if_not_exists)
1884 bool read_only_mode)
override;
1903 bool read_only_mode)
override;
1918 CreateDBStmt(std::string*
n, std::list<NameValueAssign*>* l,
const bool if_not_exists)
1921 for (
const auto e : *l) {
1928 bool read_only_mode)
override;
1947 bool read_only_mode)
override;
1966 bool read_only_mode)
override;
1989 const std::shared_ptr<Catalog_Namespace::SessionInfo> session_ptr);
2000 bool read_only_mode)
override;
2016 for (
const auto e : *l) {
2023 bool read_only_mode)
override;
2039 for (
const auto e : *l) {
2046 bool read_only_mode)
override;
2063 bool read_only_mode)
override;
2078 for (
const auto e : *c) {
2101 for (
const auto v : *values) {
2122 const rapidjson::Value& payload);
2125 UNREACHABLE() <<
"Legacy inserts should not be called anymore";
2137 std::unique_ptr<Fragmenter_Namespace::InsertDataLoader::InsertConnector>
2168 for (
const auto e : *a) {
2204 template <
typename LITERAL_TYPE>
2209 template <
typename T>
2210 decltype(
auto) operator()(
T t) {
2211 const std::string property_name(boost::to_upper_copy<std::string>(*t->get_name()));
2212 if (!dynamic_cast<const IntLiteral*>(t->get_value())) {
2213 throw std::runtime_error(property_name +
" must be an integer literal.");
2215 const auto val =
static_cast<const IntLiteral*
>(t->get_value())->get_intval();
2221 if (val <= 0 && property_name !=
"FRAGMENT_SIZE") {
2222 throw std::runtime_error(property_name +
" must be a positive number.");
2229 template <
typename T>
2230 decltype(
auto) operator()(
T t) {
2231 const std::string property_name(boost::to_upper_copy<std::string>(*t->get_name()));
2232 if (!dynamic_cast<const IntLiteral*>(t->get_value())) {
2233 throw std::runtime_error(property_name +
" must be an integer literal.");
2235 const auto val =
static_cast<const IntLiteral*
>(t->get_value())->get_intval();
2237 throw std::runtime_error(property_name +
" must be greater than or equal to 0.");
2244 template <
typename T>
2246 auto str =
dynamic_cast<const StringLiteral*
>(name_value_assign->get_value());
2248 auto option_name = name_value_assign->get_name();
2250 throw std::runtime_error(
"The \"" + *option_name +
"\" option must be a string.");
2252 return str->get_stringval();
2258 template <
typename T>
2259 decltype(
auto) operator()(
T t) {
2262 const auto val_upper = boost::to_upper_copy<std::string>(*val);
2268 template <
typename T>
2269 decltype(
auto) operator()(
T t) {
2283 const std::string& queryStr,
2289 const std::string& query_json,
2290 std::shared_ptr<Catalog_Namespace::SessionInfo const> session_ptr,
2291 bool read_only_mode);
2294 const rapidjson::Value& payload);
2298 std::unique_ptr<ColumnDef>
column_from_json(
const rapidjson::Value& element);
2306 #endif // PARSERNODE_H_
DEVICE auto upper_bound(ARGS &&...args)
std::unique_ptr< Expr > expr2_
virtual void analyze(const Catalog_Namespace::Catalog &catalog, Analyzer::Query &query) const =0
const ColumnConstraintDef * get_column_constraint() const
void execute(const Catalog_Namespace::SessionInfo &session, bool read_only_mode) override
virtual void analyze(const Catalog_Namespace::Catalog &catalog, Analyzer::Query &query) const =0
Defines data structures for the semantic analysis phase of query processing.
OperExpr(SQLOps t, SQLQualifier q, Expr *l, Expr *r)
const std::string foreign_column_
std::string & get_table() const
std::shared_ptr< Analyzer::Expr > analyze(const Catalog_Namespace::Catalog &catalog, Analyzer::Query &query, TlistRefType allow_tlist_ref=TLIST_NONE) const override
QuerySpec(bool d, std::list< SelectEntry * > *s, std::list< TableRef * > *f, Expr *w, std::list< Expr * > *g, Expr *h)
ValidateStmt(std::string *type, std::list< NameValueAssign * > *with_opts)
std::unique_ptr< SubqueryExpr > subquery_
std::unique_ptr< std::string > username_
static std::shared_ptr< Analyzer::Expr > normalize(const std::list< std::pair< std::shared_ptr< Analyzer::Expr >, std::shared_ptr< Analyzer::Expr >>> &, const std::shared_ptr< Analyzer::Expr >, const Executor *executor=nullptr)
std::vector< std::string > privileges_
const Literal * get_value() const
LikelihoodExpr(bool n, Expr *a, float l)
CreateDBStmt(const rapidjson::Value &payload)
const std::string & get_column() const
bool was_deferred_copy_from_
const std::string * get_table() const
const Expr * get_arg() const
std::unique_ptr< std::string > foreign_table_
std::shared_ptr< Analyzer::Expr > analyze(const Catalog_Namespace::Catalog &catalog, Analyzer::Query &query, TlistRefType allow_tlist_ref=TLIST_NONE) const override
std::unique_ptr< Expr > where_clause_
RevokePrivilegesStmt(std::list< std::string * > *p, std::string *t, std::string *o, std::list< std::string * > *g)
void analyze(const Catalog_Namespace::Catalog &catalog, Analyzer::Query &query) const override
void get_deferred_copy_from_payload(std::string &table, std::string &file_name, import_export::CopyParams ©_params, std::string &partitions)
GrantPrivilegesStmt(std::list< std::string * > *p, std::string *t, std::string *o, std::list< std::string * > *g)
std::unique_ptr< Expr > right_
ExportQueryStmt(std::string *q, std::string *p, std::list< NameValueAssign * > *o)
std::unique_ptr< QueryConnector > leafs_connector_
std::unique_ptr< std::string > stringval_
std::string to_string() const override
std::unique_ptr< std::string > new_database_name_
std::unique_ptr< std::string > view_name_
SQLType * get_column_type() const
float get_likelihood() const
double data_split_eval_fraction_
const std::string * get_table() const override
std::list< std::unique_ptr< NameValueAssign > > storage_options_
void setColumnDescriptor(ColumnDescriptor &cd, const ColumnDef *coldef)
const std::string * get_table() const
std::unique_ptr< std::string > db_name_
class for a per-database catalog. also includes metadata for the current database and the current use...
std::unique_ptr< Expr > assignment_
std::unique_ptr< std::string > target_
const std::string * get_table() const
std::list< std::unique_ptr< NameValueAssign > > model_options_
const std::string * get_column() const
std::unique_ptr< std::string > user_name_
std::unique_ptr< Expr > check_condition_
void executeDryRun(const Catalog_Namespace::SessionInfo &session, TableDescriptor &td, std::list< ColumnDescriptor > &columns, std::vector< SharedDictionaryDef > &shared_dict_defs)
std::unique_ptr< Expr > having_clause_
const Expr * get_arg() const
SqlType(SQLTypes type, int param1, int param2, bool is_array, int array_size)
void set_column_descriptor(ColumnDescriptor &cd, const ColumnDef *coldef)
void parseOptions(import_export::CopyParams ©_params, import_export::QueryExporter::FileType &file_type, std::string &layer_name, import_export::QueryExporter::FileCompression &file_compression, import_export::QueryExporter::ArrayNullHandling &array_null_handling)
std::unique_ptr< std::string > copy_from_source_pattern_
CreateTableStmt(std::string *tab, const std::string *storage, std::list< TableElement * > *table_elems, bool is_temporary, bool if_not_exists, std::list< NameValueAssign * > *s)
RenameUserStmt(const rapidjson::Value &payload)
std::unique_ptr< Expr > select_expr_
void execute(const Catalog_Namespace::SessionInfo &session, bool read_only_mode) override
std::string & get_table()
std::list< std::unique_ptr< Expr > > groupby_clause_
virtual const std::list< std::unique_ptr< TableElement > > & get_table_element_list() const =0
const std::list< std::unique_ptr< TableElement > > & get_table_element_list() const override
std::list< std::unique_ptr< TableElement > > table_element_list_
CastExpr(Expr *a, SQLType *t)
float get_floatval() const
std::list< std::unique_ptr< NameValueAssign > > options_
DropViewStmt(std::string *v, bool i)
size_t getOuterFragmentCount(QueryStateProxy, std::string &sql_query_string) override
std::unique_ptr< std::string > table_
const std::string & get_model_name() const
std::unique_ptr< Expr > arg_
std::unique_ptr< Expr > lower_
FixedPtLiteral(std::string *n)
std::unique_ptr< Expr > arg_
SQLType(SQLTypes t, int p1)
std::unique_ptr< std::string > table_
const std::string getType() const
std::unique_ptr< std::string > fixedptval_
const std::string & get_role() const
static std::shared_ptr< Analyzer::Expr > analyzeValue(const int64_t intval)
const Expr * get_pattern_string() const
const std::string column_
std::string to_string() const
std::unique_ptr< std::string > table_
std::unique_ptr< std::string > return_message
RenameDBStmt(const rapidjson::Value &payload)
StringLiteral(std::string *s)
const Expr * get_select_expr() const
std::list< std::unique_ptr< Expr > > value_list_
void analyze(const Catalog_Namespace::Catalog &catalog, Analyzer::Query &query) const override
const std::string getTableName() const
InsertValuesStmt(const Catalog_Namespace::Catalog &catalog, const rapidjson::Value &payload)
DropUserStmt(std::string *n, bool e)
std::vector< std::string > grantees_
InsertStmt(std::string *t, std::list< std::string * > *c)
std::string to_string() const override
void populateData(QueryStateProxy, const TableDescriptor *td, bool validate_table, bool for_CTAS=false)
std::string to_string() const override
std::string to_string() const override
std::unique_ptr< Expr > left_
InsertValuesStmt(std::string *t, std::list< std::string * > *c, std::list< Expr * > *v)
std::unique_ptr< Expr > target_value_
const Expr * get_check_condition() const
UpdateStmt(std::string *t, std::list< Assignment * > *a, Expr *w)
std::shared_ptr< Analyzer::Expr > analyze(const Catalog_Namespace::Catalog &catalog, Analyzer::Query &query, TlistRefType allow_tlist_ref=TLIST_NONE) const override
std::shared_ptr< Analyzer::Expr > analyze(const Catalog_Namespace::Catalog &catalog, Analyzer::Query &query, TlistRefType allow_tlist_ref=TLIST_NONE) const override
static std::shared_ptr< Analyzer::Expr > normalize(const SQLOps optype, const SQLQualifier qual, std::shared_ptr< Analyzer::Expr > left_expr, std::shared_ptr< Analyzer::Expr > right_expr, const Executor *executor=nullptr)
const Expr * get_target_value() const
std::unique_ptr< Expr > upper_bound_
const std::string * get_table() const
std::string to_string() const override
std::list< std::unique_ptr< NameValueAssign > > options_
std::unique_ptr< Expr > arg_
const std::list< std::unique_ptr< OrderSpec > > & get_orderby_clause() const
AddColumnStmt(std::string *tab, std::list< ColumnDef * > *coldefs)
std::unique_ptr< std::string > table_
std::string to_string() const override=0
std::unique_ptr< std::string > column_name_
const std::list< std::unique_ptr< std::string > > & get_foreign_column_list() const
std::unique_ptr< std::string > new_username_
DropColumnStmt(std::string *tab, std::list< std::string * > *cols)
std::unique_ptr< std::string > file_path_
const std::string & get_foreign_table() const
std::shared_ptr< Analyzer::Expr > analyze(const Catalog_Namespace::Catalog &catalog, Analyzer::Query &query, TlistRefType allow_tlist_ref=TLIST_NONE) const override
std::string tarCompressionStr(CompressionType compression, const bool is_restore)
SQLOps get_optype() const
std::shared_ptr< Analyzer::Expr > analyze(const Catalog_Namespace::Catalog &catalog, Analyzer::Query &query, TlistRefType allow_tlist_ref=TLIST_NONE) const override
std::string deferred_copy_from_partitions_
void analyze(const Catalog_Namespace::Catalog &catalog, Analyzer::Query &query) const override=0
std::string to_string() const override
void parser_slistval_to_vector(std::list< std::string * > *l, std::vector< std::string > &v)
void execute(const Catalog_Namespace::SessionInfo &session, bool read_only_mode) override
std::shared_ptr< Analyzer::Expr > analyze(const Catalog_Namespace::Catalog &catalog, Analyzer::Query &query, TlistRefType allow_tlist_ref=TLIST_NONE) const override
OptimizeTableStmt(std::string *table, std::list< NameValueAssign * > *o)
const Literal * get_defaultval() const
std::unique_ptr< std::string > column_
std::string to_string() const
std::shared_ptr< Analyzer::Expr > analyze(const Catalog_Namespace::Catalog &catalog, Analyzer::Query &query, TlistRefType allow_tlist_ref=TLIST_NONE) const override=0
const Expr * get_arg() const
std::unique_ptr< QuerySpec > query_
Constants for Builtin SQL Types supported by HEAVY.AI.
CaseExpr(std::list< ExprPair * > *w, Expr *e)
ShardKeyDef(const std::string &column)
CreateDBStmt(std::string *n, std::list< NameValueAssign * > *l, const bool if_not_exists)
std::unique_ptr< std::string > user_name_
std::unique_ptr< std::string > table_
static void check_pattern_expr(const std::string &pattern_str, char escape_char)
std::unique_ptr< SQLType > column_type_
std::string model_predicted_var_
std::list< std::unique_ptr< Assignment > > assignment_list_
const Expr * get_where_clause() const
const std::vector< std::string > & get_roles() const
std::string to_string() const override
void rollback(const Catalog_Namespace::SessionInfo &parent_session_info, int tableId) override
bool get_is_unionall() const
std::unique_ptr< std::string > table_
SQLType(SQLTypes t, int p1, int p2, bool a)
AlterTableParamStmt(std::string *tab, NameValueAssign *p)
const std::string & get_column() const
std::vector< std::string > model_feature_vars_
TableRef(std::string *t, std::string *r)
std::unique_ptr< SQLType > target_type_
const std::string * get_table() const
const Expr * get_arg() const
std::vector< int64_t > feature_permutations_
AggregatedResult query(QueryStateProxy, std::string &sql_query_string, std::vector< size_t > outer_frag_indices, bool validate_only, bool allow_interrupt)
DropDBStmt(std::string *n, bool i)
const Expr * get_arg() const
SQLType(SQLTypes t, bool a, int array_size)
std::unique_ptr< Expr > else_expr_
void train_model(const Catalog_Namespace::SessionInfo &session)
std::list< std::unique_ptr< Expr > > value_list_
static bool translate_to_like_pattern(std::string &pattern_str, char escape_char)
const std::list< std::unique_ptr< Expr > > & get_value_list() const
ColumnConstraintDef(bool n, bool u, bool p, Literal *d)
ColumnRef(std::string *n1, std::string *n2)
SelectStmt(QueryExpr *q, std::list< OrderSpec * > *o, int64_t l, int64_t f)
void execute(const Catalog_Namespace::SessionInfo &session, bool read_only_mode) override
bool was_deferred_copy_from() const
std::unique_ptr< std::string > table_
TableArchiverS3Options s3_options_
std::unique_ptr< Expr > arg_
std::unique_ptr< std::string > table_
std::unique_ptr< std::string > name_
const std::string & get_object_type() const
CompressionType defaultCompression(bool is_restore)
const Expr * get_escape_string() const
std::unique_ptr< CompressDef > compression_
const Expr * get_lower_bound() const
IsNullExpr(bool n, Expr *a)
const std::string & get_object() const
auto const & getPreviousDatabaseName()
std::unique_ptr< Expr > escape_string_
void execute(const Catalog_Namespace::SessionInfo &session, bool read_only_mode)
void analyze_having_clause(const Catalog_Namespace::Catalog &catalog, Analyzer::Query &query) const
std::unique_ptr< std::string > database_name_
std::string to_string() const override
void execute(const Catalog_Namespace::SessionInfo &session, bool read_only_mode) override
const Expr * get_like_string() const
const std::string get_select_stmt() const
const std::vector< std::string > & get_grantees() const
std::unique_ptr< Expr > expr1_
void execute(const Catalog_Namespace::SessionInfo &session, bool read_only_mode) override
const Expr * get_arg() const
std::list< std::unique_ptr< std::string > > columns_
std::string to_string() const override
const std::string & get_select_query() const
This file contains the class specification and related data structures for Catalog.
std::vector< std::string > roles_
const std::string & get_role() const
bool get_calc_encoded_length() const
DumpTableStmt(const rapidjson::Value &payload)
std::ostringstream options_oss_
const SubqueryExpr * get_subquery() const
const std::list< std::unique_ptr< SelectEntry > > & get_select_clause() const
double data_split_train_fraction_
const std::string * getPath() const
std::unique_ptr< std::string > table_
std::shared_ptr< Analyzer::Expr > analyze(const Catalog_Namespace::Catalog &catalog, Analyzer::Query &query, TlistRefType allow_tlist_ref=TLIST_NONE) const override
void parse_model_options()
std::string to_string() const override
const std::string * getTable() const
void execute(const Catalog_Namespace::SessionInfo &session, bool read_only_mode) override
InSubquery(bool n, Expr *a, SubqueryExpr *q)
CreateRoleStmt(std::string *r)
void execute(const Catalog_Namespace::SessionInfo &session, bool read_only_mode) override
const std::string * get_table_name() const
void execute(const Catalog_Namespace::SessionInfo &session, bool read_only_mode) override
const ColumnRef * get_column() const
std::list< std::unique_ptr< NameValueAssign > > options_
const Expr * get_right() const
int32_t validate_and_get_fragment_size(const std::string &fragment_size_str)
const std::string * get_stringval() const
std::unique_ptr< std::string > select_stmt_
std::shared_ptr< Analyzer::Expr > analyze(const Catalog_Namespace::Catalog &catalog, Analyzer::Query &query, TlistRefType allow_tlist_ref=TLIST_NONE) const override
std::unique_ptr< QueryConnector > leafs_connector_
CONSTEXPR DEVICE bool is_null(const T &value)
std::string to_string() const override
ExprPair(Expr *e1, Expr *e2)
bool check_model_exists()
std::string build_model_query(const std::shared_ptr< Catalog_Namespace::SessionInfo > session_ptr)
const std::string * get_fixedptval() const
std::vector< std::string > roles_
const std::string & get_role() const
std::vector< std::string > grantees_
std::list< std::unique_ptr< NameValueAssign > > storage_options_
void execute(const Catalog_Namespace::SessionInfo &session, bool read_only_mode) override
ForeignKeyDef(std::list< std::string * > *cl, std::string *t, std::list< std::string * > *fcl)
const std::vector< std::string > & get_grantees() const
std::list< std::unique_ptr< ColumnDef > > coldefs_
std::unique_ptr< std::string > type_
std::shared_ptr< Analyzer::Expr > analyze(const Catalog_Namespace::Catalog &catalog, Analyzer::Query &query, TlistRefType allow_tlist_ref=TLIST_NONE) const override
std::unique_ptr< Parser::Stmt > create_stmt_for_json(const std::string &query_json)
std::list< TableNamePair > tablesToRename_
const std::list< std::unique_ptr< std::string > > & get_column_list() const
const std::list< std::unique_ptr< Expr > > & get_value_list() const
void analyze(const Catalog_Namespace::Catalog &catalog, Analyzer::Query &query) const override
void checkpoint(const Catalog_Namespace::SessionInfo &parent_session_info, int tableId) override
SharedDictionaryDef(const std::string &column, const std::string &foreign_table, const std::string foreign_column)
void execute(const Catalog_Namespace::SessionInfo &session, bool read_only_mode) override
const Expr * get_upper_bound() const
std::unique_ptr< std::string > role_
const Expr * get_check_condition() const
RestoreTableStmt(const rapidjson::Value &payload)
std::string & get_select_query()
const QueryExpr * get_left() const
virtual const std::string * get_table() const =0
const std::string & get_foreign_column() const
std::list< ColumnDef > get_columns_from_json_payload(const std::string &payload_key, const rapidjson::Value &payload)
std::unique_ptr< std::string > type_
void analyze_where_clause(const Catalog_Namespace::Catalog &catalog, Analyzer::Query &query) const
void execute(const Catalog_Namespace::SessionInfo &session, bool read_only_mode) override
const std::string * get_table() const
auto const & getUserName()
int64_t get_intval() const
const Expr * get_upper() const
CompressionType compression_
std::unique_ptr< ColumnRef > column_
std::string select_query_
std::string deferred_copy_from_file_name_
const std::list< std::unique_ptr< std::string > > & get_column_list() const
const Expr * get_where_clause() const
const std::list< std::unique_ptr< Expr > > & get_value_list() const
ColumnDef(std::string *c, SQLType *t, CompressDef *cp, ColumnConstraintDef *cc)
void execute(const Catalog_Namespace::SessionInfo &session, bool read_only_mode) override
std::string select_query_
RevokeRoleStmt(std::list< std::string * > *r, std::list< std::string * > *g)
std::unique_ptr< ColumnConstraintDef > column_constraint_
const std::string * get_column_name() const
const std::string & get_select_query() const
bool calc_encoded_length_
DropRoleStmt(std::string *r, bool e)
void execute(const Catalog_Namespace::SessionInfo &session, bool read_only_mode) override
const Expr * get_having_clause() const
std::string to_string() const override
FunctionRef(std::string *n, Expr *a)
std::unique_ptr< Expr > arg_
std::unique_ptr< NameValueAssign > param_
RenameTableStmt(const rapidjson::Value &payload)
CreateTableAsSelectStmt(const std::string *table_name, const std::string *select_query, const bool is_temporary, const bool if_not_exists, std::list< NameValueAssign * > *s)
specifies the content in-memory of a row in the column metadata table
const Expr * get_where_clause() const
const std::string * get_alias() const
std::unique_ptr< std::string > object_
BetweenExpr(bool n, Expr *a, Expr *l, Expr *u)
std::unique_ptr< std::string > table_
std::list< std::unique_ptr< NameValueAssign > > options_
std::string to_string() const override
const std::vector< std::string > & get_roles() const
const std::string foreign_table_
std::unique_ptr< Fragmenter_Namespace::InsertDataLoader::InsertConnector > leafs_connector_
std::list< std::unique_ptr< TableRef > > from_clause_
std::unique_ptr< std::string > table_
std::unique_ptr< std::string > new_column_name_
std::unique_ptr< Expr > pattern_string_
static void erase_cntl_chars(std::string &like_str, char escape_char)
void execute(const Catalog_Namespace::SessionInfo &session, bool read_only_mode) override
std::unique_ptr< Expr > where_clause_
std::vector< std::string > grantees_
std::unique_ptr< std::string > path_
const std::string * get_name() const
std::string to_string() const
AddColumnStmt(std::string *tab, ColumnDef *coldef)
bool get_is_primarykey() const
std::unique_ptr< QueryExpr > left_
std::unique_ptr< std::string > table_
std::unique_ptr< std::string > name_
std::unique_ptr< Literal > value_
std::unique_ptr< Expr > arg_
std::unique_ptr< std::string > user_name_
void check_executable(const Catalog_Namespace::SessionInfo &session, const TableDescriptor *td)
DropUserStmt(const rapidjson::Value &payload)
void execute(const Catalog_Namespace::SessionInfo &session, bool read_only_mode) override
SQLType(SQLTypes t, int p1, int p2, bool a, int array_size)
std::unique_ptr< std::string > role_
std::string to_string() const override
TruncateTableStmt(std::string *tab)
std::unique_ptr< std::string > table_name_
GrantRoleStmt(std::list< std::string * > *r, std::list< std::string * > *g)
const std::list< std::unique_ptr< Expr > > & get_groupby_clause() const
UnionQuery(bool u, QueryExpr *l, QueryExpr *r)
void analyze(const Catalog_Namespace::Catalog &catalog, Analyzer::Query &query) const override
const std::string * get_name() const
void execute(const Catalog_Namespace::SessionInfo &session, bool read_only_mode) override
std::shared_ptr< Analyzer::Expr > analyze(const Catalog_Namespace::Catalog &catalog, Analyzer::Query &query, TlistRefType allow_tlist_ref=TLIST_NONE) const override
void check_alter_table_privilege(const Catalog_Namespace::SessionInfo &session, const TableDescriptor *td)
const std::string * get_range_var() const
std::shared_ptr< Analyzer::Expr > analyze(const Catalog_Namespace::Catalog &catalog, Analyzer::Query &query, TlistRefType allow_tlist_ref=TLIST_NONE) const override
bool get_distinct() const
std::unique_ptr< Expr > partition_count_
static std::shared_ptr< Analyzer::Expr > analyzeValue(const std::string &stringval, const bool is_null)
DEVICE auto lower_bound(ARGS &&...args)
void insertDataToLeaf(const Catalog_Namespace::SessionInfo &parent_session_info, const size_t leaf_idx, Fragmenter_Namespace::InsertData &insert_data) override
std::pair< std::unique_ptr< std::string >, std::unique_ptr< std::string >> TableNamePair
std::string to_string() const override
const std::string * validate_and_get_str(T name_value_assign)
const std::vector< std::string > & get_grantees() const
const CompressDef * get_compression() const
const std::list< std::unique_ptr< TableElement > > & get_table_element_list() const override
CreateUserStmt(std::string *n, std::list< NameValueAssign * > *l)
std::string to_string() const override
std::list< std::unique_ptr< NameValueAssign > > options_
const Expr * get_lower() const
ArrayLiteral(std::list< Expr * > *v)
const std::list< std::unique_ptr< std::string > > & get_column_list() const
void execute_stmt_for_json(const std::string &query_json, std::shared_ptr< Catalog_Namespace::SessionInfo const > session_ptr, bool read_only_mode)
import_export::CopyParams deferred_copy_from_copy_params_
void execute(const Catalog_Namespace::SessionInfo &session, bool read_only_mode) override
bool isRepairTypeRemove() const
DropTableStmt(std::string *tab, bool i)
std::unique_ptr< Expr > where_clause_
std::shared_ptr< Analyzer::Expr > analyze(const Catalog_Namespace::Catalog &catalog, Analyzer::Query &query, TlistRefType allow_tlist_ref=TLIST_NONE) const override=0
std::vector< std::string > grantees_
void execute(const Catalog_Namespace::SessionInfo &session, bool read_only_mode) override
std::unique_ptr< QuerySpec > query_
CompressDef(std::string *n, int p)
InsertIntoTableAsSelectStmt(const rapidjson::Value &payload)
Encoding(std::string *encoding_name, int encoding_param)
std::unique_ptr< Expr > like_string_
void execute(const Catalog_Namespace::SessionInfo &session, bool read_only_mode) override
std::string select_query_
std::list< std::unique_ptr< std::string > > column_list_
SQLQualifier opqualifier_
std::shared_ptr< Analyzer::Expr > analyze(const Catalog_Namespace::Catalog &catalog, Analyzer::Query &query, TlistRefType allow_tlist_ref=TLIST_NONE) const override
~QueryConnector()=default
InsertIntoTableAsSelectStmt(const std::string *table_name, const std::string *select_query, std::list< std::string * > *c)
InValues(bool n, Expr *a, std::list< Expr * > *v)
const std::string * get_foreign_table() const
std::string to_string() const override
NameValueAssign(std::string *n, Literal *v)
std::shared_ptr< Analyzer::Expr > analyze(const Catalog_Namespace::Catalog &catalog, Analyzer::Query &query, TlistRefType allow_tlist_ref=TLIST_NONE) const override
std::list< std::unique_ptr< NameValueAssign > > storage_options_
const std::string column_
std::shared_ptr< Analyzer::Expr > analyze(const Catalog_Namespace::Catalog &catalog, Analyzer::Query &query, TlistRefType allow_tlist_ref=TLIST_NONE) const override
torch::Tensor f(torch::Tensor x, torch::Tensor W_target, torch::Tensor b_target)
CreateModelStmt(const rapidjson::Value &payload)
CharLengthExpr(Expr *a, bool e)
std::string to_string() const override
static std::shared_ptr< Analyzer::Expr > analyzeValue(const int64_t numericval, const int scale, const int precision)
auto const & getNewUserName()
std::unique_ptr< Expr > check_condition_
std::unique_ptr< QueryExpr > right_
std::string to_string() const override
std::unique_ptr< std::string > foreign_column_
void analyze_select_clause(const Catalog_Namespace::Catalog &catalog, Analyzer::Query &query) const
static bool test_is_simple_expr(const std::string &like_str, char escape_char)
void execute(const Catalog_Namespace::SessionInfo &session, bool read_only_mode) override
const std::vector< std::unique_ptr< ValuesList > > & get_value_lists() const
CreateViewStmt(const std::string &view_name, const std::string &select_query, const bool if_not_exists)
void push_back(Expr *value)
const std::string * get_foreign_table() const
virtual std::string to_string() const =0
virtual size_t getOuterFragmentCount(QueryStateProxy, std::string &sql_query_string)=0
const Expr * get_partition_count() const
void analyze_from_clause(const Catalog_Namespace::Catalog &catalog, Analyzer::Query &query) const
bool get_nulls_first() const
std::unique_ptr< std::string > type_
std::list< std::unique_ptr< SelectEntry > > select_clause_
DumpRestoreTableStmtBase(const rapidjson::Value &payload, const bool is_restore)
std::vector< std::unique_ptr< std::string > > column_list_
bool shouldVacuumDeletedRows() const
std::string filename(char const *path)
std::unique_ptr< std::string > alias_
virtual std::vector< AggregatedResult > query(QueryStateProxy, std::string &sql_query_string, std::vector< size_t > outer_frag_indices, bool allow_interrupt)=0
std::unique_ptr< std::string > db_name_
std::unique_ptr< Expr > escape_string_
RenameUserStmt(std::string *username, std::string *new_username)
std::string to_string() const override
void execute(const Catalog_Namespace::SessionInfo &session, bool read_only_mode) override
std::shared_ptr< Analyzer::Expr > analyze(const Catalog_Namespace::Catalog &catalog, Analyzer::Query &query, TlistRefType allow_tlist_ref=TLIST_NONE) const override
std::string to_string() const override
bool get_is_primarykey() const
virtual std::shared_ptr< Analyzer::Expr > analyze(const Catalog_Namespace::Catalog &catalog, Analyzer::Query &query, TlistRefType allow_tlist_ref=TLIST_NONE) const =0
bool g_enable_watchdog false
std::unique_ptr< std::string > target_
void execute(const Catalog_Namespace::SessionInfo &session, bool read_only_mode) override
std::shared_ptr< Analyzer::Expr > analyze(const Catalog_Namespace::Catalog &catalog, Analyzer::Query &query, TlistRefType allow_tlist_ref=TLIST_NONE) const override
std::unique_ptr< std::string > column_
void execute(const Catalog_Namespace::SessionInfo &session, bool read_only_mode) override
Assignment(std::string *c, Expr *a)
std::list< std::unique_ptr< std::string > > foreign_column_list_
std::unique_ptr< Expr > upper_
std::unique_ptr< std::string > range_var_
CreateDataframeStmt(std::string *tab, std::list< TableElement * > *table_elems, std::string *filename, std::list< NameValueAssign * > *s)
std::list< std::unique_ptr< OrderSpec > > orderby_clause_
const std::vector< std::string > & get_privs() const
std::vector< std::string > privileges_
CopyTableStmt(std::string *t, std::string *f, std::list< NameValueAssign * > *o)
std::shared_ptr< Analyzer::Expr > analyze(const Catalog_Namespace::Catalog &catalog, Analyzer::Query &query, TlistRefType allow_tlist_ref=TLIST_NONE) const override
std::unique_ptr< ColumnDef > column_from_json(const rapidjson::Value &element)
std::list< std::unique_ptr< NameValueAssign > > options_
bool get_is_distinct() const
std::string to_string() const override
const std::string & get_object_type() const
std::unique_ptr< Expr > arg_
std::shared_ptr< Analyzer::Expr > analyze(const Catalog_Namespace::Catalog &catalog, Analyzer::Query &query, TlistRefType allow_tlist_ref=TLIST_NONE) const override
const std::vector< std::string > & get_grantees() const
ColumnConstraintDef(std::string *t, std::string *c)
SubqueryExpr(QuerySpec *q)
std::shared_ptr< Analyzer::Expr > analyze(const Catalog_Namespace::Catalog &catalog, Analyzer::Query &query, TlistRefType allow_tlist_ref=TLIST_NONE) const override
std::string to_string() const override
const std::string * get_foreign_column() const
void execute(const Catalog_Namespace::SessionInfo &session, bool read_only_mode) override
std::string to_string() const override
std::list< std::unique_ptr< std::string > > column_list_
std::vector< std::unique_ptr< ValuesList > > values_lists_
The data to be inserted using the fragment manager.
const std::string * get_table() const
const Expr * get_left() const
std::list< std::unique_ptr< std::string > > column_list_
void execute(const Catalog_Namespace::SessionInfo &session, bool read_only_mode) override
const std::vector< std::string > & get_privs() const
void analyze_group_by(const Catalog_Namespace::Catalog &catalog, Analyzer::Query &query) const
std::unique_ptr< std::string > role_
void analyze(const Catalog_Namespace::Catalog &catalog, Analyzer::Query &query) const override
const Expr * get_expr2() const
std::shared_ptr< Analyzer::Expr > analyze(const Catalog_Namespace::Catalog &catalog, Analyzer::Query &query, TlistRefType allow_tlist_ref=TLIST_NONE) const override
std::list< ColumnDescriptor > getColumnDescriptors(AggregatedResult &result, bool for_create)
const std::string * get_view_name() const
const QuerySpec * get_query() const
const std::string * get_table() const override
void execute(const Catalog_Namespace::SessionInfo &session, bool read_only_mode) override
Common Enum definitions for SQL processing.
std::unique_ptr< Literal > defaultval_
std::unique_ptr< QueryExpr > query_expr_
void execute(const Catalog_Namespace::SessionInfo &session, bool read_only_mode) override
WidthBucketExpr(Expr *t, Expr *l, Expr *u, Expr *p)
auto const & getOldUserName()
auto const & getModelName()
const std::string & get_object() const
std::unique_ptr< std::string > foreign_table_
ColumnRef(std::string *n1)
std::string to_string() const override
std::string to_string() const override
const QuerySpec * get_query() const
std::unique_ptr< std::string > table_
std::unique_ptr< std::string > column_
const std::string & get_view_name() const
void execute(const Catalog_Namespace::SessionInfo &session, bool read_only_mode) override
AlterUserStmt(const rapidjson::Value &payload)
LikeExpr(bool n, bool i, Expr *a, Expr *l, Expr *e)
const Expr * get_escape_string() const
std::list< std::unique_ptr< ExprPair > > when_then_list_
virtual void execute(const Catalog_Namespace::SessionInfo &session, bool read_only_mode)=0
FunctionRef(std::string *n)
void execute(const Catalog_Namespace::SessionInfo &session, bool read_only_mode) override
std::shared_ptr< Analyzer::Expr > analyze(const Catalog_Namespace::Catalog &catalog, Analyzer::Query &query, TlistRefType allow_tlist_ref=TLIST_NONE) const override
std::unique_ptr< Expr > lower_bound_
OperExpr(SQLOps t, Expr *l, Expr *r)
std::list< std::unique_ptr< TableElement > > table_element_list_
const CompressionType getCompression() const
std::shared_ptr< Analyzer::Expr > analyze(const Catalog_Namespace::Catalog &catalog, Analyzer::Query &query, TlistRefType allow_tlist_ref=TLIST_NONE) const override
const QueryExpr * get_query_expr() const
RenameColumnStmt(std::string *tab, std::string *col, std::string *new_col_name)
std::shared_ptr< Analyzer::Expr > analyze(const Catalog_Namespace::Catalog &catalog, Analyzer::Query &query, TlistRefType allow_tlist_ref=TLIST_NONE) const override
auto const & getNewDatabaseName()
ValuesList(std::list< Expr * > *values)
CreateTableAsSelectStmt(const rapidjson::Value &payload)
CompressionType validateCompression(const std::string &compression, const bool is_restore)
const std::list< std::unique_ptr< Assignment > > & get_assignment_list() const
DropModelStmt(const rapidjson::Value &payload)
void execute(const Catalog_Namespace::SessionInfo &session, bool read_only_mode) override
std::shared_ptr< Analyzer::Expr > analyze(const Catalog_Namespace::Catalog &catalog, Analyzer::Query &query, TlistRefType allow_tlist_ref=TLIST_NONE) const override
FunctionRef(std::string *n, bool d, Expr *a)
DropDBStmt(const rapidjson::Value &payload)
AlterUserStmt(std::string *n, std::list< NameValueAssign * > *l)
std::unique_ptr< std::string > table_
std::unique_ptr< Expr > arg_
ColumnConstraintDef(Expr *c)
std::unique_ptr< Parser::Stmt > create_stmt_for_query(const std::string &queryStr, const Catalog_Namespace::SessionInfo &session_info)
RenameDBStmt(std::string *database_name, std::string *new_database_name)
const Expr * get_arg() const
OrderSpec(int n, ColumnRef *c, bool d, bool f)
std::list< std::unique_ptr< Expr > > value_list
void insertChunksToLeaf(const Catalog_Namespace::SessionInfo &parent_session_info, const size_t leaf_idx, const Fragmenter_Namespace::InsertChunks &insert_chunks) override
CreateUserStmt(const rapidjson::Value &payload)
std::unique_ptr< Expr > arg_
double get_doubleval() const
RegexpExpr(bool n, Expr *a, Expr *p, Expr *e)
const std::string & get_object_type() const
std::unique_ptr< std::string > filename_
ShowPrivilegesStmt(std::string *t, std::string *o, std::string *r)
UniqueDef(bool p, std::list< std::string * > *cl)
void execute(const Catalog_Namespace::SessionInfo &session, bool read_only_mode) override
const std::string * get_table() const
SelectEntry(Expr *e, std::string *r)
void execute(const Catalog_Namespace::SessionInfo &session, bool read_only_mode) override
const QueryExpr * get_right() const
std::unique_ptr< std::string > object_type_
void analyze(const Catalog_Namespace::Catalog &catalog, Analyzer::Query &query) const override
std::string to_string() const override
std::unique_ptr< std::string > table_
const Expr * get_expr1() const
std::shared_ptr< Analyzer::Expr > analyze(const Catalog_Namespace::Catalog &catalog, Analyzer::Query &query, TlistRefType allow_tlist_ref=TLIST_NONE) const override
const std::string & get_object() const
const std::string * get_column() const
size_t leafCount() override
std::unique_ptr< ColumnDef > coldef_
std::unique_ptr< Expr > arg_
static void check_like_expr(const std::string &like_str, char escape_char)
void execute(const Catalog_Namespace::SessionInfo &session, bool read_only_mode) override
void execute(const Catalog_Namespace::SessionInfo &session, bool read_only_mode) override
const std::list< std::unique_ptr< TableRef > > & get_from_clause() const
auto const & getDatabaseName()
DeleteStmt(std::string *t, Expr *w)
const Expr * get_assignment() const