OmniSciDB
a5dc49c757
|
Namespaces | |
anonymous_namespace{ParserNode.cpp} | |
anonymous_namespace{ParserNode.h} | |
Compress | |
Typedefs | |
using | SubstituteMap = std::map< std::string, std::string > |
Functions | |
bool | check_session_interrupted (const QuerySessionId &query_session, Executor *executor) |
std::vector< int > | getTableChunkKey (const TableDescriptor *td, Catalog_Namespace::Catalog &catalog) |
bool | should_translate_strings (const std::shared_ptr< Analyzer::Expr > &lhs_expr, const std::shared_ptr< Analyzer::Expr > &rhs_expr) |
SQLTypeInfo const & | get_str_dict_cast_type (const SQLTypeInfo &lhs_type_info, const SQLTypeInfo &rhs_type_info, const Executor *executor) |
SQLTypeInfo | common_string_type (const SQLTypeInfo &lhs_type_info, const SQLTypeInfo &rhs_type_info, const Executor *executor) |
std::unique_ptr< ColumnDef > | column_from_json (const rapidjson::Value &element) |
std::list< ColumnDef > | get_columns_from_json_payload (const std::string &payload_key, const rapidjson::Value &payload) |
std::string | write_model_params_to_json (const std::string &predicted, const std::vector< std::string > &features, const std::string &training_query, const double data_split_train_fraction, const double data_split_eval_fraction, const std::vector< int64_t > &feature_permutations) |
std::shared_ptr< ResultSet > | getResultSet (QueryStateProxy query_state_proxy, const std::string select_stmt, std::vector< TargetMetaInfo > &targets, bool validate_only=false, std::vector< size_t > outer_fragment_indices={}, bool allow_interrupt=false) |
bool | repair_type (std::list< std::unique_ptr< NameValueAssign >> &options) |
void | check_alter_table_privilege (const Catalog_Namespace::SessionInfo &session, const TableDescriptor *td) |
void | set_column_descriptor (ColumnDescriptor &cd, const ColumnDef *coldef) |
std::vector< std::string > | splitObjectHierName (const std::string &hierName) |
std::string | extractObjectNameFromHierName (const std::string &objectHierName, const std::string &objectType, const Catalog_Namespace::Catalog &cat) |
static std::pair < AccessPrivileges, DBObjectType > | parseStringPrivs (const std::string &privs, const DBObjectType &objectType, const std::string &object_name) |
static DBObject | createObject (const std::string &objectName, DBObjectType objectType) |
static void | verifyObject (Catalog_Namespace::Catalog &sessionCatalog, const std::string &objectName, DBObjectType objectType, const std::string &command) |
static void | checkStringLiteral (const std::string &option_name, const std::unique_ptr< NameValueAssign > &p) |
static bool | readBooleanLiteral (const std::string &option_name, const std::unique_ptr< NameValueAssign > &p) |
std::unique_ptr< Parser::Stmt > | create_stmt_for_query (const std::string &queryStr, const Catalog_Namespace::SessionInfo &session_info) |
std::unique_ptr< Parser::Stmt > | create_stmt_for_json (const std::string &query_json) |
void | execute_stmt_for_json (const std::string &query_json, std::shared_ptr< Catalog_Namespace::SessionInfo const > session_ptr, bool read_only_mode) |
int32_t | validate_and_get_fragment_size (const std::string &fragment_size_str) |
void | parser_slistval_to_vector (std::list< std::string * > *l, std::vector< std::string > &v) |
using Parser::SubstituteMap = typedef std::map<std::string, std::string> |
Definition at line 5191 of file ParserNode.cpp.
void Parser::check_alter_table_privilege | ( | const Catalog_Namespace::SessionInfo & | session, |
const TableDescriptor * | td | ||
) |
Definition at line 5097 of file ParserNode.cpp.
References AccessPrivileges::ALTER_TABLE, Catalog_Namespace::SessionInfo::get_currentUser(), Catalog_Namespace::SessionInfo::getCatalog(), lockmgr::instance(), Catalog_Namespace::UserMetadata::isSuper, DBObject::loadKey(), DBObject::setPrivileges(), TableDBObjectType, TableDescriptor::tableName, TableDescriptor::userId, and Catalog_Namespace::UserMetadata::userId.
Referenced by AlterTableAlterColumnCommand::alterColumn(), Parser::AddColumnStmt::check_executable(), Parser::RenameTableStmt::execute(), Parser::RenameColumnStmt::execute(), Parser::DropColumnStmt::execute(), and Parser::AlterTableParamStmt::execute().
bool Parser::check_session_interrupted | ( | const QuerySessionId & | query_session, |
Executor * | executor | ||
) |
Definition at line 107 of file ParserNode.cpp.
References g_enable_non_kernel_time_query_interrupt.
Referenced by Parser::InsertIntoTableAsSelectStmt::populateData().
|
static |
Definition at line 6851 of file ParserNode.cpp.
References CHECK.
Referenced by Parser::CreateDBStmt::execute(), Parser::CreateUserStmt::execute(), and Parser::AlterUserStmt::execute().
std::unique_ptr< ColumnDef > Parser::column_from_json | ( | const rapidjson::Value & | element | ) |
Definition at line 3153 of file ParserNode.cpp.
References CHECK, json_bool(), json_i64(), json_str(), and to_sql_type().
Referenced by AlterTableCommand::execute(), get_columns_from_json_payload(), and Parser::anonymous_namespace{ParserNode.cpp}::parse_elements().
SQLTypeInfo Parser::common_string_type | ( | const SQLTypeInfo & | lhs_type_info, |
const SQLTypeInfo & | rhs_type_info, | ||
const Executor * | executor | ||
) |
Definition at line 355 of file ParserNode.cpp.
References CHECK, shared::StringDictKey::dict_id, SQLTypeInfo::get_dimension(), get_str_dict_cast_type(), SQLTypeInfo::getStringDictKey(), SQLTypeInfo::is_dict_encoded_string(), SQLTypeInfo::is_none_encoded_string(), SQLTypeInfo::is_string(), SQLTypeInfo::set_dimension(), and TRANSIENT_DICT.
Referenced by Parser::CaseExpr::normalize().
std::unique_ptr< Parser::Stmt > Parser::create_stmt_for_json | ( | const std::string & | query_json | ) |
Definition at line 7294 of file ParserNode.cpp.
References CHECK, UNREACHABLE, and VLOG.
Referenced by create_stmt_for_query(), QueryRunner::QueryRunner::createStatement(), and execute_stmt_for_json().
std::unique_ptr< Parser::Stmt > Parser::create_stmt_for_query | ( | const std::string & | queryStr, |
const Catalog_Namespace::SessionInfo & | session_info | ||
) |
Helper functions for parsing the DDL returned from calcite as part of the plan result to a parser node in this class. Currently only used in QueryRunner/DistributedQueryRunner, where we do not want to link in the thrift dependencies wich DdlCommandExecutor currently brings along.
Definition at line 7269 of file ParserNode.cpp.
References cat(), query_state::QueryState::create(), create_stmt_for_json(), g_enable_watchdog, Catalog_Namespace::SessionInfo::getCatalog(), Catalog_Namespace::SysCatalog::instance(), Catalog_Namespace::SysCatalog::isAggregator(), and pg_shim().
Referenced by TableArchiver::restoreTable(), and DBHandler::sql_execute_impl().
|
static |
Definition at line 6113 of file ParserNode.cpp.
References DashboardDBObjectType.
Referenced by Parser::GrantPrivilegesStmt::execute(), Parser::RevokePrivilegesStmt::execute(), and Parser::ShowPrivilegesStmt::execute().
void Parser::execute_stmt_for_json | ( | const std::string & | query_json, |
std::shared_ptr< Catalog_Namespace::SessionInfo const > | session_ptr, | ||
bool | read_only_mode | ||
) |
Definition at line 7374 of file ParserNode.cpp.
References create_stmt_for_json(), and Parser::DDLStmt::execute().
std::string Parser::extractObjectNameFromHierName | ( | const std::string & | objectHierName, |
const std::string & | objectType, | ||
const Catalog_Namespace::Catalog & | cat | ||
) |
Definition at line 5976 of file ParserNode.cpp.
References splitObjectHierName().
Referenced by Parser::GrantPrivilegesStmt::execute(), Parser::RevokePrivilegesStmt::execute(), and Parser::ShowPrivilegesStmt::execute().
std::list< ColumnDef > Parser::get_columns_from_json_payload | ( | const std::string & | payload_key, |
const rapidjson::Value & | payload | ||
) |
Definition at line 3230 of file ParserNode.cpp.
References CHECK, column_from_json(), logger::FATAL, json_str(), and LOG.
Referenced by AlterTableAlterColumnCommand::alterColumn().
SQLTypeInfo const& Parser::get_str_dict_cast_type | ( | const SQLTypeInfo & | lhs_type_info, |
const SQLTypeInfo & | rhs_type_info, | ||
const Executor * | executor | ||
) |
Definition at line 332 of file ParserNode.cpp.
References CHECK, CHECK_NE, SQLTypeInfo::get_compression(), SQLTypeInfo::getStringDictKey(), SQLTypeInfo::is_string(), and kENCODING_DICT.
Referenced by common_string_type(), and Parser::OperExpr::normalize().
std::shared_ptr<ResultSet> Parser::getResultSet | ( | QueryStateProxy | query_state_proxy, |
const std::string | select_stmt, | ||
std::vector< TargetMetaInfo > & | targets, | ||
bool | validate_only = false , |
||
std::vector< size_t > | outer_fragment_indices = {} , |
||
bool | allow_interrupt = false |
||
) |
Definition at line 3873 of file ParserNode.cpp.
Referenced by Parser::LocalQueryConnector::query().
std::vector<int> Parser::getTableChunkKey | ( | const TableDescriptor * | td, |
Catalog_Namespace::Catalog & | catalog | ||
) |
Definition at line 119 of file ParserNode.cpp.
References Catalog_Namespace::DBMetadata::dbId, TableDescriptor::fragmenter, Catalog_Namespace::Catalog::getCurrentDB(), and TableDescriptor::tableId.
|
inline |
Definition at line 1541 of file ParserNode.h.
References CHECK.
Referenced by Parser::GrantPrivilegesStmt::GrantPrivilegesStmt(), Parser::GrantRoleStmt::GrantRoleStmt(), Parser::RevokePrivilegesStmt::RevokePrivilegesStmt(), and Parser::RevokeRoleStmt::RevokeRoleStmt().
|
static |
Definition at line 6010 of file ParserNode.cpp.
References AccessPrivileges::ACCESS, AccessPrivileges::ALL_DASHBOARD, AccessPrivileges::ALL_DATABASE, AccessPrivileges::ALL_SERVER, AccessPrivileges::ALL_TABLE, AccessPrivileges::ALL_VIEW, AccessPrivileges::ALTER_SERVER, AccessPrivileges::ALTER_TABLE, AccessPrivileges::CREATE_DASHBOARD, AccessPrivileges::CREATE_SERVER, AccessPrivileges::CREATE_TABLE, AccessPrivileges::CREATE_VIEW, DashboardDBObjectType, DatabaseDBObjectType, AccessPrivileges::DELETE_DASHBOARD, AccessPrivileges::DELETE_FROM_TABLE, AccessPrivileges::DROP_SERVER, AccessPrivileges::DROP_TABLE, AccessPrivileges::DROP_VIEW, AccessPrivileges::EDIT_DASHBOARD, AccessPrivileges::INSERT_INTO_TABLE, run_benchmark_import::result, AccessPrivileges::SELECT_FROM_TABLE, AccessPrivileges::SELECT_FROM_VIEW, AccessPrivileges::SERVER_USAGE, ServerDBObjectType, TableDBObjectType, AccessPrivileges::TRUNCATE_TABLE, AccessPrivileges::UPDATE_IN_TABLE, AccessPrivileges::VIEW_DASHBOARD, AccessPrivileges::VIEW_SQL_EDITOR, and ViewDBObjectType.
Referenced by Parser::GrantPrivilegesStmt::execute(), and Parser::RevokePrivilegesStmt::execute().
|
static |
Definition at line 6943 of file ParserNode.cpp.
References CHECK.
Referenced by Parser::CreateUserStmt::execute(), and Parser::AlterUserStmt::execute().
bool Parser::repair_type | ( | std::list< std::unique_ptr< NameValueAssign >> & | options | ) |
Definition at line 5053 of file ParserNode.cpp.
References CHECK.
Referenced by Parser::ValidateStmt::ValidateStmt().
void Parser::set_column_descriptor | ( | ColumnDescriptor & | cd, |
const ColumnDef * | coldef | ||
) |
Definition at line 5335 of file ParserNode.cpp.
References Parser::ColumnDef::get_column_constraint(), Parser::ColumnDef::get_column_name(), Parser::ColumnDef::get_column_type(), Parser::ColumnDef::get_compression(), Parser::ColumnConstraintDef::get_defaultval(), ddl_utils::SqlType::get_is_array(), Parser::ColumnConstraintDef::get_notnull(), Parser::StringLiteral::get_stringval(), and ddl_utils::set_column_descriptor().
Referenced by anonymous_namespace{DdlCommandExecutor.cpp}::get_alter_column_src_dst_cds(), and Parser::DDLStmt::setColumnDescriptor().
bool Parser::should_translate_strings | ( | const std::shared_ptr< Analyzer::Expr > & | lhs_expr, |
const std::shared_ptr< Analyzer::Expr > & | rhs_expr | ||
) |
Definition at line 317 of file ParserNode.cpp.
References CHECK.
Referenced by Parser::OperExpr::normalize().
std::vector<std::string> Parser::splitObjectHierName | ( | const std::string & | hierName | ) |
Definition at line 5970 of file ParserNode.cpp.
References split().
Referenced by extractObjectNameFromHierName().
int32_t Parser::validate_and_get_fragment_size | ( | const std::string & | fragment_size_str | ) |
Definition at line 7385 of file ParserNode.cpp.
References to_string().
Referenced by Parser::anonymous_namespace{ParserNode.cpp}::get_frag_size_def(), and CreateForeignTableCommand::setTableDetails().
|
static |
Definition at line 6132 of file ParserNode.cpp.
References DBObjectTypeToString(), Catalog_Namespace::Catalog::getMetadataForTable(), TableDescriptor::isView, TableDBObjectType, and ViewDBObjectType.
Referenced by Parser::GrantPrivilegesStmt::execute(), Parser::RevokePrivilegesStmt::execute(), and Parser::ShowPrivilegesStmt::execute().
std::string Parser::write_model_params_to_json | ( | const std::string & | predicted, |
const std::vector< std::string > & | features, | ||
const std::string & | training_query, | ||
const double | data_split_train_fraction, | ||
const double | data_split_eval_fraction, | ||
const std::vector< int64_t > & | feature_permutations | ||
) |
Definition at line 3485 of file ParserNode.cpp.
Referenced by Parser::CreateModelStmt::train_model().