OmniSciDB
a5dc49c757
|
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 > | getAllDashboardsMetadataForSysTable () 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 174 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 234 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 2538 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 2711 of file Catalog.cpp.
References CHECK, ColumnDescriptor::columnId, ColumnDescriptor::isGeoPhyCol, gpu_enabled::sort(), and ColumnDescriptor::tableId.
|
private |
Definition at line 2472 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 2459 of file Catalog.cpp.
|
private |
Definition at line 2252 of file Catalog.cpp.
References CHECK, DictDescriptor::dictFolderPath, and ColumnDescriptor::tableId.
DictRef Catalog_Namespace::Catalog::addDictionaryTransactional | ( | ColumnDescriptor & | cd | ) |
Definition at line 2237 of file Catalog.cpp.
|
protected |
Definition at line 1686 of file Catalog.cpp.
|
protected |
Definition at line 1691 of file Catalog.cpp.
References DashboardDescriptor::dashboardName, to_string(), and DashboardDescriptor::userId.
|
protected |
Definition at line 1773 of file Catalog.cpp.
References LinkDescriptor::link, LinkDescriptor::linkId, and to_string().
|
protected |
Definition at line 3975 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 1545 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 7007 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 2393 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 3690 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 3717 of file Catalog.cpp.
References CHECK, logger::FATAL, LOG, TableDescriptor::tableId, and TableDescriptor::tableName.
|
private |
Definition at line 1336 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 1517 of file Catalog.cpp.
|
private |
Definition at line 1420 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 1075 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 5102 of file Catalog.cpp.
References CHECK, and g_enable_fsi.
|
private |
Definition at line 1445 of file Catalog.cpp.
References to_string().
|
private |
Definition at line 1465 of file Catalog.cpp.
References CHECK.
|
protected |
Definition at line 1492 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 1277 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 4811 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 3396 of file Catalog.cpp.
References CHECK, to_string(), and foreign_storage::ForeignServer::user_id.
|
protected |
Definition at line 1015 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 1039 of file Catalog.cpp.
References checkDateInDaysColumnMigration(), and createDashboardSystemRoles().
|
protected |
Definition at line 928 of file Catalog.cpp.
References getCurrentDB(), getObjForLock(), migrations::MigrationMgr::migrateDateInDaysMetadata(), sqliteConnector_, and tableDescriptorMapById_.
Referenced by CheckAndExecuteMigrationsPostBuildMaps().
bool Catalog_Namespace::Catalog::checkDropRenderGroupColumnsMigration | ( | ) |
Definition at line 934 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 3913 of file Catalog.cpp.
References CHECK, and TableDescriptor::fragmenter.
void Catalog_Namespace::Catalog::checkpoint | ( | const int | logicalTableId | ) | const |
Definition at line 5032 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 5040 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 6392 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 5954 of file Catalog.cpp.
References CHECK, CHECK_EQ, CHECK_GT, and to_string().
int32_t Catalog_Namespace::Catalog::createDashboard | ( | DashboardDescriptor & | vd | ) |
Definition at line 4670 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 939 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 5341 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 3293 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 3301 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 4823 of file Catalog.cpp.
References LinkDescriptor::link, LinkDescriptor::linkId, to_string(), LinkDescriptor::updateTime, LinkDescriptor::userId, LinkDescriptor::viewMetadata, and LinkDescriptor::viewState.
|
protected |
Definition at line 1727 of file Catalog.cpp.
References Grantee::findDbObject(), Grantee::getDbObjects(), lockmgr::instance(), 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 4109 of file Catalog.cpp.
References CHECK, TableDescriptor::nShards, TableDescriptor::shard, table_is_temporary(), TableDescriptor::tableId, and TableDescriptor::tableName.
|
private |
Definition at line 6856 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 2945 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 5253 of file Catalog.cpp.
References logger::FATAL, StorageType::FOREIGN_TABLE, LOG, and to_string().
|
private |
Definition at line 2290 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 2277 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 6079 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 2014 of file Catalog.cpp.
References DashboardDBObjectType, AccessPrivileges::DELETE_DASHBOARD, lockmgr::instance(), and to_string().
|
private |
Definition at line 4320 of file Catalog.cpp.
References TableDescriptor::tableId, and to_string().
|
protected |
Definition at line 4153 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, lockmgr::instance(), kENCODING_DICT, File_Namespace::renameForDelete(), ColumnDescriptor::tableId, and TableDescriptor::tableId.
void Catalog_Namespace::Catalog::dropColumn | ( | const TableDescriptor & | td, |
const ColumnDescriptor & | cd | ||
) |
Definition at line 2663 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 2617 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 2650 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 2601 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 3460 of file Catalog.cpp.
References CHECK_EQ, and to_string().