OmniSciDB
72c90bc290
|
class for a per-database catalog. also includes metadata for the current database and the current user. More...
#include <Catalog.h>
Classes | |
struct | NoTableFoundException |
Public Member Functions | |
Catalog (const std::string &basePath, const DBMetadata &curDB, std::shared_ptr< Data_Namespace::DataMgr > dataMgr, const std::vector< LeafHostInfo > &string_dict_hosts, std::shared_ptr< Calcite > calcite, bool is_new_db) | |
Constructor - takes basePath to already extant data directory for writing. More... | |
Catalog () | |
Constructor builds a hollow catalog used during constructor of other catalogs. More... | |
~Catalog () | |
Destructor - deletes all ColumnDescriptor and TableDescriptor structures which were allocated on the heap and writes Catalog to Sqlite. More... | |
void | createTable (TableDescriptor &td, const std::list< ColumnDescriptor > &columns, const std::vector< Parser::SharedDictionaryDef > &shared_dict_defs, bool isLogicalTable) |
void | createShardedTable (TableDescriptor &td, const std::list< ColumnDescriptor > &columns, const std::vector< Parser::SharedDictionaryDef > &shared_dict_defs) |
int32_t | createDashboard (DashboardDescriptor &vd) |
void | replaceDashboard (DashboardDescriptor &vd) |
std::string | createLink (LinkDescriptor &ld, size_t min_length) |
void | dropTable (const TableDescriptor *td) |
void | truncateTable (const TableDescriptor *td) |
void | renameTable (const TableDescriptor *td, const std::string &newTableName) |
void | renameTables (const std::vector< std::pair< std::string, std::string >> &names) |
void | renameColumn (const TableDescriptor *td, const ColumnDescriptor *cd, const std::string &newColumnName) |
int | getNextAddedColumnId (const TableDescriptor &td) |
void | addColumn (const TableDescriptor &td, ColumnDescriptor &cd) |
void | addColumnTransactional (const TableDescriptor &td, ColumnDescriptor &cd) |
void | alterColumnTypeTransactional (const ColumnDescriptor &cd) |
void | dropColumnTransactional (const TableDescriptor &td, const ColumnDescriptor &cd) |
void | dropColumnNontransactional (const TableDescriptor &td, const ColumnDescriptor &cd) |
void | dropColumn (const TableDescriptor &td, const ColumnDescriptor &cd) |
void | dropColumnPolicies (const TableDescriptor &td, const ColumnDescriptor &cd) |
void | invalidateCachesForTable (const int table_id) |
void | removeFragmenterForTable (const int table_id) const |
const std::map< int, const ColumnDescriptor * > | getDictionaryToColumnMapping () |
const TableDescriptor * | getMetadataForTable (const std::string &tableName, const bool populateFragmenter=true) const |
Returns a pointer to a const TableDescriptor struct matching the provided tableName. More... | |
const TableDescriptor * | getMetadataForTable (int tableId, bool populateFragmenter=true) const |
std::optional< std::string > | getTableName (int32_t table_id) const |
std::optional< int32_t > | getTableId (const std::string &table_name) const |
const ColumnDescriptor * | getMetadataForColumn (int tableId, const std::string &colName) const |
const ColumnDescriptor * | getMetadataForColumn (int tableId, int columnId) const |
const std::optional< std::string > | getColumnName (int table_id, int column_id) const |
const int | getColumnIdBySpi (const int tableId, const size_t spi) const |
const ColumnDescriptor * | getMetadataForColumnBySpi (const int tableId, const size_t spi) const |
const DashboardDescriptor * | getMetadataForDashboard (const std::string &userId, const std::string &dashName) const |
const DashboardDescriptor * | getMetadataForDashboard (const int32_t dashboard_id) const |
void | deleteMetadataForDashboards (const std::vector< int32_t > ids, const UserMetadata &user) |
const LinkDescriptor * | getMetadataForLink (const std::string &link) const |
const LinkDescriptor * | getMetadataForLink (int linkId) const |
const foreign_storage::ForeignTable * | getForeignTable (const std::string &tableName) const |
const foreign_storage::ForeignTable * | getForeignTable (int table_id) const |
std::list< const ColumnDescriptor * > | getAllColumnMetadataForTable (const int tableId, const bool fetchSystemColumns, const bool fetchVirtualColumns, const bool fetchPhysicalColumns) const |
Returns a list of pointers to constant ColumnDescriptor structs for all the columns from a particular table specified by table id. More... | |
std::list< const TableDescriptor * > | getAllTableMetadata () const |
std::vector< TableDescriptor > | getAllTableMetadataCopy () const |
std::list< const DashboardDescriptor * > | getAllDashboardsMetadata () const |
std::vector< DashboardDescriptor > | getAllDashboardsMetadataCopy () const |
const DBMetadata & | getCurrentDB () const |
Data_Namespace::DataMgr & | getDataMgr () const |
std::shared_ptr< Calcite > | getCalciteMgr () const |
void | setCalciteMgr (const std::shared_ptr< Calcite > &new_calcite_mgr) |
const std::string & | getCatalogBasePath () const |
const DictDescriptor * | getMetadataForDict (int dict_ref, bool loadDict=true) const |
const std::vector< LeafHostInfo > & | getStringDictionaryHosts () const |
const ColumnDescriptor * | getShardColumnMetadataForTable (const TableDescriptor *td) const |
std::vector< const TableDescriptor * > | getPhysicalTablesDescriptors (const TableDescriptor *logical_table_desc, bool populate_fragmenter=true) const |
std::vector< std::pair < int32_t, int32_t > > | getAllPersistedTableAndShardIds () const |
std::vector< std::string > | getTableNamesForUser (const UserMetadata &user, const GetTablesType get_tables_type) const |
std::vector< TableMetadata > | getTablesMetadataForUser (const UserMetadata &user_metadata, const GetTablesType get_tables_type, const std::string &filter_table_name) const |
int32_t | getTableEpoch (const int32_t db_id, const int32_t table_id) const |
void | setTableEpoch (const int db_id, const int table_id, const int new_epoch) |
void | setMaxRollbackEpochs (const int32_t table_id, const int32_t max_rollback_epochs) |
void | setMaxRows (const int32_t table_id, const int64_t max_rows) |
std::vector< TableEpochInfo > | getTableEpochs (const int32_t db_id, const int32_t table_id) const |
void | setTableEpochs (const int32_t db_id, const std::vector< TableEpochInfo > &table_epochs) const |
void | setTableEpochsLogExceptions (const int32_t db_id, const std::vector< TableEpochInfo > &table_epochs) const |
int | getDatabaseId () const |
SqliteConnector & | getSqliteConnector () |
void | rollLegacy (const bool forward) |
void | getDictionary (const ColumnDescriptor &cd, std::map< int, StringDictionary * > &stringDicts) |
size_t | getTotalMemorySizeForDictionariesForDatabase () const |
DictRef | addDictionaryTransactional (ColumnDescriptor &cd) |
void | delDictionaryTransactional (const ColumnDescriptor &cd) |
std::list< const DictDescriptor * > | getAllDictionariesWithColumnInName (const ColumnDescriptor *cd) |
const bool | checkMetadataForDeletedRecs (const TableDescriptor *td, int column_id) const |
const ColumnDescriptor * | getDeletedColumn (const TableDescriptor *td) const |
const ColumnDescriptor * | getDeletedColumnIfRowsDeleted (const TableDescriptor *td) const |
void | setDeletedColumn (const TableDescriptor *td, const ColumnDescriptor *cd) |
int | getLogicalTableId (const int physicalTableId) const |
void | checkpoint (const int logicalTableId) const |
void | checkpointWithAutoRollback (const int logical_table_id) const |
void | resetTableEpochFloor (const int logicalTableId) const |
std::string | name () const |
void | eraseDbMetadata () |
void | eraseDbPhysicalData () |
void | eraseTablePhysicalData (const TableDescriptor *td) |
void | setForReload (const int32_t tableId) |
std::vector< std::string > | getTableDataDirectories (const TableDescriptor *td) const |
std::vector< std::string > | getTableDictDirectories (const TableDescriptor *td) const |
std::set< std::string > | getTableDictDirectoryPaths (int32_t table_id) const |
std::string | getColumnDictDirectory (const ColumnDescriptor *cd, bool file_name_only=true) const |
std::string | dumpSchema (const TableDescriptor *td) const |
std::string | dumpCreateTable (const TableDescriptor *td, bool multiline_formatting=true, bool dump_defaults=false) const |
std::optional< std::string > | dumpCreateTable (int32_t table_id, bool multiline_formatting=true, bool dump_defaults=false) const |
std::string | dumpCreateServer (const std::string &name, bool multiline_formatting=true) const |
void | createForeignServer (std::unique_ptr< foreign_storage::ForeignServer > foreign_server, bool if_not_exists) |
const foreign_storage::ForeignServer * | getForeignServer (const std::string &server_name) const |
const std::unique_ptr< const foreign_storage::ForeignServer > | getForeignServerFromStorage (const std::string &server_name) |
const std::unique_ptr< const foreign_storage::ForeignTable > | getForeignTableFromStorage (int table_id) |
void | changeForeignServerOwner (const std::string &server_name, const int new_owner_id) |
void | setForeignServerDataWrapper (const std::string &server_name, const std::string &data_wrapper) |
void | setForeignServerOptions (const std::string &server_name, const std::string &options) |
void | renameForeignServer (const std::string &server_name, const std::string &name) |
void | dropForeignServer (const std::string &server_name) |
std::vector< const foreign_storage::ForeignTable * > | getAllForeignTablesForForeignServer (const int32_t foreign_server_id) |
Get all of the foreign tables for associated with a foreign server id. More... | |
void | getForeignServersForUser (const rapidjson::Value *filters, const UserMetadata &user, std::vector< const foreign_storage::ForeignServer * > &results) |
void | createDefaultServersIfNotExists () |
bool | validateNonExistentTableOrView (const std::string &name, const bool if_not_exists) |
std::vector< const TableDescriptor * > | getAllForeignTablesForRefresh () const |
void | updateForeignTableRefreshTimes (const int32_t table_id) |
void | setForeignTableOptions (const std::string &table_name, foreign_storage::OptionsMap &options_map, bool clear_existing_options=true) |
void | updateLeaf (const LeafHostInfo &string_dict_host) |
void | setUncappedTableEpoch (const std::string &table_name) |
int32_t | createCustomExpression (std::unique_ptr< CustomExpression > custom_expression) |
const CustomExpression * | getCustomExpression (int32_t custom_expression_id) const |
const std::unique_ptr< const CustomExpression > | getCustomExpressionFromStorage (int32_t custom_expression_id) |
std::vector< const CustomExpression * > | getCustomExpressionsForUser (const UserMetadata &user) const |
void | updateCustomExpression (int32_t custom_expression_id, const std::string &expression_json) |
void | deleteCustomExpressions (const std::vector< int32_t > &custom_expression_ids, bool do_soft_delete) |
void | reassignOwners (const std::set< std::string > &old_owners, const std::string &new_owner) |
bool | isInfoSchemaDb () const |
bool | checkDropRenderGroupColumnsMigration () |
Static Public Member Functions | |
static void | expandGeoColumn (const ColumnDescriptor &cd, std::list< ColumnDescriptor > &columns) |
static const std::string | getForeignTableSchema (bool if_not_exists=false) |
static const std::string | getForeignServerSchema (bool if_not_exists=false) |
static const std::string | getCustomExpressionsSchema (bool if_not_exists=false) |
Public Attributes | |
std::unique_ptr < heavyai::DistributedSharedMutex > | dcatalogMutex_ |
std::unique_ptr < heavyai::DistributedSharedMutex > | dsqliteMutex_ |
std::mutex | sqliteMutex_ |
heavyai::shared_mutex | sharedMutex_ |
std::atomic< std::thread::id > | thread_holding_sqlite_lock |
std::atomic< std::thread::id > | thread_holding_write_lock |
bool | initialized_ = false |
Static Public Attributes | |
static thread_local bool | thread_holds_read_lock = false |
Protected Types | |
using | ColumnDescriptorsForRoll = std::vector< std::pair< ColumnDescriptor *, ColumnDescriptor * >> |
Protected Member Functions | |
void | CheckAndExecuteMigrations () |
void | CheckAndExecuteMigrationsPostBuildMaps () |
void | updateDictionaryNames () |
void | updateTableDescriptorSchema () |
void | updateFixlenArrayColumns () |
void | updateGeoColumns () |
void | updateFrontendViewSchema () |
void | updateLinkSchema () |
void | updateFrontendViewAndLinkUsers () |
void | updateLogicalToPhysicalTableLinkSchema () |
void | updateLogicalToPhysicalTableMap (const int32_t logical_tb_id) |
void | updateDictionarySchema () |
void | updatePageSize () |
void | updateDeletedColumnIndicator () |
void | updateDefaultColumnValues () |
void | updateFrontendViewsToDashboards () |
void | updateCustomExpressionsSchema () |
void | updateFsiSchemas () |
void | renameLegacyDataWrappers () |
void | recordOwnershipOfObjectsInObjectPermissions () |
void | checkDateInDaysColumnMigration () |
void | createDashboardSystemRoles () |
void | buildMaps () |
void | addTableToMap (const TableDescriptor *td, const std::list< ColumnDescriptor > &columns, const std::list< DictDescriptor > &dicts) |
void | addReferenceToForeignDict (ColumnDescriptor &referencing_column, Parser::SharedDictionaryDef shared_dict_def, const bool persist_reference) |
bool | setColumnSharedDictionary (ColumnDescriptor &cd, std::list< ColumnDescriptor > &cdd, std::list< DictDescriptor > &dds, const TableDescriptor td, const std::vector< Parser::SharedDictionaryDef > &shared_dict_defs) |
void | setColumnDictionary (ColumnDescriptor &cd, std::list< DictDescriptor > &dds, const TableDescriptor &td, bool is_logical_table, bool use_temp_dictionary=false) |
void | addFrontendViewToMap (DashboardDescriptor &vd) |
void | addFrontendViewToMapNoLock (DashboardDescriptor &vd) |
void | addLinkToMap (LinkDescriptor &ld) |
void | removeTableFromMap (const std::string &tableName, const int tableId, const bool is_on_error=false) |
void | eraseTableMetadata (const TableDescriptor *td) |
void | executeDropTableSqliteQueries (const TableDescriptor *td) |
void | doTruncateTable (const TableDescriptor *td) |
void | renamePhysicalTable (const TableDescriptor *td, const std::string &newTableName) |
void | renamePhysicalTables (std::vector< std::pair< std::string, std::string >> &names, std::vector< int > &tableIds) |
void | instantiateFragmenter (TableDescriptor *td) const |
void | getAllColumnMetadataForTableImpl (const TableDescriptor *td, std::list< const ColumnDescriptor * > &colDescs, const bool fetchSystemColumns, const bool fetchVirtualColumns, const bool fetchPhysicalColumns) const |
std::string | calculateSHA1 (const std::string &data) |
std::string | generatePhysicalTableName (const std::string &logicalTableName, const size_t shardNumber) |
std::vector< DBObject > | parseDashboardObjects (const std::string &view_meta, const int &user_id) |
void | createOrUpdateDashboardSystemRole (const std::string &view_meta, const int32_t &user_id, const std::string &dash_role_name) |
const int | getColumnIdBySpiUnlocked (const int table_id, const size_t spi) const |
void | serializeTableJsonUnlocked (const TableDescriptor *td, const std::list< ColumnDescriptor > &cds) const |
void | dropTableFromJsonUnlocked (const std::string &table_name) const |
Static Protected Attributes | |
static const std::string | physicalTableNameTag_ |
Private Member Functions | |
void | addColumnDescriptor (const ColumnDescriptor *cd) |
void | removeColumnDescriptor (const ColumnDescriptor *cd) |
void | delDictionaryNontransactional (const ColumnDescriptor &cd) |
void | addColumnNontransactional (const TableDescriptor &td, ColumnDescriptor &cd) |
DictRef | addDictionaryNontransactional (ColumnDescriptor &cd) |
void | buildDictionaryMapUnlocked () |
void | reloadTableMetadata (int table_id) |
void | reloadTableMetadataUnlocked (int table_id) |
TableDescriptor * | createTableFromDiskUnlocked (int32_t table_id) |
void | reloadDictionariesFromDiskUnlocked () |
std::list< ColumnDescriptor * > | sqliteGetColumnsForTableUnlocked (int32_t table_id) |
void | reloadForeignTableUnlocked (foreign_storage::ForeignTable &foreign_table) |
void | reloadCatalogMetadata (const std::map< int32_t, std::string > &user_name_by_user_id) |
void | reloadCatalogMetadataUnlocked (const std::map< int32_t, std::string > &user_name_by_user_id) |
void | refreshDictionaryCachesForTableUnlocked (const TableDescriptor &td) |
void | buildTablesMapUnlocked () |
void | buildColumnsMapUnlocked () |
void | updateViewsInMapUnlocked () |
void | updateViewUnlocked (TableDescriptor &) |
void | buildDashboardsMapUnlocked (const std::map< int32_t, std::string > &user_name_by_user_id) |
void | buildLinksMapUnlocked () |
void | buildLogicalToPhysicalMapUnlocked () |
void | updateForeignTablesInMapUnlocked () |
void | gatherAdditionalInfo (std::vector< std::string > &additional_info, std::set< std::string > &shared_dict_column_names, const TableDescriptor *td) const |
std::string | quoteIfRequired (const std::string &column_name) const |
void | adjustAlteredTableFiles (const std::string &temp_data_dir, const std::unordered_map< int, int > &all_column_ids_map) const |
void | renameTableDirectories (const std::string &temp_data_dir, const std::vector< std::string > &target_paths, const std::string &name_prefix) const |
void | buildForeignServerMapUnlocked () |
void | setForeignServerProperty (const std::string &server_name, const std::string &property, const std::string &value) |
void | setForeignTableProperty (const foreign_storage::ForeignTable *table, const std::string &property, const std::string &value) |
void | alterPhysicalTableMetadata (const TableDescriptor *td, const TableDescriptorUpdateParams &table_update_params) |
void | alterTableMetadata (const TableDescriptor *td, const TableDescriptorUpdateParams &table_update_params) |
void | setTableFileMgrParams (const int table_id, const File_Namespace::FileMgrParams &file_mgr_params) |
bool | filterTableByTypeAndUser (const TableDescriptor *td, const UserMetadata &user_metadata, const GetTablesType get_tables_type) const |
TableDescriptor * | getMutableMetadataForTableUnlocked (int table_id) const |
TableDescriptor * | getMutableMetadataForTableUnlocked (const std::string &table_name) const |
void | createForeignServerNoLocks (std::unique_ptr< foreign_storage::ForeignServer > foreign_server, bool if_not_exists) |
foreign_storage::ForeignTable * | getForeignTableUnlocked (const std::string &tableName) const |
const Catalog * | getObjForLock () |
void | removeChunks (const int table_id) const |
void | buildCustomExpressionsMapUnlocked () |
std::unique_ptr< CustomExpression > | getCustomExpressionFromConnector (size_t row) |
void | restoreOldOwners (const std::map< int32_t, std::string > &old_owners_user_name_by_id, const std::map< int32_t, std::vector< DBObject >> &old_owner_db_objects, int32_t new_owner_id) |
void | restoreOldOwnersInMemory (const std::map< int32_t, std::string > &old_owners_user_name_by_id, const std::map< int32_t, std::vector< DBObject >> &old_owner_db_objects, int32_t new_owner_id) |
void | conditionallyInitializeSystemObjects () |
void | initializeSystemServers () |
void | initializeSystemTables () |
void | initializeUsersSystemTable () |
void | initializeDatabasesSystemTable () |
void | initializePermissionsSystemTable () |
void | initializeRolesSystemTable () |
void | initializeTablesSystemTable () |
void | initializeDashboardsSystemTable () |
void | initializeRoleAssignmentsSystemTable () |
void | initializeMemorySummarySystemTable () |
void | initializeMemoryDetailsSystemTable () |
void | initializeStorageDetailsSystemTable () |
void | initializeExecutorResourcePoolSummarySystemTable () |
void | initializeMLModelMetadataSystemTable () |
void | initializeServerLogsSystemTables () |
void | initializeRequestLogsSystemTables () |
void | initializeWebServerLogsSystemTables () |
void | initializeWebServerAccessLogsSystemTables () |
void | createSystemTableServer (const std::string &server_name, const std::string &data_wrapper_type, const foreign_storage::OptionsMap &options={}) |
std::pair < foreign_storage::ForeignTable, std::list< ColumnDescriptor > > | getSystemTableSchema (const std::string &table_name, const std::string &server_name, const std::vector< std::pair< std::string, SQLTypeInfo >> &column_type_by_name, bool is_in_memory_system_table) |
bool | recreateSystemTableIfUpdated (foreign_storage::ForeignTable &foreign_table, const std::list< ColumnDescriptor > &columns) |
void | setDeletedColumnUnlocked (const TableDescriptor *td, const ColumnDescriptor *cd) |
void | updateInColumnMap (ColumnDescriptor *cd, ColumnDescriptor *old_cd) |
void | addToColumnMap (ColumnDescriptor *cd) |
void | removeFromColumnMap (ColumnDescriptor *cd) |
void | deleteTableCatalogMetadata (const TableDescriptor *logical_table, const std::vector< const TableDescriptor * > &physical_tables) |
std::string | dumpCreateTableUnlocked (const TableDescriptor *td, bool multiline_formatting, bool dump_defaults) const |
void | removeDiskCachedDataForMutableTable (int32_t table_id) const |
template<typename F , typename... Args> | |
void | execInTransaction (F &&f, Args &&...args) |
const TableDescriptor * | getCachedTableDescriptor (const std::map< std::string, int > &cached_table_map, const std::string &cur_table_name) |
Private Attributes | |
DeletedColumnPerTableMap | deletedColumnPerTable_ |
Static Private Attributes | |
static constexpr const char * | CATALOG_SERVER_NAME {"system_catalog_server"} |
static constexpr const char * | MEMORY_STATS_SERVER_NAME {"system_memory_stats_server"} |
static constexpr const char * | STORAGE_STATS_SERVER_NAME {"system_storage_stats_server"} |
static constexpr const char * | EXECUTOR_STATS_SERVER_NAME {"system_executor_stats_server"} |
static constexpr const char * | ML_METADATA_SERVER_NAME {"ml_metadata_server"} |
static constexpr const char * | LOGS_SERVER_NAME {"system_logs_server"} |
static constexpr std::array < const char *, 6 > | INTERNAL_SERVERS |
Friends | |
template<class T > | |
class | lockmgr::TableLockMgrImpl |
class for a per-database catalog. also includes metadata for the current database and the current user.
|
protected |
Catalog_Namespace::Catalog::Catalog | ( | const std::string & | basePath, |
const DBMetadata & | curDB, | ||
std::shared_ptr< Data_Namespace::DataMgr > | dataMgr, | ||
const std::vector< LeafHostInfo > & | string_dict_hosts, | ||
std::shared_ptr< Calcite > | calcite, | ||
bool | is_new_db | ||
) |
Constructor - takes basePath to already extant data directory for writing.
basePath | directory path for writing catalog |
dbName | name of the database |
fragmenter | Fragmenter object metadata - expects for this directory to already exist |
Catalog_Namespace::Catalog::Catalog | ( | ) |
Constructor builds a hollow catalog used during constructor of other catalogs.
Definition at line 171 of file Catalog.cpp.
Catalog_Namespace::Catalog::~Catalog | ( | ) |
Destructor - deletes all ColumnDescriptor and TableDescriptor structures which were allocated on the heap and writes Catalog to Sqlite.
Definition at line 231 of file Catalog.cpp.
References basePath_, columnDescriptorMap_, currentDB_, Catalog_Namespace::DBMetadata::dbName, g_serialize_temp_tables, Catalog_Namespace::anonymous_namespace{Catalog.cpp}::table_json_filepath(), and tableDescriptorMap_.
void Catalog_Namespace::Catalog::addColumn | ( | const TableDescriptor & | td, |
ColumnDescriptor & | cd | ||
) |
Definition at line 2528 of file Catalog.cpp.
References ColumnDescriptor::columnId, ColumnDescriptor::columnName, ColumnDescriptor::columnType, ColumnDescriptor::db_id, ColumnDescriptor::default_value, SQLTypeInfo::get_comp_param(), SQLTypeInfo::get_compression(), SQLTypeInfo::get_dimension(), SQLTypeInfo::get_notnull(), SQLTypeInfo::get_scale(), SQLTypeInfo::get_size(), SQLTypeInfo::get_subtype(), SQLTypeInfo::get_type(), ColumnDescriptor::isDeletedCol, ColumnDescriptor::isSystemCol, ColumnDescriptor::isVirtualCol, kENCODING_DICT, TableDescriptor::nShards, TableDescriptor::shard, ColumnDescriptor::tableId, TableDescriptor::tableId, to_string(), and ColumnDescriptor::virtualExpr.
|
private |
Definition at line 2701 of file Catalog.cpp.
References CHECK, ColumnDescriptor::columnId, ColumnDescriptor::isGeoPhyCol, gpu_enabled::sort(), and ColumnDescriptor::tableId.
|
private |
Definition at line 2462 of file Catalog.cpp.
References ColumnDescriptor::columnId, ColumnDescriptor::columnName, ColumnDescriptor::columnType, ColumnDescriptor::db_id, ColumnDescriptor::default_value, SQLTypeInfo::get_comp_param(), SQLTypeInfo::get_compression(), SQLTypeInfo::get_dimension(), SQLTypeInfo::get_notnull(), SQLTypeInfo::get_scale(), SQLTypeInfo::get_size(), SQLTypeInfo::get_subtype(), SQLTypeInfo::get_type(), ColumnDescriptor::isDeletedCol, ColumnDescriptor::isSystemCol, ColumnDescriptor::isVirtualCol, kENCODING_DICT, TableDescriptor::nShards, TableDescriptor::shard, ColumnDescriptor::tableId, TableDescriptor::tableId, TableDescriptor::tableName, to_string(), and ColumnDescriptor::virtualExpr.
void Catalog_Namespace::Catalog::addColumnTransactional | ( | const TableDescriptor & | td, |
ColumnDescriptor & | cd | ||
) |
Definition at line 2449 of file Catalog.cpp.
|
private |
Definition at line 2242 of file Catalog.cpp.
References CHECK, DictDescriptor::dictFolderPath, and ColumnDescriptor::tableId.
DictRef Catalog_Namespace::Catalog::addDictionaryTransactional | ( | ColumnDescriptor & | cd | ) |
Definition at line 2227 of file Catalog.cpp.
|
protected |
Definition at line 1683 of file Catalog.cpp.
|
protected |
Definition at line 1688 of file Catalog.cpp.
References DashboardDescriptor::dashboardName, to_string(), and DashboardDescriptor::userId.
|
protected |
Definition at line 1770 of file Catalog.cpp.
References LinkDescriptor::link, LinkDescriptor::linkId, and to_string().
|
protected |
Definition at line 3965 of file Catalog.cpp.
References CHECK, CHECK_GE, ColumnDescriptor::columnType, SQLTypeInfo::get_comp_param(), Catalog_Namespace::anonymous_namespace{Catalog.cpp}::get_foreign_col(), and to_string().
|
protected |
Definition at line 1542 of file Catalog.cpp.
References anonymous_namespace{Utm.h}::a, CHECK, TableDescriptor::columnIdBySpi_, DictDescriptor::dictFolderPath, dict_ref_t::dictId, TableDescriptor::hasDeletedCol, TableDescriptor::mutex_, gpu_enabled::sort(), TableDescriptor::tableId, TableDescriptor::tableName, and to_upper().
|
private |
Definition at line 6984 of file Catalog.cpp.
References ColumnDescriptor::columnId, ColumnDescriptor::columnName, ColumnDescriptor::columnType, SQLTypeInfo::is_dict_encoded_type(), ColumnDescriptor::tableId, and to_upper().
|
private |
void Catalog_Namespace::Catalog::alterColumnTypeTransactional | ( | const ColumnDescriptor & | cd | ) |
Definition at line 2383 of file Catalog.cpp.
References CHECK, ColumnDescriptor::columnId, ColumnDescriptor::columnName, ColumnDescriptor::columnType, ColumnDescriptor::default_value, SQLTypeInfo::get_comp_param(), SQLTypeInfo::get_compression(), SQLTypeInfo::get_dimension(), SQLTypeInfo::get_notnull(), SQLTypeInfo::get_scale(), SQLTypeInfo::get_size(), SQLTypeInfo::get_subtype(), SQLTypeInfo::get_type(), ColumnDescriptor::tableId, to_string(), and to_upper().
Referenced by AlterTableAlterColumnCommandRecoveryMgr::rollback().
|
private |
Definition at line 3680 of file Catalog.cpp.
References CHECK, TableDescriptorUpdateParams::max_rollback_epochs, TableDescriptorUpdateParams::max_rows, TableDescriptor::maxRollbackEpochs, TableDescriptor::maxRows, TableDescriptor::tableId, and to_string().
|
private |
Definition at line 3707 of file Catalog.cpp.
References CHECK, logger::FATAL, LOG, TableDescriptor::tableId, and TableDescriptor::tableName.
|
private |
Definition at line 1333 of file Catalog.cpp.
References anonymous_namespace{Utm.h}::a, CHECK, ColumnDescriptor::chunks, ColumnDescriptor::columnId, ColumnDescriptor::columnName, ColumnDescriptor::columnType, ColumnDescriptor::db_id, ColumnDescriptor::default_value, SQLTypeInfo::get_physical_cols(), SQLTypeInfo::is_geometry(), ColumnDescriptor::isDeletedCol, ColumnDescriptor::isGeoPhyCol, ColumnDescriptor::isSystemCol, ColumnDescriptor::isVirtualCol, SQLTypeInfo::set_comp_param(), SQLTypeInfo::set_compression(), Catalog_Namespace::anonymous_namespace{Catalog.cpp}::set_dict_key(), SQLTypeInfo::set_dimension(), SQLTypeInfo::set_notnull(), SQLTypeInfo::set_scale(), SQLTypeInfo::set_size(), SQLTypeInfo::set_subtype(), SQLTypeInfo::set_type(), gpu_enabled::sort(), ColumnDescriptor::tableId, and ColumnDescriptor::virtualExpr.
|
private |
Definition at line 1514 of file Catalog.cpp.
|
private |
Definition at line 1417 of file Catalog.cpp.
References generate_dashboard_system_rolename(), Catalog_Namespace::anonymous_namespace{Catalog.cpp}::get_user_name_from_id(), and to_string().
|
private |
Definition at line 1072 of file Catalog.cpp.
References currentDB_, Catalog_Namespace::DBMetadata::dbId, dictDescriptorMapByRef_, g_base_path, SqliteConnector::getData(), SqliteConnector::getNumRows(), shared::kDataDirectoryName, SqliteConnector::query(), sqliteConnector_, and to_string().
|
private |
Definition at line 5092 of file Catalog.cpp.
References CHECK, and g_enable_fsi.
|
private |
Definition at line 1442 of file Catalog.cpp.
References to_string().
|
private |
Definition at line 1462 of file Catalog.cpp.
References CHECK.
|
protected |
Definition at line 1489 of file Catalog.cpp.
References g_enable_fsi, and Catalog_Namespace::anonymous_namespace{Catalog.cpp}::get_user_id_to_user_name_map().
|
private |
Definition at line 1274 of file Catalog.cpp.
References logger::FATAL, StorageType::FOREIGN_TABLE, TableDescriptor::fragmenter, TableDescriptor::fragments, TableDescriptor::fragPageSize, TableDescriptor::fragType, TableDescriptor::hasDeletedCol, TableDescriptor::is_system_table, TableDescriptor::isView, TableDescriptor::keyMetainfo, LOG, TableDescriptor::maxChunkSize, TableDescriptor::maxFragRows, TableDescriptor::maxRollbackEpochs, TableDescriptor::maxRows, TableDescriptor::nColumns, TableDescriptor::nShards, TableDescriptor::partitions, TableDescriptor::shard, TableDescriptor::shardedColumnId, TableDescriptor::sortedColumnId, TableDescriptor::storageType, TableDescriptor::tableId, TableDescriptor::tableName, to_upper(), and TableDescriptor::userId.
|
protected |
Definition at line 4801 of file Catalog.cpp.
void Catalog_Namespace::Catalog::changeForeignServerOwner | ( | const std::string & | server_name, |
const int | new_owner_id | ||
) |
Change the owner of a Foreign Server to a new owner.
server_name | - Name of the foreign server whose owner to change |
new_owner_id | - New owner's user id |
Definition at line 3386 of file Catalog.cpp.
References CHECK, to_string(), and foreign_storage::ForeignServer::user_id.
|
protected |
Definition at line 1012 of file Catalog.cpp.
References g_enable_fsi, getObjForLock(), recordOwnershipOfObjectsInObjectPermissions(), renameLegacyDataWrappers(), updateCustomExpressionsSchema(), updateDefaultColumnValues(), updateDeletedColumnIndicator(), updateDictionaryNames(), updateDictionarySchema(), updateFixlenArrayColumns(), updateFrontendViewAndLinkUsers(), updateFrontendViewSchema(), updateFrontendViewsToDashboards(), updateFsiSchemas(), updateGeoColumns(), updateLinkSchema(), updateLogicalToPhysicalTableLinkSchema(), updatePageSize(), and updateTableDescriptorSchema().
|
protected |
Definition at line 1036 of file Catalog.cpp.
References checkDateInDaysColumnMigration(), and createDashboardSystemRoles().
|
protected |
Definition at line 925 of file Catalog.cpp.
References getCurrentDB(), getObjForLock(), migrations::MigrationMgr::migrateDateInDaysMetadata(), sqliteConnector_, and tableDescriptorMapById_.
Referenced by CheckAndExecuteMigrationsPostBuildMaps().
bool Catalog_Namespace::Catalog::checkDropRenderGroupColumnsMigration | ( | ) |
Definition at line 931 of file Catalog.cpp.
References migrations::MigrationMgr::dropRenderGroupColumns(), and tableDescriptorMapById_.
Referenced by Catalog_Namespace::SysCatalog::checkDropRenderGroupColumnsMigration().
const bool Catalog_Namespace::Catalog::checkMetadataForDeletedRecs | ( | const TableDescriptor * | td, |
int | column_id | ||
) | const |
Definition at line 3903 of file Catalog.cpp.
References CHECK, and TableDescriptor::fragmenter.
void Catalog_Namespace::Catalog::checkpoint | ( | const int | logicalTableId | ) | const |
Definition at line 5022 of file Catalog.cpp.
Referenced by UpdelRoll::commitUpdate(), TableOptimizer::vacuumDeletedRows(), and TableOptimizer::vacuumFragmentsAboveMinSelectivity().
void Catalog_Namespace::Catalog::checkpointWithAutoRollback | ( | const int | logical_table_id | ) | const |
Definition at line 5030 of file Catalog.cpp.
Referenced by AlterTableAlterColumnCommandRecoveryMgr::checkpoint(), Fragmenter_Namespace::LocalInsertConnector::checkpoint(), import_export::Loader::checkpoint(), StorageIOFacility::TransactionParameters::finalizeTransaction(), and TableOptimizer::vacuumFragmentsAboveMinSelectivity().
|
private |
Definition at line 6382 of file Catalog.cpp.
References g_enable_system_tables.
int32_t Catalog_Namespace::Catalog::createCustomExpression | ( | std::unique_ptr< CustomExpression > | custom_expression | ) |
Creates a new custom expression.
custom_expression | - unique pointer to struct containing custom expression details. |
Definition at line 5944 of file Catalog.cpp.
References CHECK, CHECK_EQ, CHECK_GT, and to_string().
int32_t Catalog_Namespace::Catalog::createDashboard | ( | DashboardDescriptor & | vd | ) |
Definition at line 4660 of file Catalog.cpp.
References DashboardDescriptor::dashboardId, DashboardDescriptor::dashboardMetadata, DashboardDescriptor::dashboardName, DashboardDescriptor::dashboardState, DashboardDescriptor::dashboardSystemRoleName, generate_dashboard_system_rolename(), DashboardDescriptor::imageHash, to_string(), Catalog_Namespace::sqlite_lock< T >::unlock(), Catalog_Namespace::write_lock< T >::unlock(), DashboardDescriptor::updateTime, and DashboardDescriptor::userId.
|
protected |
Definition at line 936 of file Catalog.cpp.
References createOrUpdateDashboardSystemRole(), currentDB_, Catalog_Namespace::DBMetadata::dbId, logger::ERROR, generate_dashboard_system_rolename(), SqliteConnector::getData(), Catalog_Namespace::SysCatalog::getGranteesOfSharedDashboards(), SqliteConnector::getNumRows(), getObjForLock(), Catalog_Namespace::SysCatalog::getRoleGrantee(), Catalog_Namespace::SysCatalog::grantRoleBatch(), logger::INFO, Catalog_Namespace::SysCatalog::instance(), LOG, MAPD_VERSION, SqliteConnector::query(), SqliteConnector::query_with_text_params(), run_benchmark_import::result, sqliteConnector_, and to_string().
Referenced by CheckAndExecuteMigrationsPostBuildMaps().
void Catalog_Namespace::Catalog::createDefaultServersIfNotExists | ( | ) |
Creates default local file servers (if they don't already exist).
Definition at line 5331 of file Catalog.cpp.
References CHECK, foreign_storage::DataWrapperType::CSV, g_enable_fsi, shared::kRootUserId, foreign_storage::AbstractFileStorageDataWrapper::LOCAL_FILE_STORAGE_TYPE, foreign_storage::DataWrapperType::PARQUET, foreign_storage::DataWrapperType::REGEX_PARSER, and foreign_storage::AbstractFileStorageDataWrapper::STORAGE_TYPE_KEY.
void Catalog_Namespace::Catalog::createForeignServer | ( | std::unique_ptr< foreign_storage::ForeignServer > | foreign_server, |
bool | if_not_exists | ||
) |
Creates a new foreign server DB object.
foreign_server | - unique pointer to struct containing foreign server details |
if_not_exists | - flag indicating whether or not an attempt to create a new foreign server should occur if a server with the same name already exists. An exception is thrown if this flag is set to "false" and an attempt is made to create a pre-existing foreign server |
Definition at line 3283 of file Catalog.cpp.
|
private |
Same as createForeignServer() but without acquiring locks. This should only be called from within a function/code block that already acquires appropriate locks.
Definition at line 3291 of file Catalog.cpp.
References CHECK, CHECK_EQ, setup::name, and to_string().
std::string Catalog_Namespace::Catalog::createLink | ( | LinkDescriptor & | ld, |
size_t | min_length | ||
) |
Definition at line 4813 of file Catalog.cpp.
References LinkDescriptor::link, LinkDescriptor::linkId, to_string(), LinkDescriptor::updateTime, LinkDescriptor::userId, LinkDescriptor::viewMetadata, and LinkDescriptor::viewState.
|
protected |
Definition at line 1724 of file Catalog.cpp.
References Grantee::findDbObject(), Grantee::getDbObjects(), TableDBObjectType, and ViewDBObjectType.
Referenced by createDashboardSystemRoles().
void Catalog_Namespace::Catalog::createShardedTable | ( | TableDescriptor & | td, |
const std::list< ColumnDescriptor > & | columns, | ||
const std::vector< Parser::SharedDictionaryDef > & | shared_dict_defs | ||
) |
Definition at line 4099 of file Catalog.cpp.
References CHECK, TableDescriptor::nShards, TableDescriptor::shard, table_is_temporary(), TableDescriptor::tableId, and TableDescriptor::tableName.
|
private |
Definition at line 6833 of file Catalog.cpp.
References logger::INFO, shared::kRootUserId, LOG, and run_benchmark_import::tables.
void Catalog_Namespace::Catalog::createTable | ( | TableDescriptor & | td, |
const std::list< ColumnDescriptor > & | columns, | ||
const std::vector< Parser::SharedDictionaryDef > & | shared_dict_defs, | ||
bool | isLogicalTable | ||
) |
Definition at line 2935 of file Catalog.cpp.
References CHECK, ColumnDescriptor::columnId, TableDescriptor::columnIdBySpi_, ColumnDescriptor::columnName, ColumnDescriptor::columnType, ColumnDescriptor::default_value, dict_ref_t::dictId, Data_Namespace::DISK_LEVEL, StorageType::FOREIGN_TABLE, TableDescriptor::fragPageSize, TableDescriptor::fragType, g_enable_fsi, g_serialize_temp_tables, SQLTypeInfo::get_comp_param(), SQLTypeInfo::get_compression(), SQLTypeInfo::get_dimension(), Catalog_Namespace::anonymous_namespace{Catalog.cpp}::get_next_refresh_time(), SQLTypeInfo::get_notnull(), SQLTypeInfo::get_scale(), SQLTypeInfo::get_size(), SQLTypeInfo::get_subtype(), SQLTypeInfo::get_type(), TableDescriptor::hasDeletedCol, SQLTypeInfo::is_array(), TableDescriptor::is_system_table, ColumnDescriptor::isDeletedCol, ColumnDescriptor::isGeoPhyCol, ColumnDescriptor::isSystemCol, TableDescriptor::isView, ColumnDescriptor::isVirtualCol, kBIGINT, kBOOLEAN, kENCODING_DICT, TableDescriptor::keyMetainfo, TableDescriptor::maxChunkSize, TableDescriptor::maxFragRows, TableDescriptor::maxRollbackEpochs, TableDescriptor::maxRows, TableDescriptor::nColumns, foreign_storage::ForeignTable::next_refresh_time, TableDescriptor::nShards, TableDescriptor::partitions, TableDescriptor::persistenceLevel, SQLTypeInfo::set_comp_param(), Catalog_Namespace::anonymous_namespace{Catalog.cpp}::set_dict_key(), SQLTypeInfo::set_size(), TableDescriptor::shard, TableDescriptor::shardedColumnId, TableDescriptor::sortedColumnId, TableDescriptor::storageType, ColumnDescriptor::tableId, TableDescriptor::tableId, TableDescriptor::tableName, to_string(), TableDescriptor::userId, TableDescriptor::viewSQL, and ColumnDescriptor::virtualExpr.
|
private |
Definition at line 5243 of file Catalog.cpp.
References logger::FATAL, StorageType::FOREIGN_TABLE, LOG, and to_string().
|
private |
Definition at line 2280 of file Catalog.cpp.
References CHECK, CHECK_GT, ColumnDescriptor::columnType, g_base_path, SQLTypeInfo::get_comp_param(), SQLTypeInfo::get_compression(), SQLTypeInfo::is_string(), SQLTypeInfo::is_string_array(), shared::kDataDirectoryName, kENCODING_DICT, File_Namespace::renameForDelete(), ColumnDescriptor::tableId, to_string(), and VLOG.
void Catalog_Namespace::Catalog::delDictionaryTransactional | ( | const ColumnDescriptor & | cd | ) |
Definition at line 2267 of file Catalog.cpp.
Referenced by AlterTableAlterColumnCommandRecoveryMgr::cleanupDeleteDictionaries(), and AlterTableAlterColumnCommandRecoveryMgr::rollback().
void Catalog_Namespace::Catalog::deleteCustomExpressions | ( | const std::vector< int32_t > & | custom_expression_ids, |
bool | do_soft_delete | ||
) |
Deletes custom expressions with the given ids.
custom_expression_ids | - ids of custom expressions to delete |
do_soft_delete | - flag indicating whether or not to do a soft delete |
Definition at line 6069 of file Catalog.cpp.
References CHECK, CHECK_EQ, join(), and to_string().
void Catalog_Namespace::Catalog::deleteMetadataForDashboards | ( | const std::vector< int32_t > | ids, |
const UserMetadata & | user | ||
) |
Definition at line 2011 of file Catalog.cpp.
References DashboardDBObjectType, AccessPrivileges::DELETE_DASHBOARD, and to_string().
|
private |
Definition at line 4310 of file Catalog.cpp.
References TableDescriptor::tableId, and to_string().
|
protected |
Definition at line 4143 of file Catalog.cpp.
References CHECK, CHECK_GE, ColumnDescriptor::columnType, Data_Namespace::CPU_LEVEL, dict_ref_t::dictId, DictDescriptor::dictIsTemp, DictDescriptor::dictRef, SQLTypeInfo::get_comp_param(), SQLTypeInfo::get_compression(), Data_Namespace::GPU_LEVEL, kENCODING_DICT, File_Namespace::renameForDelete(), ColumnDescriptor::tableId, and TableDescriptor::tableId.
void Catalog_Namespace::Catalog::dropColumn | ( | const TableDescriptor & | td, |
const ColumnDescriptor & | cd | ||
) |
Definition at line 2653 of file Catalog.cpp.
References CHECK, ColumnDescriptor::columnId, ColumnDescriptor::columnName, TableDescriptor::nShards, TableDescriptor::shard, ColumnDescriptor::tableId, TableDescriptor::tableId, to_string(), and to_upper().
void Catalog_Namespace::Catalog::dropColumnNontransactional | ( | const TableDescriptor & | td, |
const ColumnDescriptor & | cd | ||
) |
Definition at line 2607 of file Catalog.cpp.
References CHECK, ColumnDescriptor::columnId, ColumnDescriptor::columnName, TableDescriptor::nShards, TableDescriptor::shard, ColumnDescriptor::tableId, TableDescriptor::tableId, TableDescriptor::tableName, to_string(), and to_upper().
void Catalog_Namespace::Catalog::dropColumnPolicies | ( | const TableDescriptor & | td, |
const ColumnDescriptor & | cd | ||
) |
Definition at line 2640 of file Catalog.cpp.
References CHECK, ColumnDescriptor::columnId, TableDescriptor::nShards, and TableDescriptor::shard.
void Catalog_Namespace::Catalog::dropColumnTransactional | ( | const TableDescriptor & | td, |
const ColumnDescriptor & | cd | ||
) |
Definition at line 2591 of file Catalog.cpp.
Referenced by AlterTableAlterColumnCommandRecoveryMgr::cleanupDropSourceGeoColumns(), and AlterTableAlterColumnCommandRecoveryMgr::rollback().
void Catalog_Namespace::Catalog::dropForeignServer | ( | const std::string & | server_name | ) |
Drops/deletes a foreign server DB object.
server_name | - Name of foreign server that will be deleted |
Definition at line 3450 of file Catalog.cpp.
References CHECK_EQ, and to_string().
void Catalog_Namespace::Catalog::dropTable | ( | const TableDescriptor * | td | ) |
Definition at line 4282 of file Catalog.cpp.
References CHECK, TableDescriptor::isView, TableDBObjectType, TableDescriptor::tableId, TableDescriptor::tableName, and ViewDBObjectType.
Referenced by Catalog_Namespace::anonymous_namespace{Catalog.cpp}::drop_tables().
|
protected |
Definition at line 3251 of file Catalog.cpp.
References CHECK, Catalog_Namespace::anonymous_namespace{Catalog.cpp}::table_json_filepath(), and VLOG.
std::string Catalog_Namespace::Catalog::dumpCreateServer | ( | const std::string & | name, |
bool | multiline_formatting = true |
||
) | const |
Definition at line 5746 of file Catalog.cpp.
References join().
std::string Catalog_Namespace::Catalog::dumpCreateTable | ( | const TableDescriptor * | td, |
bool | multiline_formatting = true , |
||
bool | dump_defaults = false |
||
) | const |
Definition at line 5567 of file Catalog.cpp.
std::optional< std::string > Catalog_Namespace::Catalog::dumpCreateTable | ( | int32_t | table_id, |
bool | multiline_formatting = true , |
||
bool | dump_defaults = false |
||
) | const |
Definition at line 5574 of file Catalog.cpp.
|
private |
Definition at line 5585 of file Catalog.cpp.
References CHECK, Data_Namespace::CPU_LEVEL, DEFAULT_FRAGMENT_ROWS, DEFAULT_MAX_CHUNK_SIZE, DEFAULT_MAX_ROLLBACK_EPOCHS, DEFAULT_MAX_ROWS, DEFAULT_PAGE_SIZE, TableDescriptor::fragPageSize, g_leaf_count, TableDescriptor::hasDeletedCol, TableDescriptor::is_system_table, TableDescriptor::isView, join(), kCHAR, kENCODING_DICT, kENCODING_GEOINT, kTEXT, TableDescriptor::maxChunkSize, TableDescriptor::maxFragRows, TableDescriptor::maxRollbackEpochs, TableDescriptor::maxRows, TableDescriptor::nShards, TableDescriptor::partitions, TableDescriptor::persistenceLevel, TableDescriptor::shardedColumnId, TableDescriptor::sortedColumnId, TableDescriptor::tableId, TableDescriptor::tableName, to_string(), and TableDescriptor::viewSQL.
std::string Catalog_Namespace::Catalog::dumpSchema | ( | const TableDescriptor * | td | ) | const |
Definition at line 5440 of file Catalog.cpp.
References CHECK, DEFAULT_MAX_ROLLBACK_EPOCHS, TableDescriptor::fragPageSize, g_leaf_count, TableDescriptor::hasDeletedCol, TableDescriptor::is_system_table, join(), kCHAR, kENCODING_DICT, kENCODING_GEOINT, kTEXT, TableDescriptor::maxChunkSize, TableDescriptor::maxFragRows, TableDescriptor::maxRollbackEpochs, TableDescriptor::maxRows, TableDescriptor::nShards, TableDescriptor::partitions, TableDescriptor::shardedColumnId, TableDescriptor::sortedColumnId, TableDescriptor::tableId, and to_string().
Referenced by TableArchiver::dumpTable().
void Catalog_Namespace::Catalog::eraseDbMetadata | ( | ) |
Definition at line 5049 of file Catalog.cpp.
References shared::kCatalogDirectoryName, and run_benchmark_import::tables.
void Catalog_Namespace::Catalog::eraseDbPhysicalData | ( | ) |
Definition at line 5060 of file Catalog.cpp.
References run_benchmark_import::tables.
|
protected |
Definition at line 4332 of file Catalog.cpp.
References g_serialize_temp_tables, INJECT_TIMER, table_is_temporary(), TableDescriptor::tableId, and TableDescriptor::tableName.
void Catalog_Namespace::Catalog::eraseTablePhysicalData | ( | const TableDescriptor * | td | ) |
Definition at line 5067 of file Catalog.cpp.
References Data_Namespace::CPU_LEVEL, Data_Namespace::GPU_LEVEL, INJECT_TIMER, TableDescriptor::isView, and TableDescriptor::tableId.
|
private |
Definition at line 7002 of file Catalog.cpp.
References run_benchmark_import::args, and f().
|
protected |
Definition at line 4344 of file Catalog.cpp.
References StorageType::FOREIGN_TABLE, TableDescriptor::isView, kENCODING_DICT, TableDescriptor::storageType, TableDescriptor::tableId, and to_string().
|
static |
Definition at line 2774 of file Catalog.cpp.
References CHECK, ColumnDescriptor::columnName, ColumnDescriptor::columnType, IS_GEO, kARRAY, kDOUBLE, kENCODING_GEOINT, kENCODING_NONE, kINT, kLINESTRING, kMULTILINESTRING, kMULTIPOINT, kMULTIPOLYGON, kPOINT, kPOLYGON, kTINYINT, SQLTypeInfo::set_size(), and SQLTypeInfo::set_subtype().
|
private |
Definition at line 4936 of file Catalog.cpp.
References GET_PHYSICAL_TABLES, GET_VIEWS, TableDescriptor::isView, DBObject::loadKey(), TableDescriptor::shard, TableDBObjectType, TableDescriptor::tableName, and ViewDBObjectType.
|
private |
Definition at line 5878 of file Catalog.cpp.
References CHECK, logger::ERROR, SQLTypeInfo::get_comp_param(), SQLTypeInfo::get_compression(), kENCODING_DICT, LOG, TableDescriptor::nShards, TableDescriptor::shardedColumnId, TableDescriptor::tableId, and TableDescriptor::tableName.
|
protected |
Definition at line 5085 of file Catalog.cpp.
References to_string().
std::list< const ColumnDescriptor * > Catalog_Namespace::Catalog::getAllColumnMetadataForTable | ( | const int | tableId, |
const bool | fetchSystemColumns, | ||
const bool | fetchVirtualColumns, | ||
const bool | fetchPhysicalColumns | ||
) | const |
Returns a list of pointers to constant ColumnDescriptor structs for all the columns from a particular table specified by table id.
tableId | table id we want the column metadata for |
Definition at line 2172 of file Catalog.cpp.
Referenced by Analyzer::RangeTableEntry::add_all_column_descs(), Parser::InsertStmt::analyze(), Parser::InsertValuesStmt::analyze(), Fragmenter_Namespace::copyDataOfShard(), anonymous_namespace{ForeignDataImporter.cpp}::create_fragment_buffers(), TableArchiver::dumpTable(), Analyzer::RangeTableEntry::expand_star_in_targetlist(), import_export::fill_missing_columns(), import_export::ForeignDataImporter::finalize(), import_export::anonymous_namespace{ForeignDataImporter.cpp}::get_proxy_foreign_table_fragment_size(), anonymous_namespace{TableOptimizer.cpp}::get_uncached_cpu_chunk_keys(), Parser::InsertValuesStmt::InsertValuesStmt(), TableOptimizer::recomputeMetadata(), TableArchiver::restoreTable(), AlterTableAlterColumnCommandRecoveryMgr::rollback(), and validate_shared_dictionary().
|
protected |
Definition at line 2142 of file Catalog.cpp.
References TableDescriptor::tableId.
list< const DashboardDescriptor * > Catalog_Namespace::Catalog::getAllDashboardsMetadata | ( | ) | const |
Definition at line 2208 of file Catalog.cpp.
std::vector< DashboardDescriptor > Catalog_Namespace::Catalog::getAllDashboardsMetadataCopy | ( | ) | const |
Definition at line 2217 of file Catalog.cpp.
std::list< const DictDescriptor * > Catalog_Namespace::Catalog::getAllDictionariesWithColumnInName | ( | const ColumnDescriptor * | cd | ) |
Definition at line 2323 of file Catalog.cpp.
References CHECK, ColumnDescriptor::columnName, and ColumnDescriptor::tableId.
Referenced by AlterTableAlterColumnCommandRecoveryMgr::rollback().
std::vector< const foreign_storage::ForeignTable * > Catalog_Namespace::Catalog::getAllForeignTablesForForeignServer | ( | const int32_t | foreign_server_id | ) |
Get all of the foreign tables for associated with a foreign server id.
foreign_server_id | - id of foreign server |
Definition at line 3631 of file Catalog.cpp.
References CHECK, and StorageType::FOREIGN_TABLE.
std::vector< const TableDescriptor * > Catalog_Namespace::Catalog::getAllForeignTablesForRefresh | ( | ) | const |
Gets all the foreign tables that are pending refreshes. The list of tables includes tables that are configured for scheduled refreshes with next refresh timestamps that are in the past.
Definition at line 5783 of file Catalog.cpp.
References CHECK, StorageType::FOREIGN_TABLE, foreign_storage::RefreshTimeCalculator::getCurrentTime(), foreign_storage::ForeignTable::REFRESH_TIMING_TYPE_KEY, foreign_storage::ForeignTable::SCHEDULE_REFRESH_TIMING_TYPE, and run_benchmark_import::tables.
std::vector< std::pair< int32_t, int32_t > > Catalog_Namespace::Catalog::getAllPersistedTableAndShardIds | ( | ) | const |
Definition at line 4889 of file Catalog.cpp.
list< const TableDescriptor * > Catalog_Namespace::Catalog::getAllTableMetadata | ( | ) | const |
Definition at line 2188 of file Catalog.cpp.
Referenced by system_validator::SingleNodeValidator::validate().
std::vector< TableDescriptor > Catalog_Namespace::Catalog::getAllTableMetadataCopy | ( | ) | const |
Definition at line 2197 of file Catalog.cpp.
References run_benchmark_import::tables.
|
private |
Definition at line 4480 of file Catalog.cpp.
|
inline |
Definition at line 267 of file Catalog.h.
References calciteMgr_.
|
inline |
Definition at line 273 of file Catalog.h.
References basePath_.
Referenced by AlterTableAlterColumnCommandRecoveryMgr::getRecoveryFilepathInfo().
std::string Catalog_Namespace::Catalog::getColumnDictDirectory | ( | const ColumnDescriptor * | cd, |
bool | file_name_only = true |
||
) | const |
Definition at line 5388 of file Catalog.cpp.
References CHECK, ColumnDescriptor::columnType, SQLTypeInfo::get_comp_param(), SQLTypeInfo::get_compression(), SQLTypeInfo::is_string(), SQLTypeInfo::is_string_array(), and kENCODING_DICT.
Referenced by TableArchiver::dumpTable(), and TableArchiver::restoreTable().
const int Catalog_Namespace::Catalog::getColumnIdBySpi | ( | const int | tableId, |
const size_t | spi | ||
) | const |
Definition at line 1996 of file Catalog.cpp.
|
protected |
Definition at line 1978 of file Catalog.cpp.
References CHECK, SPIMAP_MAGIC1, and SPIMAP_MAGIC2.
const std::optional< std::string > Catalog_Namespace::Catalog::getColumnName | ( | int | table_id, |
int | column_id | ||
) | const |
Definition at line 1968 of file Catalog.cpp.
|
inline |
Definition at line 265 of file Catalog.h.
References currentDB_.
Referenced by lockmgr::TableSchemaLockContainer< ReadLock >::acquireTableDescriptor(), lockmgr::TableSchemaLockContainer< WriteLock >::acquireTableDescriptor(), checkDateInDaysColumnMigration(), lockmgr::helpers::chunk_key_for_table(), AlterTableAlterColumnCommandRecoveryMgr::cleanupDropSourceGeoColumns(), Catalog_Namespace::SysCatalog::deleteObjectDescriptorMap(), TableArchiver::dumpTable(), Fragmenter_Namespace::get_chunks(), getChunkAccessorTable(), Fragmenter_Namespace::InsertOrderFragmenter::getChunksForAllColumns(), AlterTableAlterColumnCommandRecoveryMgr::getRecoveryFilepathInfo(), Parser::getTableChunkKey(), import_export::Loader::init(), DBHandler::interruptQuery(), DBObject::loadKey(), name(), query_state::operator<<(), TableOptimizer::recomputeMetadata(), AlterTableAlterColumnCommandRecoveryMgr::recoverAlterTableAlterColumnFromFile(), foreign_storage::refresh_foreign_table_unlocked(), ForeignStorageInterface::registerTable(), Catalog_Namespace::SysCatalog::renameDBObject(), Catalog_Namespace::SysCatalog::renameObjectsInDescriptorMap(), TableArchiver::restoreTable(), AlterTableAlterColumnCommandRecoveryMgr::rollback(), Fragmenter_Namespace::InsertOrderFragmenter::updateColumn(), Fragmenter_Namespace::InsertOrderFragmenter::updateColumns(), Catalog_Namespace::SysCatalog::updateObjectDescriptorMap(), lockmgr::validate_table_descriptor_after_lock(), and StorageIOFacility::yieldUpdateCallback().
const CustomExpression * Catalog_Namespace::Catalog::getCustomExpression | ( | int32_t | custom_expression_id | ) | const |
Gets a pointer to the custom expression object with the given id.
custom_expression_id | - id of custom expression to get |
Definition at line 5993 of file Catalog.cpp.
|
private |
Definition at line 1526 of file Catalog.cpp.
References setup::name.
const std::unique_ptr< const CustomExpression > Catalog_Namespace::Catalog::getCustomExpressionFromStorage | ( | int32_t | custom_expression_id | ) |
Gets a pointer to a struct containing custom expression details fetched from storage. This is intended for use in tests, when asserting that expected custom expression data is persisted.
custom_expression_id | - id of custom expression to get |
Definition at line 6002 of file Catalog.cpp.
References CHECK_EQ, and to_string().
std::vector< const CustomExpression * > Catalog_Namespace::Catalog::getCustomExpressionsForUser | ( | const UserMetadata & | user | ) | const |
Gets pointers to all the custom expression objects that the given user has access to. For custom expressions that are associated with a table data source, custom expressions for tables that the given user has SELECT access to are returned.
user | - user for which to get accessible custom expressions |
Definition at line 6016 of file Catalog.cpp.
References CHECK, AccessPrivileges::SELECT_FROM_TABLE, and TableDBObjectType.
|
static |
Gets the DDL statement used to create the custom expressions table.
if_not_exists | - flag the indicates whether or not to include the "IF NOT EXISTS" phrase in the DDL statement. |
Definition at line 790 of file Catalog.cpp.
Referenced by Catalog_Namespace::SysCatalog::createDatabase(), and updateCustomExpressionsSchema().
|
inline |
Definition at line 326 of file Catalog.h.
References currentDB_, and Catalog_Namespace::DBMetadata::dbId.
Referenced by UpdelRoll::addDirtyChunk(), Parser::ColumnRef::analyze(), UpdelRoll::cancelUpdate(), AlterTableAlterColumnCommandRecoveryMgr::cleanupClearRemainingChunks(), UpdelRoll::commitUpdate(), anonymous_namespace{ForeignDataImporter.cpp}::create_fragment_buffers(), DictionaryValueConverter< TARGET_TYPE >::DictionaryValueConverter(), Analyzer::RangeTableEntry::expand_star_in_targetlist(), anonymous_namespace{DdlCommandExecutor.cpp}::get_agg_storage_stats(), anonymous_namespace{TableOptimizer.cpp}::get_uncached_cpu_chunk_keys(), TableOptimizer::getDeletedColumnStats(), lockmgr::TableLockMgrImpl< TableDataLockMgr >::getMutexTracker(), getSyntheticColumnVar(), anonymous_namespace{ForeignDataImporter.cpp}::load_foreign_data_buffers(), Catalog_Namespace::SysCatalog::reassignObjectOwners(), TableOptimizer::recomputeColumnMetadata(), AlterTableAlterColumnCommandRecoveryMgr::recoverAlterTableAlterColumnFromFile(), foreign_storage::refresh_foreign_table_unlocked(), AlterTableAlterColumnCommandRecoveryMgr::rollback(), Fragmenter_Namespace::LocalInsertConnector::rollback(), UpdelRoll::stageUpdate(), TableOptimizer::vacuumDeletedRows(), TableOptimizer::vacuumFragments(), TableOptimizer::vacuumFragmentsAboveMinSelectivity(), system_validator::SingleNodeValidator::validate(), anonymous_namespace{DdlCommandExecutor.cpp}::validate_alter_type_metadata(), and anonymous_namespace{QueryPhysicalInputsCollector.cpp}::RelAlgPhysicalTableInputsVisitor::visit().
|
inline |
Definition at line 266 of file Catalog.h.
References dataMgr_.
Referenced by UpdelRoll::cancelUpdate(), AlterTableAlterColumnCommandRecoveryMgr::cleanupClearChunk(), AlterTableAlterColumnCommandRecoveryMgr::cleanupClearRemainingChunks(), AlterTableAlterColumnCommandRecoveryMgr::cleanupDropSourceGeoColumns(), anonymous_namespace{TableOptimizer.cpp}::delete_cpu_chunks(), TableArchiver::dumpTable(), anonymous_namespace{DdlCommandExecutor.cpp}::get_agg_storage_stats(), Fragmenter_Namespace::get_chunks(), anonymous_namespace{TableOptimizer.cpp}::get_uncached_cpu_chunk_keys(), getChunkAccessorTable(), Fragmenter_Namespace::InsertOrderFragmenter::getChunksForAllColumns(), anonymous_namespace{DBHandler.cpp}::log_system_cpu_memory_status(), TableOptimizer::recomputeMetadata(), AlterTableAlterColumnCommandRecoveryMgr::recoverAlterTableAlterColumnFromFile(), foreign_storage::refresh_foreign_table_unlocked(), TableArchiver::restoreTable(), AlterTableAlterColumnCommandRecoveryMgr::rollback(), UpdelRoll::stageUpdate(), Fragmenter_Namespace::InsertOrderFragmenter::updateColumn(), UpdelRoll::updateFragmenterAndCleanupChunks(), TableOptimizer::vacuumDeletedRows(), TableOptimizer::vacuumFragments(), and anonymous_namespace{DdlCommandExecutor.cpp}::validate_alter_type_metadata().
const ColumnDescriptor * Catalog_Namespace::Catalog::getDeletedColumn | ( | const TableDescriptor * | td | ) | const |
Definition at line 3897 of file Catalog.cpp.
Referenced by TableOptimizer::getDeletedColumnStats(), TableOptimizer::recomputeDeletedColumnMetadata(), and TableOptimizer::vacuumFragments().
const ColumnDescriptor * Catalog_Namespace::Catalog::getDeletedColumnIfRowsDeleted | ( | const TableDescriptor * | td | ) | const |
Definition at line 3915 of file Catalog.cpp.
References ColumnDescriptor::columnId.
void Catalog_Namespace::Catalog::getDictionary | ( | const ColumnDescriptor & | cd, |
std::map< int, StringDictionary * > & | stringDicts | ||
) |
Definition at line 2342 of file Catalog.cpp.
References CHECK, ColumnDescriptor::columnName, kENCODING_DICT, ColumnDescriptor::tableId, and to_upper().
const std::map< int, const ColumnDescriptor * > Catalog_Namespace::Catalog::getDictionaryToColumnMapping | ( | ) |
Definition at line 4905 of file Catalog.cpp.
References kENCODING_DICT, and run_benchmark_import::tables.
const foreign_storage::ForeignServer * Catalog_Namespace::Catalog::getForeignServer | ( | const std::string & | server_name | ) | const |
Gets a pointer to a struct containing foreign server details.
server_name | - Name of foreign server whose details will be fetched |
Definition at line 3334 of file Catalog.cpp.
Referenced by DBObject::loadKey().
const std::unique_ptr< const foreign_storage::ForeignServer > Catalog_Namespace::Catalog::getForeignServerFromStorage | ( | const std::string & | server_name | ) |
Gets a pointer to a struct containing foreign server details fetched from storage. This is mainly used for testing when asserting that expected catalog data is persisted.
server_name | - Name of foreign server whose details will be fetched |
Definition at line 3346 of file Catalog.cpp.
|
static |
Gets the DDL statement used to create a foreign server schema.
if_not_exists | - flag that indicates whether or not to include the "IF NOT EXISTS" phrase in the DDL statement |
Definition at line 775 of file Catalog.cpp.
Referenced by Catalog_Namespace::SysCatalog::createDatabase(), and updateFsiSchemas().
void Catalog_Namespace::Catalog::getForeignServersForUser | ( | const rapidjson::Value * | filters, |
const UserMetadata & | user, | ||
std::vector< const foreign_storage::ForeignServer * > & | results | ||
) |
Performs a query on all foreign servers accessible to user with optional filter, and returns pointers toresulting server objects
filters | - Json Value representing SQL WHERE clause to filter results, eg.: "WHERE attribute1 = value1 AND attribute2 LIKE value2", or Null Value Array of Values with attribute, value, operator, and chain specifier after first entry |
user | - user to retrieve server names |
results | - results returned as a vector of pointers to const foreign_storage::ForeignServer |
Definition at line 3484 of file Catalog.cpp.
References CHECK, shared::contains(), DBObject::loadKey(), foreign_storage::ForeignServer::name, ServerDBObjectType, and to_string().
const foreign_storage::ForeignTable * Catalog_Namespace::Catalog::getForeignTable | ( | const std::string & | tableName | ) | const |
Definition at line 1827 of file Catalog.cpp.
const foreign_storage::ForeignTable * Catalog_Namespace::Catalog::getForeignTable | ( | int | table_id | ) | const |
Definition at line 2133 of file Catalog.cpp.
References CHECK.
const std::unique_ptr< const foreign_storage::ForeignTable > Catalog_Namespace::Catalog::getForeignTableFromStorage | ( | int | table_id | ) |
Gets a pointer to a struct containing foreign table details fetched from storage. This is mainly used for testing when asserting that expected catalog data is persisted.
table_name | - Name of foreign table whose details will be fetched |
Definition at line 3366 of file Catalog.cpp.
References CHECK_EQ, and to_string().
|
static |
Gets the DDL statement used to create a foreign table schema.
if_not_exists | - flag that indicates whether or not to include the "IF NOT EXISTS" phrase in the DDL statement |
Definition at line 782 of file Catalog.cpp.
Referenced by Catalog_Namespace::SysCatalog::createDatabase(), and updateFsiSchemas().
|
private |
Definition at line 1818 of file Catalog.cpp.
References to_upper().
int Catalog_Namespace::Catalog::getLogicalTableId | ( | const int | physicalTableId | ) | const |
Definition at line 5008 of file Catalog.cpp.
Referenced by Fragmenter_Namespace::InsertOrderFragmenter::updateColumn(), Fragmenter_Namespace::InsertOrderFragmenter::updateColumns(), and TableOptimizer::vacuumFragments().
const ColumnDescriptor* Catalog_Namespace::Catalog::getMetadataForColumn | ( | int | tableId, |
const std::string & | colName | ||
) | const |
Referenced by Parser::InsertStmt::analyze(), Parser::InsertValuesStmt::analyze(), Parser::QuerySpec::analyze_select_clause(), RelModify::applyUpdateModificationsToInputNode(), AlterTableAlterColumnCommandRecoveryMgr::cleanupDropSourceGeoColumns(), GeoLinestringValueConverter::GeoLinestringValueConverter(), GeoMultiLinestringValueConverter::GeoMultiLinestringValueConverter(), GeoMultiPointValueConverter::GeoMultiPointValueConverter(), GeoMultiPolygonValueConverter::GeoMultiPolygonValueConverter(), GeoPointValueConverter::GeoPointValueConverter(), GeoPolygonValueConverter::GeoPolygonValueConverter(), anonymous_namespace{DdlCommandExecutor.cpp}::get_alter_column_src_dst_cds(), Fragmenter_Namespace::get_chunks(), Analyzer::RangeTableEntry::get_column_desc(), foreign_storage::anonymous_namespace{AbstractTextFileDataWrapper.cpp}::get_columns(), Catalog_Namespace::anonymous_namespace{Catalog.cpp}::get_foreign_col(), getChunkAccessorTable(), Fragmenter_Namespace::InsertOrderFragmenter::getChunksForAllColumns(), AlterTableAlterColumnCommandRecoveryMgr::getSrcDstCds(), getSyntheticColumnVar(), foreign_storage::anonymous_namespace{InternalSystemDataWrapper.cpp}::initialize_chunks(), anonymous_namespace{ForeignDataImporter.cpp}::load_foreign_data_buffers(), serialize_column_ref(), import_export::Importer::set_geo_physical_import_buffer(), import_export::Importer::set_geo_physical_import_buffer_columnar(), Fragmenter_Namespace::SortedOrderFragmenter::sortData(), and Fragmenter_Namespace::InsertOrderFragmenter::updateColumn().
const ColumnDescriptor * Catalog_Namespace::Catalog::getMetadataForColumn | ( | int | tableId, |
int | columnId | ||
) | const |
Definition at line 1957 of file Catalog.cpp.
const ColumnDescriptor * Catalog_Namespace::Catalog::getMetadataForColumnBySpi | ( | const int | tableId, |
const size_t | spi | ||
) | const |
Definition at line 2001 of file Catalog.cpp.
const DashboardDescriptor* Catalog_Namespace::Catalog::getMetadataForDashboard | ( | const std::string & | userId, |
const std::string & | dashName | ||
) | const |
Referenced by anonymous_namespace{DBHandler.cpp}::dashboard_exists(), and DBObject::loadKey().
const DashboardDescriptor * Catalog_Namespace::Catalog::getMetadataForDashboard | ( | const int32_t | dashboard_id | ) | const |
Definition at line 2093 of file Catalog.cpp.
References setup::name, and to_string().
const DictDescriptor * Catalog_Namespace::Catalog::getMetadataForDict | ( | int | dict_ref, |
bool | loadDict = true |
||
) | const |
Definition at line 1904 of file Catalog.cpp.
References measure< TimeT >::execution(), g_cache_string_hash, logger::INFO, and LOG.
Referenced by AlterTableAlterColumnCommandRecoveryMgr::checkpoint(), DictionaryValueConverter< TARGET_TYPE >::DictionaryValueConverter(), import_export::fill_missing_columns(), import_export::Loader::init(), foreign_storage::anonymous_namespace{InternalSystemDataWrapper.cpp}::initialize_import_buffers(), anonymous_namespace{RelAlgExecutor.cpp}::insert_one_dict_str(), ArrowForeignStorageBase::parseArrowTable(), DBHandler::populateThriftColumnType(), and Fragmenter_Namespace::InsertOrderFragmenter::updateColumn().
const LinkDescriptor* Catalog_Namespace::Catalog::getMetadataForLink | ( | const std::string & | link | ) | const |
const LinkDescriptor * Catalog_Namespace::Catalog::getMetadataForLink | ( | int | linkId | ) | const |
Definition at line 2124 of file Catalog.cpp.
const TableDescriptor* Catalog_Namespace::Catalog::getMetadataForTable | ( | const std::string & | tableName, |
const bool | populateFragmenter = true |
||
) | const |
Returns a pointer to a const TableDescriptor struct matching the provided tableName.
tableName | table specified column belongs to |
Referenced by lockmgr::TableSchemaLockContainer< ReadLock >::acquireTableDescriptor(), lockmgr::TableSchemaLockContainer< WriteLock >::acquireTableDescriptor(), Parser::InsertStmt::analyze(), Parser::QuerySpec::analyze_from_clause(), UpdelRoll::cancelUpdate(), anonymous_namespace{DBHandler.cpp}::check_and_reset_in_memory_system_table(), UpdelRoll::commitUpdate(), Fragmenter_Namespace::compute_row_indices_of_shards(), Fragmenter_Namespace::computeRowIndicesOfShards(), Fragmenter_Namespace::copy_data_of_shard(), Fragmenter_Namespace::copyDataOfShard(), anonymous_namespace{DBHandler.cpp}::create_custom_expr_from_thrift_obj(), anonymous_namespace{DBHandler.cpp}::create_thrift_obj_from_custom_expr(), Catalog_Namespace::anonymous_namespace{Catalog.cpp}::drop_tables(), RelAlgExecutor::executeSimpleInsert(), Executor::executeUpdate(), Catalog_Namespace::anonymous_namespace{Catalog.cpp}::get_foreign_col(), getSyntheticColumnVar(), Fragmenter_Namespace::LocalInsertConnector::insertChunksToLeaf(), Fragmenter_Namespace::LocalInsertConnector::insertDataToLeaf(), Parser::InsertValuesStmt::InsertValuesStmt(), DBObject::loadKey(), Parser::anonymous_namespace{ParserNode.cpp}::loadTable(), TableOptimizer::recomputeMetadataUnlocked(), TableArchiver::restoreTable(), serialize_table_ref(), Fragmenter_Namespace::set_chunk_metadata(), Fragmenter_Namespace::SortedOrderFragmenter::sortData(), Fragmenter_Namespace::InsertOrderFragmenter::updateColumnMetadata(), anonymous_namespace{DdlCommandExecutor.cpp}::vacuum_table_if_required(), TableOptimizer::vacuumFragmentsAboveMinSelectivity(), validate_shared_dictionary(), lockmgr::validate_table_descriptor_after_lock(), Parser::verifyObject(), StorageIOFacility::yieldDeleteCallback(), and StorageIOFacility::yieldUpdateCallback().
const TableDescriptor * Catalog_Namespace::Catalog::getMetadataForTable | ( | int | tableId, |
bool | populateFragmenter = true |
||
) | const |
Definition at line 1852 of file Catalog.cpp.
References Catalog_Namespace::read_lock< T >::unlock().
|
private |
Definition at line 1896 of file Catalog.cpp.
|
private |
Definition at line 1887 of file Catalog.cpp.
References to_upper().
int Catalog_Namespace::Catalog::getNextAddedColumnId | ( | const TableDescriptor & | td | ) |
Definition at line 2441 of file Catalog.cpp.
References TableDescriptor::tableId, and to_string().
|
private |
Definition at line 257 of file Catalog.cpp.
References Catalog_Namespace::SysCatalog::getDummyCatalog(), initialized_, and Catalog_Namespace::SysCatalog::instance().
Referenced by CheckAndExecuteMigrations(), checkDateInDaysColumnMigration(), createDashboardSystemRoles(), recordOwnershipOfObjectsInObjectPermissions(), reloadTableMetadata(), renameLegacyDataWrappers(), updateCustomExpressionsSchema(), updateDefaultColumnValues(), updateDeletedColumnIndicator(), updateDictionaryNames(), updateDictionarySchema(), updateFixlenArrayColumns(), updateFrontendViewAndLinkUsers(), updateFrontendViewSchema(), updateFrontendViewsToDashboards(), updateFsiSchemas(), updateGeoColumns(), updateLinkSchema(), updateLogicalToPhysicalTableLinkSchema(), updateLogicalToPhysicalTableMap(), updatePageSize(), and updateTableDescriptorSchema().
std::vector< const TableDescriptor * > Catalog_Namespace::Catalog::getPhysicalTablesDescriptors | ( | const TableDescriptor * | logical_table_desc, |
bool | populate_fragmenter = true |
||
) | const |
Definition at line 4869 of file Catalog.cpp.
References CHECK, TableDescriptor::tableId, and Catalog_Namespace::read_lock< T >::unlock().
Referenced by Fragmenter_Namespace::copy_data_of_shard(), Fragmenter_Namespace::copyDataOfShard(), import_export::Loader::distributeToShardsNewColumns(), import_export::Loader::dropColumns(), anonymous_namespace{DdlCommandExecutor.cpp}::get_agg_storage_stats(), import_export::Loader::loadImpl(), TableOptimizer::recomputeMetadata(), and TableOptimizer::vacuumDeletedRows().
const ColumnDescriptor * Catalog_Namespace::Catalog::getShardColumnMetadataForTable | ( | const TableDescriptor * | td | ) | const |
Definition at line 4851 of file Catalog.cpp.
References TableDescriptor::shardedColumnId, and TableDescriptor::tableId.
Referenced by RelModify::applyUpdateModificationsToInputNode(), Fragmenter_Namespace::compute_row_indices_of_shards(), and Fragmenter_Namespace::computeRowIndicesOfShards().
|
inline |
Definition at line 327 of file Catalog.h.
References sqliteConnector_.
const std::vector< LeafHostInfo > & Catalog_Namespace::Catalog::getStringDictionaryHosts | ( | ) | const |
Definition at line 1940 of file Catalog.cpp.
|
private |
Definition at line 6860 of file Catalog.cpp.
References CHECK, DEFAULT_FRAGMENT_ROWS, DEFAULT_MAX_CHUNK_SIZE, DEFAULT_MAX_ROWS, DEFAULT_PAGE_SIZE, foreign_storage::ForeignTable::foreign_server, StorageType::FOREIGN_TABLE, TableDescriptor::fragmenter, TableDescriptor::fragments, TableDescriptor::fragPageSize, TableDescriptor::fragType, TableDescriptor::hasDeletedCol, Fragmenter_Namespace::INSERT_ORDER, TableDescriptor::is_in_memory_system_table, TableDescriptor::is_system_table, TableDescriptor::isView, TableDescriptor::keyMetainfo, shared::kRootUserId, TableDescriptor::maxChunkSize, TableDescriptor::maxFragRows, TableDescriptor::maxRows, TableDescriptor::nColumns, TableDescriptor::partitions, TableDescriptor::storageType, TableDescriptor::tableName, and TableDescriptor::userId.
std::vector< std::string > Catalog_Namespace::Catalog::getTableDataDirectories | ( | const TableDescriptor * | td | ) | const |
Definition at line 5374 of file Catalog.cpp.
Referenced by TableArchiver::dumpTable(), and TableArchiver::restoreTable().
std::vector< std::string > Catalog_Namespace::Catalog::getTableDictDirectories | ( | const TableDescriptor * | td | ) | const |
Definition at line 5409 of file Catalog.cpp.
References TableDescriptor::tableId.
Referenced by TableArchiver::dumpTable(), and TableArchiver::restoreTable().
std::set< std::string > Catalog_Namespace::Catalog::getTableDictDirectoryPaths | ( | int32_t | table_id | ) | const |
Definition at line 5422 of file Catalog.cpp.
int32_t Catalog_Namespace::Catalog::getTableEpoch | ( | const int32_t | db_id, |
const int32_t | table_id | ||
) | const |
Definition at line 3579 of file Catalog.cpp.
References CHECK, logger::ERROR, logger::INFO, and LOG.
Referenced by TableArchiver::dumpTable().
std::vector< TableEpochInfo > Catalog_Namespace::Catalog::getTableEpochs | ( | const int32_t | db_id, |
const int32_t | table_id | ||
) | const |
Definition at line 3821 of file Catalog.cpp.
References CHECK, logger::INFO, and LOG.
Referenced by UpdelRoll::cancelUpdate(), UpdelRoll::commitUpdate(), import_export::Loader::getTableEpochs(), AlterTableAlterColumnCommandRecoveryMgr::recoverAlterTableAlterColumnFromFile(), TableOptimizer::vacuumDeletedRows(), TableOptimizer::vacuumFragmentsAboveMinSelectivity(), and system_validator::SingleNodeValidator::validate().
std::optional< int32_t > Catalog_Namespace::Catalog::getTableId | ( | const std::string & | table_name | ) | const |
Definition at line 1878 of file Catalog.cpp.
Referenced by lockmgr::helpers::chunk_key_for_table(), and lockmgr::TableLockMgrImpl< TableDataLockMgr >::validateAndGetExistingTableId().
std::optional< std::string > Catalog_Namespace::Catalog::getTableName | ( | int32_t | table_id | ) | const |
Definition at line 1869 of file Catalog.cpp.
Referenced by lockmgr::TableSchemaLockContainer< ReadLock >::acquireTableDescriptor(), lockmgr::TableSchemaLockContainer< WriteLock >::acquireTableDescriptor(), Catalog_Namespace::anonymous_namespace{Catalog.cpp}::get_checked_table_name(), AlterTableAlterColumnCommandRecoveryMgr::getRecoveryFilepathInfo(), and AlterTableAlterColumnCommandRecoveryMgr::recoverAlterTableAlterColumnFromFile().
std::vector< std::string > Catalog_Namespace::Catalog::getTableNamesForUser | ( | const UserMetadata & | user, |
const GetTablesType | get_tables_type | ||
) | const |
Get names of all tables accessible to user.
user | - user to retrieve table names for |
get_tables_type | - enum indicating if tables, views or tables & views should be returned |
Definition at line 4969 of file Catalog.cpp.
References run_benchmark_import::tables.
Referenced by DBHandler::get_tables_impl().
std::vector< TableMetadata > Catalog_Namespace::Catalog::getTablesMetadataForUser | ( | const UserMetadata & | user_metadata, |
const GetTablesType | get_tables_type, | ||
const std::string & | filter_table_name | ||
) | const |
Get table descriptors of all tables accessible to user.
user | - user to retrieve table descriptors for |
get_tables_type | - enum indicating if tables, views or tables & views should be returned |
Definition at line 4984 of file Catalog.cpp.
References run_benchmark_import::tables.
size_t Catalog_Namespace::Catalog::getTotalMemorySizeForDictionariesForDatabase | ( | ) | const |
Definition at line 2370 of file Catalog.cpp.
Referenced by anonymous_namespace{DBHandler.cpp}::log_cache_size().
|
private |
Definition at line 6582 of file Catalog.cpp.
References Catalog_Namespace::DASHBOARDS_SYS_TABLE_NAME, Catalog_Namespace::anonymous_namespace{Catalog.cpp}::get_encoded_text_type(), Catalog_Namespace::anonymous_namespace{Catalog.cpp}::get_var_encoded_text_array_type(), kINT, and kTIMESTAMP.
|
private |
Definition at line 6519 of file Catalog.cpp.
References Catalog_Namespace::DATABASES_SYS_TABLE_NAME, Catalog_Namespace::anonymous_namespace{Catalog.cpp}::get_encoded_text_type(), and kINT.
|
private |
Definition at line 6673 of file Catalog.cpp.
References Catalog_Namespace::EXECUTOR_RESOURCE_POOL_SUMMARY_SYS_TABLE_NAME, kBIGINT, and kINT.
|
private |
Definition at line 6623 of file Catalog.cpp.
References Catalog_Namespace::anonymous_namespace{Catalog.cpp}::get_encoded_text_type(), Catalog_Namespace::anonymous_namespace{Catalog.cpp}::get_var_array_type(), kBIGINT, kINT, and Catalog_Namespace::MEMORY_DETAILS_SYS_TABLE_NAME.
|
private |
Definition at line 6607 of file Catalog.cpp.
References Catalog_Namespace::anonymous_namespace{Catalog.cpp}::get_encoded_text_type(), kBIGINT, kINT, and Catalog_Namespace::MEMORY_SUMMARY_SYS_TABLE_NAME.
|
private |
Definition at line 6702 of file Catalog.cpp.
References Catalog_Namespace::anonymous_namespace{Catalog.cpp}::get_encoded_text_type(), Catalog_Namespace::anonymous_namespace{Catalog.cpp}::get_var_encoded_text_array_type(), kBIGINT, kDOUBLE, and Catalog_Namespace::ML_MODEL_METADATA_SYS_TABLE_NAME.
|
private |
Definition at line 6531 of file Catalog.cpp.
References Catalog_Namespace::anonymous_namespace{Catalog.cpp}::get_encoded_text_type(), Catalog_Namespace::anonymous_namespace{Catalog.cpp}::get_var_encoded_text_array_type(), kBOOLEAN, kINT, and Catalog_Namespace::PERMISSIONS_SYS_TABLE_NAME.
|
private |
Definition at line 6746 of file Catalog.cpp.
References Catalog_Namespace::anonymous_namespace{Catalog.cpp}::clear_cached_table_data(), Catalog_Namespace::anonymous_namespace{Catalog.cpp}::get_encoded_text_type(), kBIGINT, kINT, kTIMESTAMP, Catalog_Namespace::REQUEST_LOGS_SYS_TABLE_NAME, and Catalog_Namespace::anonymous_namespace{Catalog.cpp}::set_common_db_log_system_table_options().
|
private |
Definition at line 6598 of file Catalog.cpp.
References Catalog_Namespace::anonymous_namespace{Catalog.cpp}::get_encoded_text_type(), and Catalog_Namespace::ROLE_ASSIGNMENTS_SYS_TABLE_NAME.
|
private |
Definition at line 6549 of file Catalog.cpp.
References Catalog_Namespace::anonymous_namespace{Catalog.cpp}::get_encoded_text_type(), and Catalog_Namespace::ROLES_SYS_TABLE_NAME.
|
private |
Definition at line 6721 of file Catalog.cpp.
References Catalog_Namespace::anonymous_namespace{Catalog.cpp}::clear_cached_table_data(), Catalog_Namespace::anonymous_namespace{Catalog.cpp}::get_encoded_text_type(), kINT, kTIMESTAMP, Catalog_Namespace::SERVER_LOGS_SYS_TABLE_NAME, and Catalog_Namespace::anonymous_namespace{Catalog.cpp}::set_common_db_log_system_table_options().
|
private |
Definition at line 6647 of file Catalog.cpp.
References Catalog_Namespace::anonymous_namespace{Catalog.cpp}::get_encoded_text_type(), kBIGINT, kINT, and Catalog_Namespace::STORAGE_DETAILS_SYS_TABLE_NAME.
|
private |
Definition at line 6393 of file Catalog.cpp.
References foreign_storage::AbstractFileStorageDataWrapper::BASE_PATH_KEY, g_enable_logs_system_tables, logger::get_log_dir_path(), foreign_storage::DataWrapperType::INTERNAL_CATALOG, foreign_storage::DataWrapperType::INTERNAL_EXECUTOR_STATS, foreign_storage::DataWrapperType::INTERNAL_LOGS, foreign_storage::DataWrapperType::INTERNAL_MEMORY_STATS, foreign_storage::DataWrapperType::INTERNAL_ML_MODEL_METADATA, foreign_storage::DataWrapperType::INTERNAL_STORAGE_STATS, foreign_storage::AbstractFileStorageDataWrapper::LOCAL_FILE_STORAGE_TYPE, and foreign_storage::AbstractFileStorageDataWrapper::STORAGE_TYPE_KEY.
|
private |
Definition at line 6476 of file Catalog.cpp.
References Catalog_Namespace::anonymous_namespace{Catalog.cpp}::drop_tables(), g_enable_logs_system_tables, Catalog_Namespace::REQUEST_LOGS_SYS_TABLE_NAME, Catalog_Namespace::SERVER_LOGS_SYS_TABLE_NAME, Catalog_Namespace::WS_SERVER_ACCESS_LOGS_SYS_TABLE_NAME, and Catalog_Namespace::WS_SERVER_LOGS_SYS_TABLE_NAME.
|
private |
Definition at line 6558 of file Catalog.cpp.
References Catalog_Namespace::anonymous_namespace{Catalog.cpp}::get_encoded_text_type(), kBIGINT, kINT, and Catalog_Namespace::TABLES_SYS_TABLE_NAME.
|
private |
Definition at line 6505 of file Catalog.cpp.
References Catalog_Namespace::anonymous_namespace{Catalog.cpp}::get_encoded_text_type(), kBOOLEAN, kINT, and Catalog_Namespace::USERS_SYS_TABLE_NAME.
|
private |
Definition at line 6806 of file Catalog.cpp.
References Catalog_Namespace::anonymous_namespace{Catalog.cpp}::clear_cached_table_data(), Catalog_Namespace::anonymous_namespace{Catalog.cpp}::get_encoded_text_type(), kBIGINT, kSMALLINT, kTIMESTAMP, Catalog_Namespace::anonymous_namespace{Catalog.cpp}::set_common_log_system_table_options(), and Catalog_Namespace::WS_SERVER_ACCESS_LOGS_SYS_TABLE_NAME.
|
private |
Definition at line 6783 of file Catalog.cpp.
References Catalog_Namespace::anonymous_namespace{Catalog.cpp}::clear_cached_table_data(), Catalog_Namespace::anonymous_namespace{Catalog.cpp}::get_encoded_text_type(), kTIMESTAMP, Catalog_Namespace::anonymous_namespace{Catalog.cpp}::set_common_log_system_table_options(), and Catalog_Namespace::WS_SERVER_LOGS_SYS_TABLE_NAME.
|
protected |
Definition at line 1778 of file Catalog.cpp.
References CHECK_EQ, measure< TimeT >::execution(), TableDescriptor::fragmenter, TableDescriptor::fragPageSize, TableDescriptor::fragType, logger::INFO, Fragmenter_Namespace::INSERT_ORDER, LOG, TableDescriptor::maxChunkSize, TableDescriptor::maxFragRows, TableDescriptor::maxRows, TableDescriptor::persistenceLevel, TableDescriptor::shard, TableDescriptor::sortedColumnId, TableDescriptor::storageType, TableDescriptor::tableId, and TableDescriptor::tableName.
void Catalog_Namespace::Catalog::invalidateCachesForTable | ( | const int | table_id | ) |
Definition at line 4229 of file Catalog.cpp.
References CHECK, CHUNK_KEY_DB_IDX, CHUNK_KEY_TABLE_IDX, Executor::clearExternalCaches(), Data_Namespace::CPU_LEVEL, and Data_Namespace::GPU_LEVEL.
bool Catalog_Namespace::Catalog::isInfoSchemaDb | ( | ) | const |
|
inline |
Definition at line 348 of file Catalog.h.
References Catalog_Namespace::DBMetadata::dbName, and getCurrentDB().
Referenced by anonymous_namespace{Calcite.cpp}::check_db_access(), AlterTableAlterColumnCommandRecoveryMgr::getRecoveryFiles(), recordOwnershipOfObjectsInObjectPermissions(), AlterTableAlterColumnCommandRecoveryMgr::resolveIncompleteAlterColumnCommands(), boost::serialization::save_construct_data(), and lockmgr::TableLockMgrImpl< TableDataLockMgr >::validateAndGetExistingTableId().
|
protected |
Definition at line 1694 of file Catalog.cpp.
References DBObjectKey::dbId, logger::INFO, LOG, DBObjectKey::objectId, parse_underlying_dashboard_objects(), DBObjectKey::permissionType, AccessPrivileges::SELECT_FROM_TABLE, AccessPrivileges::SELECT_FROM_VIEW, TableDBObjectType, run_benchmark_import::type, and ViewDBObjectType.
|
private |
Definition at line 5867 of file Catalog.cpp.
References Catalog_Namespace::contains_spaces(), Catalog_Namespace::contains_sql_reserved_chars(), get_quoted_string(), and Catalog_Namespace::is_reserved_sql_keyword().
void Catalog_Namespace::Catalog::reassignOwners | ( | const std::set< std::string > & | old_owners, |
const std::string & | new_owner | ||
) |
Reassigns database object ownership from a set of users (old owners) to another user (new owner).
old_owners | - users whose database object ownership will be reassigned to a new user |
new_owner | - user who will own reassigned database objects |
Definition at line 6161 of file Catalog.cpp.
References Catalog_Namespace::anonymous_namespace{Catalog.cpp}::add_db_object(), AccessPrivileges::ALL_DASHBOARD, AccessPrivileges::ALL_SERVER, AccessPrivileges::ALL_TABLE, AccessPrivileges::ALL_VIEW, CHECK, CHECK_EQ, CHECK_NE, shared::contains(), DashboardDBObjectType, g_enable_fsi, ServerDBObjectType, TableDBObjectType, to_string(), Catalog_Namespace::anonymous_namespace{Catalog.cpp}::validate_and_get_user_id(), and ViewDBObjectType.
|
protected |
Definition at line 797 of file Catalog.cpp.
References AccessPrivileges::ALL_DASHBOARD, AccessPrivileges::ALL_DATABASE, AccessPrivileges::ALL_SERVER, AccessPrivileges::ALL_TABLE, AccessPrivileges::ALL_VIEW, CHECK, currentDB_, DashboardDBObjectType, DatabaseDBObjectType, DBObjectKey::dbId, Catalog_Namespace::DBMetadata::dbId, Catalog_Namespace::DBMetadata::dbName, Catalog_Namespace::DBMetadata::dbOwner, logger::ERROR, SqliteConnector::getData(), SqliteConnector::getNumRows(), getObjForLock(), Catalog_Namespace::SysCatalog::instance(), LOG, name(), DBObjectKey::objectId, DBObjectKey::permissionType, Catalog_Namespace::SysCatalog::populateRoleDbObjects(), SqliteConnector::query(), SqliteConnector::query_with_text_params(), ServerDBObjectType, DBObject::setObjectKey(), DBObject::setOwner(), DBObject::setPrivileges(), sqliteConnector_, TableDBObjectType, to_string(), run_benchmark_import::type, and ViewDBObjectType.
Referenced by CheckAndExecuteMigrations().
|
private |
Definition at line 6898 of file Catalog.cpp.
References CHECK, foreign_storage::ForeignTable::foreign_server, logger::INFO, LOG, foreign_storage::ForeignServer::name, foreign_storage::OptionsContainer::options, and TableDescriptor::tableName.
|
private |
Definition at line 4209 of file Catalog.cpp.
References ColumnDescriptor::columnType, SQLTypeInfo::get_comp_param(), SQLTypeInfo::get_compression(), kENCODING_DICT, TableDescriptor::nColumns, and TableDescriptor::tableId.
|
private |
Definition at line 1190 of file Catalog.cpp.
References Catalog_Namespace::anonymous_namespace{Catalog.cpp}::get_user_id_to_user_name_map().
|
private |
Definition at line 1198 of file Catalog.cpp.
References CHECK_EQ, CHUNK_KEY_DB_IDX, CHUNK_KEY_TABLE_IDX, g_enable_fsi, lockmgr::TableSchemaLockMgr::instance(), and shared::kCatalogDirectoryName.
|
private |
Definition at line 5170 of file Catalog.cpp.
References g_base_path, shared::kDataDirectoryName, and to_string().
Referenced by reloadTableMetadataUnlocked().
|
private |
Definition at line 5142 of file Catalog.cpp.
References CHECK, CHECK_EQ, CHECK_NE, shared::contains(), foreign_storage::ForeignServer::data_wrapper_type, foreign_storage::ForeignTable::foreign_server, g_enable_fsi, foreign_storage::DataWrapperType::IN_MEMORY_DATA_WRAPPERS, TableDescriptor::is_in_memory_system_table, TableDescriptor::is_system_table, foreign_storage::ForeignTable::last_refresh_time, foreign_storage::ForeignTable::next_refresh_time, foreign_storage::OptionsContainer::populateOptionsMap(), TableDescriptor::tableId, TableDescriptor::tableName, and to_string().
|
private |
Definition at line 1093 of file Catalog.cpp.
References getObjForLock(), and reloadTableMetadataUnlocked().
|
private |
Definition at line 1100 of file Catalog.cpp.
References CHECK_EQ, columnDescriptorMapById_, currentDB_, dataMgr_, Catalog_Namespace::DBMetadata::dbId, deletedColumnPerTable_, TableDescriptor::hasDeletedCol, TableDescriptor::nColumns, reloadDictionariesFromDiskUnlocked(), removeFromColumnMap(), tableDescriptorMap_, tableDescriptorMapById_, TableDescriptor::tableName, and to_upper().
Referenced by reloadTableMetadata().
|
private |
Definition at line 4272 of file Catalog.cpp.
References Data_Namespace::CPU_LEVEL, and Data_Namespace::GPU_LEVEL.
|
private |
Definition at line 2686 of file Catalog.cpp.
References CHECK, ColumnDescriptor::columnId, gpu_enabled::sort(), and ColumnDescriptor::tableId.
|
private |
void Catalog_Namespace::Catalog::removeFragmenterForTable | ( | const int | table_id | ) | const |
Definition at line 4260 of file Catalog.cpp.
References CHECK.
Referenced by anonymous_namespace{DBHandler.cpp}::check_and_reset_in_memory_system_table(), foreign_storage::refresh_foreign_table_unlocked(), and TableOptimizer::vacuumDeletedRows().
|
private |
Definition at line 6992 of file Catalog.cpp.
References ColumnDescriptor::columnId, ColumnDescriptor::columnName, ColumnDescriptor::columnType, SQLTypeInfo::is_dict_encoded_type(), ColumnDescriptor::tableId, and to_upper().
Referenced by reloadTableMetadataUnlocked().
|
protected |
Definition at line 1601 of file Catalog.cpp.
References CHECK, CHECK_EQ, CHECK_GE, ColumnDescriptor::columnName, ColumnDescriptor::columnType, Data_Namespace::CPU_LEVEL, TableDescriptor::fragmenter, SQLTypeInfo::get_comp_param(), SQLTypeInfo::get_compression(), TableDescriptor::hasDeletedCol, INJECT_TIMER, kENCODING_DICT, TableDescriptor::persistenceLevel, File_Namespace::renameForDelete(), and to_upper().
void Catalog_Namespace::Catalog::renameColumn | ( | const TableDescriptor * | td, |
const ColumnDescriptor * | cd, | ||
const std::string & | newColumnName | ||
) |
Definition at line 4621 of file Catalog.cpp.
References CHECK, ColumnDescriptor::columnId, ColumnDescriptor::columnName, ColumnDescriptor::columnType, SQLTypeInfo::get_physical_cols(), TableDescriptor::tableId, TableDescriptor::tableName, to_string(), and to_upper().
Referenced by AlterTableAlterColumnCommandRecoveryMgr::rollback().
void Catalog_Namespace::Catalog::renameForeignServer | ( | const std::string & | server_name, |
const std::string & | name | ||
) |
Rename a Foreign Server.
server_name | - Name of the foreign server whose name will be changed |
name | - New name of server |
Definition at line 3438 of file Catalog.cpp.
References CHECK, and setup::name.
|
protected |
Definition at line 705 of file Catalog.cpp.
References SqliteConnector::getNumRows(), getObjForLock(), logger::INFO, LOG, MAPD_VERSION, SqliteConnector::query(), SqliteConnector::query_with_text_params(), sqliteConnector_, and to_string().
Referenced by CheckAndExecuteMigrations().
|
protected |
Definition at line 4378 of file Catalog.cpp.
References CHECK, TableDescriptor::tableId, TableDescriptor::tableName, to_string(), and to_upper().
|
protected |
Definition at line 4444 of file Catalog.cpp.
References CHECK, TableDescriptor::tableName, to_string(), and to_upper().
void Catalog_Namespace::Catalog::renameTable | ( | const TableDescriptor * | td, |
const std::string & | newTableName | ||
) |
Definition at line 4404 of file Catalog.cpp.
References CHECK, DBObjectKey::dbId, DBObjectKey::objectId, DBObjectKey::permissionType, Grantee::renameDbObject(), TableDBObjectType, and TableDescriptor::tableId.
|
private |
void Catalog_Namespace::Catalog::renameTables | ( | const std::vector< std::pair< std::string, std::string >> & | names | ) |
Definition at line 4503 of file Catalog.cpp.
References CHECK, CHECK_EQ, DBObjectKey::dbId, DBObjectKey::objectId, DBObjectKey::permissionType, Grantee::renameDbObject(), Catalog_Namespace::anonymous_namespace{Catalog.cpp}::replace_cached_table_name(), TableDBObjectType, TableDescriptor::tableId, and TableDescriptor::tableName.
void Catalog_Namespace::Catalog::replaceDashboard | ( | DashboardDescriptor & | vd | ) |
Definition at line 4724 of file Catalog.cpp.
References CHECK, DashboardDescriptor::dashboardId, DashboardDescriptor::dashboardMetadata, DashboardDescriptor::dashboardName, DashboardDescriptor::dashboardState, DashboardDescriptor::dashboardSystemRoleName, logger::ERROR, generate_dashboard_system_rolename(), DashboardDescriptor::imageHash, LOG, to_string(), Catalog_Namespace::sqlite_lock< T >::unlock(), Catalog_Namespace::write_lock< T >::unlock(), DashboardDescriptor::updateTime, and DashboardDescriptor::userId.
void Catalog_Namespace::Catalog::resetTableEpochFloor | ( | const int | logicalTableId | ) | const |
Definition at line 5040 of file Catalog.cpp.
Referenced by AlterTableAlterColumnCommandRecoveryMgr::cleanup().
|
private |
Definition at line 6295 of file Catalog.cpp.
References CHECK, CHECK_GT, Catalog_Namespace::anonymous_namespace{Catalog.cpp}::convert_object_owners_map_to_string(), DashboardDBObjectType, logger::FATAL, g_enable_fsi, LOG, ServerDBObjectType, TableDBObjectType, to_string(), UNREACHABLE, and ViewDBObjectType.
|
private |
Definition at line 6344 of file Catalog.cpp.
References CHECK, DashboardDBObjectType, ServerDBObjectType, TableDBObjectType, to_string(), UNREACHABLE, and ViewDBObjectType.
void Catalog_Namespace::Catalog::rollLegacy | ( | const bool | forward | ) |
Definition at line 2718 of file Catalog.cpp.
References CHECK.
|
protected |
Definition at line 3180 of file Catalog.cpp.
References CHECK, Catalog_Namespace::anonymous_namespace{Catalog.cpp}::table_json_filepath(), TableDescriptor::tableId, TableDescriptor::tableName, and VLOG.
|
inline |
Definition at line 268 of file Catalog.h.
References calciteMgr_.
|
protected |
Definition at line 4056 of file Catalog.cpp.
References ColumnDescriptor::columnName, ColumnDescriptor::columnType, g_base_path, SQLTypeInfo::get_comp_param(), SQLTypeInfo::is_array(), shared::kDataDirectoryName, SQLTypeInfo::set_comp_param(), Catalog_Namespace::anonymous_namespace{Catalog.cpp}::set_dict_key(), SQLTypeInfo::set_size(), TableDescriptor::tableName, and to_string().
|
protected |
Definition at line 3987 of file Catalog.cpp.
References CHECK, CHECK_GE, ColumnDescriptor::columnName, ColumnDescriptor::columnType, compress_reference_path(), SQLTypeInfo::get_comp_param(), table_is_temporary(), TableDescriptor::tableName, and to_string().
void Catalog_Namespace::Catalog::setDeletedColumn | ( | const TableDescriptor * | td, |
const ColumnDescriptor * | cd | ||
) |
Definition at line 3940 of file Catalog.cpp.
|
private |
Definition at line 3945 of file Catalog.cpp.
References CHECK.
void Catalog_Namespace::Catalog::setForeignServerDataWrapper | ( | const std::string & | server_name, |
const std::string & | data_wrapper | ||
) |
Set the data wrapper of a Foreign Server.
server_name | - Name of the foreign server whose data wrapper will be set |
data_wrapper | - Data wrapper to use |
Definition at line 3397 of file Catalog.cpp.
References CHECK, foreign_storage::ForeignServer::data_wrapper_type, to_upper(), and foreign_storage::ForeignServer::validate().
void Catalog_Namespace::Catalog::setForeignServerOptions | ( | const std::string & | server_name, |
const std::string & | options | ||
) |
Set the options of a Foreign Server.
server_name | - Name of the foreign server whose options will be set |
options | - Options to set |
Definition at line 3418 of file Catalog.cpp.
References CHECK, foreign_storage::OptionsContainer::options, foreign_storage::OptionsContainer::populateOptionsMap(), and foreign_storage::ForeignServer::validate().
|
private |
Definition at line 5310 of file Catalog.cpp.
References CHECK_EQ, and to_string().
void Catalog_Namespace::Catalog::setForeignTableOptions | ( | const std::string & | table_name, |
foreign_storage::OptionsMap & | options_map, | ||
bool | clear_existing_options = true |
||
) |
Set the options of a Foreign Table.
table_name | - Name of the foreign table whose options will be set |
options | - Options to set |
Definition at line 5827 of file Catalog.cpp.
|
private |
Definition at line 5847 of file Catalog.cpp.
References CHECK_EQ, TableDescriptor::tableId, TableDescriptor::tableName, and to_string().
void Catalog_Namespace::Catalog::setForReload | ( | const int32_t | tableId | ) |
Definition at line 5365 of file Catalog.cpp.
void Catalog_Namespace::Catalog::setMaxRollbackEpochs | ( | const int32_t | table_id, |
const int32_t | max_rollback_epochs | ||
) |
Definition at line 3732 of file Catalog.cpp.
References CHECK, File_Namespace::FileMgrParams::epoch, logger::INFO, LOG, File_Namespace::FileMgrParams::max_rollback_epochs, and TableDescriptorUpdateParams::max_rollback_epochs.
void Catalog_Namespace::Catalog::setMaxRows | ( | const int32_t | table_id, |
const int64_t | max_rows | ||
) |
Definition at line 3757 of file Catalog.cpp.
References CHECK, logger::INFO, LOG, and TableDescriptorUpdateParams::max_rows.
void Catalog_Namespace::Catalog::setTableEpoch | ( | const int | db_id, |
const int | table_id, | ||
const int | new_epoch | ||
) |
Definition at line 3647 of file Catalog.cpp.
References CHECK, Data_Namespace::DISK_LEVEL, File_Namespace::FileMgrParams::epoch, logger::INFO, LOG, and File_Namespace::FileMgrParams::max_rollback_epochs.
Referenced by AlterTableAlterColumnCommandRecoveryMgr::recoverAlterTableAlterColumnFromFile(), and TableArchiver::restoreTable().
void Catalog_Namespace::Catalog::setTableEpochs | ( | const int32_t | db_id, |
const std::vector< TableEpochInfo > & | table_epochs | ||
) | const |
Definition at line 3849 of file Catalog.cpp.
References CHECK, File_Namespace::FileMgrParams::epoch, logger::INFO, LOG, and File_Namespace::FileMgrParams::max_rollback_epochs.
Referenced by UpdelRoll::cancelUpdate(), and import_export::Loader::setTableEpochs().
void Catalog_Namespace::Catalog::setTableEpochsLogExceptions | ( | const int32_t | db_id, |
const std::vector< TableEpochInfo > & | table_epochs | ||
) | const |
Definition at line 3885 of file Catalog.cpp.
References logger::ERROR, LOG, and Catalog_Namespace::anonymous_namespace{Catalog.cpp}::table_epochs_to_string().
Referenced by UpdelRoll::commitUpdate(), TableOptimizer::vacuumDeletedRows(), and TableOptimizer::vacuumFragmentsAboveMinSelectivity().
|
private |
Definition at line 3794 of file Catalog.cpp.
References CHECK, and Data_Namespace::DISK_LEVEL.
void Catalog_Namespace::Catalog::setUncappedTableEpoch | ( | const std::string & | table_name | ) |
Definition at line 3776 of file Catalog.cpp.
References CHECK, Executor::clearExternalCaches(), File_Namespace::FileMgrParams::max_rollback_epochs, TableDescriptorUpdateParams::max_rollback_epochs, to_upper(), and Catalog_Namespace::write_lock< T >::unlock().
|
private |
Definition at line 5194 of file Catalog.cpp.
References Catalog_Namespace::anonymous_namespace{Catalog.cpp}::set_dict_key(), and to_string().
void Catalog_Namespace::Catalog::truncateTable | ( | const TableDescriptor * | td | ) |
Definition at line 4135 of file Catalog.cpp.
void Catalog_Namespace::Catalog::updateCustomExpression | ( | int32_t | custom_expression_id, |
const std::string & | expression_json | ||
) |
Updates the custom expression for the given id with the given expression json string.
custom_expression_id | - id of custom expression to update |
expression_json | - expression json string to be set |
Definition at line 6041 of file Catalog.cpp.
References CHECK_EQ, and to_string().
|
protected |
Definition at line 763 of file Catalog.cpp.
References getCustomExpressionsSchema(), getObjForLock(), SqliteConnector::query(), and sqliteConnector_.
Referenced by CheckAndExecuteMigrations().
|
protected |
Definition at line 555 of file Catalog.cpp.
References logger::ERROR, SqliteConnector::getData(), SqliteConnector::getNumRows(), getObjForLock(), logger::INFO, LOG, SqliteConnector::query(), and sqliteConnector_.
Referenced by CheckAndExecuteMigrations().
|
protected |
Definition at line 528 of file Catalog.cpp.
References Catalog_Namespace::DEFAULT_INITIAL_VERSION, SqliteConnector::getData(), SqliteConnector::getNumRows(), getObjForLock(), logger::INFO, LOG, SqliteConnector::query(), sqliteConnector_, and to_string().
Referenced by CheckAndExecuteMigrations().
|
protected |
Definition at line 579 of file Catalog.cpp.
References currentDB_, Catalog_Namespace::DBMetadata::dbId, Catalog_Namespace::DBMetadata::dbName, Catalog_Namespace::DEFAULT_INITIAL_VERSION, logger::ERROR, g_base_path, SqliteConnector::getData(), SqliteConnector::getNumRows(), getObjForLock(), logger::INFO, shared::kDataDirectoryName, LOG, SqliteConnector::query(), run_benchmark_import::result, sqliteConnector_, and to_string().
Referenced by CheckAndExecuteMigrations().
|
protected |
Definition at line 673 of file Catalog.cpp.
References SqliteConnector::getData(), SqliteConnector::getNumRows(), getObjForLock(), SqliteConnector::query(), and sqliteConnector_.
Referenced by CheckAndExecuteMigrations().
|
protected |
Definition at line 332 of file Catalog.cpp.
References SqliteConnector::getNumRows(), getObjForLock(), logger::INFO, kARRAY, LOG, MAPD_VERSION, SqliteConnector::query(), SqliteConnector::query_with_text_params(), sqliteConnector_, and to_string().
Referenced by CheckAndExecuteMigrations().
void Catalog_Namespace::Catalog::updateForeignTableRefreshTimes | ( | const int32_t | table_id | ) |
Updates the last and next (if applicable) refresh times of the foreign table with the given table id.
table_id | - id of table to apply updates to |
Definition at line 5805 of file Catalog.cpp.
References CHECK, Catalog_Namespace::anonymous_namespace{Catalog.cpp}::get_next_refresh_time(), foreign_storage::RefreshTimeCalculator::getCurrentTime(), and to_string().
Referenced by foreign_storage::refresh_foreign_table_unlocked().
|
private |
Definition at line 5112 of file Catalog.cpp.
References CHECK, shared::contains(), g_enable_fsi, and foreign_storage::DataWrapperType::IN_MEMORY_DATA_WRAPPERS.
|
protected |
Definition at line 470 of file Catalog.cpp.
References SqliteConnector::getNumRows(), getObjForLock(), SqliteConnector::query(), and sqliteConnector_.
Referenced by CheckAndExecuteMigrations().
|
protected |
Definition at line 412 of file Catalog.cpp.
References SqliteConnector::getData(), SqliteConnector::getNumRows(), getObjForLock(), SqliteConnector::query(), and sqliteConnector_.
Referenced by CheckAndExecuteMigrations().
|
protected |
Definition at line 129 of file Catalog.cpp.
References SqliteConnector::getNumRows(), getObjForLock(), SqliteConnector::query(), and sqliteConnector_.
Referenced by CheckAndExecuteMigrations().
|
protected |
Definition at line 692 of file Catalog.cpp.
References getForeignServerSchema(), getForeignTableSchema(), getObjForLock(), SqliteConnector::query(), and sqliteConnector_.
Referenced by CheckAndExecuteMigrations().
|
protected |
Definition at line 370 of file Catalog.cpp.
References SqliteConnector::getNumRows(), getObjForLock(), logger::INFO, kLINESTRING, kMULTILINESTRING, kMULTIPOINT, kMULTIPOLYGON, kPOINT, kPOLYGON, LOG, MAPD_VERSION, SqliteConnector::query(), SqliteConnector::query_with_text_params(), sqliteConnector_, and to_string().
Referenced by CheckAndExecuteMigrations().
|
private |
Definition at line 6960 of file Catalog.cpp.
References ColumnDescriptor::columnId, ColumnDescriptor::columnName, ColumnDescriptor::columnType, Catalog_Namespace::anonymous_namespace{Catalog.cpp}::get_checked_table_name(), shared::get_from_map(), SQLTypeInfo::is_dict_encoded_type(), ColumnDescriptor::tableId, and to_upper().
void Catalog_Namespace::Catalog::updateLeaf | ( | const LeafHostInfo & | string_dict_host | ) |
|
protected |
Definition at line 447 of file Catalog.cpp.
References SqliteConnector::getData(), SqliteConnector::getNumRows(), getObjForLock(), SqliteConnector::query(), and sqliteConnector_.
Referenced by CheckAndExecuteMigrations().
|
protected |
Definition at line 631 of file Catalog.cpp.
References getObjForLock(), SqliteConnector::query(), and sqliteConnector_.
Referenced by CheckAndExecuteMigrations().
|
protected |
Definition at line 645 of file Catalog.cpp.
References CHECK, getObjForLock(), logicalToPhysicalTableMapById_, SqliteConnector::query(), SqliteConnector::query_with_text_params(), sqliteConnector_, and to_string().
|
protected |
Definition at line 498 of file Catalog.cpp.
References currentDB_, Catalog_Namespace::DBMetadata::dbName, Catalog_Namespace::DEFAULT_INITIAL_VERSION, SqliteConnector::getData(), SqliteConnector::getNumRows(), getObjForLock(), logger::INFO, LOG, SqliteConnector::query(), sqliteConnector_, and to_string().
Referenced by CheckAndExecuteMigrations().
|
protected |
Definition at line 265 of file Catalog.cpp.
References DEFAULT_MAX_CHUNK_SIZE, SqliteConnector::getData(), SqliteConnector::getNumRows(), getObjForLock(), shared::kRootUserId, SqliteConnector::query(), sqliteConnector_, and to_string().
Referenced by CheckAndExecuteMigrations().
|
private |
Definition at line 1405 of file Catalog.cpp.
|
private |
Definition at line 1395 of file Catalog.cpp.
References CHECK_EQ, TableDescriptor::tableId, TableDescriptor::tableName, to_string(), and TableDescriptor::viewSQL.
bool Catalog_Namespace::Catalog::validateNonExistentTableOrView | ( | const std::string & | name, |
const bool | if_not_exists | ||
) |
Validates that a table or view with given name does not already exist. An exception is thrown if a table or view with given name already exists and "if_not_exists" is false.
name | - Name of table or view whose existence is checked |
if_not_exists | - flag indicating whether or not existence of a table or view with given name is an exception |
Definition at line 5772 of file Catalog.cpp.
|
friend |
|
protected |
Definition at line 706 of file Catalog.h.
Referenced by getCatalogBasePath(), and ~Catalog().
|
protected |
Definition at line 725 of file Catalog.h.
Referenced by getCalciteMgr(), and setCalciteMgr().
|
staticprivate |
|
protected |
Definition at line 709 of file Catalog.h.
Referenced by ~Catalog().
|
protected |
Definition at line 710 of file Catalog.h.
Referenced by reloadTableMetadataUnlocked().
|
protected |
|
protected |
Definition at line 721 of file Catalog.h.
Referenced by buildDictionaryMapUnlocked(), createDashboardSystemRoles(), getCurrentDB(), getDatabaseId(), recordOwnershipOfObjectsInObjectPermissions(), reloadTableMetadataUnlocked(), updateDictionaryNames(), updatePageSize(), and ~Catalog().
|
protected |
|
protected |
|
protected |
Definition at line 722 of file Catalog.h.
Referenced by getDataMgr(), and reloadTableMetadataUnlocked().
|
mutable |
|
private |
Definition at line 774 of file Catalog.h.
Referenced by reloadTableMetadataUnlocked().
|
protected |
|
protected |
Definition at line 711 of file Catalog.h.
Referenced by buildDictionaryMapUnlocked().
|
mutable |
|
staticprivate |
|
protected |
|
protected |
bool Catalog_Namespace::Catalog::initialized_ = false |
Definition at line 914 of file Catalog.h.
Referenced by getObjForLock().
|
staticprivate |
|
protected |
|
protected |
|
protected |
Definition at line 727 of file Catalog.h.
Referenced by updateLogicalToPhysicalTableMap().
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
protected |
|
staticprotected |
|
mutable |
|
protected |
Definition at line 720 of file Catalog.h.
Referenced by buildDictionaryMapUnlocked(), checkDateInDaysColumnMigration(), createDashboardSystemRoles(), getSqliteConnector(), recordOwnershipOfObjectsInObjectPermissions(), renameLegacyDataWrappers(), updateCustomExpressionsSchema(), updateDefaultColumnValues(), updateDeletedColumnIndicator(), updateDictionaryNames(), updateDictionarySchema(), updateFixlenArrayColumns(), updateFrontendViewAndLinkUsers(), updateFrontendViewSchema(), updateFrontendViewsToDashboards(), updateFsiSchemas(), updateGeoColumns(), updateLinkSchema(), updateLogicalToPhysicalTableLinkSchema(), updateLogicalToPhysicalTableMap(), updatePageSize(), and updateTableDescriptorSchema().
|
mutable |
|
staticprivate |
|
protected |
|
protected |
Definition at line 707 of file Catalog.h.
Referenced by reloadTableMetadataUnlocked(), and ~Catalog().
|
protected |
Definition at line 708 of file Catalog.h.
Referenced by checkDateInDaysColumnMigration(), checkDropRenderGroupColumnsMigration(), and reloadTableMetadataUnlocked().
|
mutable |
|
mutable |
|
static |