OmniSciDB
a5dc49c757
|
#include <DdlCommandExecutor.h>
Public Types | |
using | TypePairs = alter_column_shared::TypePairs |
Public Member Functions | |
AlterTableAlterColumnCommand (const DdlCommandData &ddl_data, std::shared_ptr< Catalog_Namespace::SessionInfo const > session_ptr) | |
ExecutionResult | execute (bool read_only_mode) override |
Public Member Functions inherited from DdlCommand | |
DdlCommand (const DdlCommandData &ddl_data, std::shared_ptr< Catalog_Namespace::SessionInfo const > session_ptr) | |
Private Member Functions | |
void | alterColumn () |
void | populateAndWriteRecoveryInfo (const TableDescriptor *td, const TypePairs &src_dst_cds) |
void | cleanupRecoveryInfo (const TableDescriptor *td) |
void | alterColumnTypes (const TableDescriptor *td, const TypePairs &src_dst_cds) |
void | collectExpectedCatalogChanges (const TableDescriptor *td, const TypePairs &src_dst_cds) |
std::list< std::list < ColumnDescriptor > > | prepareGeoColumns (const TableDescriptor *td, const TypePairs &src_dst_cds) |
std::list< const ColumnDescriptor * > | prepareColumns (const TableDescriptor *td, const TypePairs &src_dst_cds) |
void | alterColumns (const TableDescriptor *td, const TypePairs &src_dst_cds) |
void | alterNonGeoColumnData (const TableDescriptor *td, const std::list< const ColumnDescriptor * > &cds) |
void | alterGeoColumnData (const TableDescriptor *td, const std::list< std::pair< const ColumnDescriptor *, std::list< const ColumnDescriptor * >>> &geo_src_dst_cds) |
void | clearInMemoryData (const TableDescriptor *td, const TypePairs &src_dst_cds) |
Private Attributes | |
AlterTableAlterColumnCommandRecoveryMgr::RecoveryInfo | recovery_info_ |
AlterTableAlterColumnCommandRecoveryMgr | recovery_mgr_ |
Additional Inherited Members | |
Protected Attributes inherited from DdlCommand | |
const DdlCommandData & | ddl_data_ |
std::shared_ptr < Catalog_Namespace::SessionInfo const > | session_ptr_ |
Definition at line 114 of file DdlCommandExecutor.h.
Definition at line 122 of file DdlCommandExecutor.h.
AlterTableAlterColumnCommand::AlterTableAlterColumnCommand | ( | const DdlCommandData & | ddl_data, |
std::shared_ptr< Catalog_Namespace::SessionInfo const > | session_ptr | ||
) |
Definition at line 2754 of file DdlCommandExecutor.cpp.
References CHECK, CHECK_EQ, DdlCommand::ddl_data_, and anonymous_namespace{DdlCommandExecutor.cpp}::extractPayload().
|
private |
Definition at line 3030 of file DdlCommandExecutor.cpp.
References alterColumnTypes(), CHECK, Parser::check_alter_table_privilege(), DdlCommand::ddl_data_, anonymous_namespace{DdlCommandExecutor.cpp}::extractPayload(), anonymous_namespace{DdlCommandExecutor.cpp}::get_alter_column_pairs_from_src_dst_cds(), anonymous_namespace{DdlCommandExecutor.cpp}::get_alter_column_src_dst_cds(), Parser::get_columns_from_json_payload(), DdlCommand::session_ptr_, ddl_utils::TABLE, table_is_temporary(), and ddl_utils::validate_table_type().
Referenced by execute().
|
private |
Definition at line 2790 of file DdlCommandExecutor.cpp.
References CHECK, ddl_utils::alter_column_utils::compare_column_descriptors(), and DdlCommand::session_ptr_.
Referenced by alterColumnTypes().
|
private |
Definition at line 2980 of file DdlCommandExecutor.cpp.
References alterColumns(), alterGeoColumnData(), alterNonGeoColumnData(), AlterTableAlterColumnCommandRecoveryMgr::checkpoint(), AlterTableAlterColumnCommandRecoveryMgr::cleanup(), cleanupRecoveryInfo(), clearInMemoryData(), logger::FATAL, anonymous_namespace{DdlCommandExecutor.cpp}::get_alter_column_geo_pairs_from_src_dst_pairs_phys_cds(), LOG, populateAndWriteRecoveryInfo(), prepareColumns(), prepareGeoColumns(), recovery_info_, recovery_mgr_, AlterTableAlterColumnCommandRecoveryMgr::rollback(), DdlCommand::session_ptr_, TableDescriptor::tableId, and anonymous_namespace{DdlCommandExecutor.cpp}::vacuum_table_if_required().
Referenced by alterColumn().
|
private |
Definition at line 2873 of file DdlCommandExecutor.cpp.
References CHECK, and TableDescriptor::fragmenter.
Referenced by alterColumnTypes().
|
private |
Definition at line 2859 of file DdlCommandExecutor.cpp.
References CHECK, and TableDescriptor::fragmenter.
Referenced by alterColumnTypes().
|
private |
Definition at line 2950 of file DdlCommandExecutor.cpp.
References AlterTableAlterColumnCommandRecoveryMgr::getRecoveryFilepathInfo(), recovery_mgr_, AlterTableAlterColumnCommandRecoveryMgr::recoveryFilepath(), and TableDescriptor::tableId.
Referenced by alterColumnTypes().
|
private |
Definition at line 2888 of file DdlCommandExecutor.cpp.
References Executor::clearExternalCaches(), Data_Namespace::CPU_LEVEL, Data_Namespace::GPU_LEVEL, DdlCommand::session_ptr_, and TableDescriptor::tableId.
Referenced by alterColumnTypes().
|
private |
Definition at line 2904 of file DdlCommandExecutor.cpp.
References AlterTableAlterColumnCommandRecoveryMgr::RecoveryInfo::added_columns, AlterTableAlterColumnCommandRecoveryMgr::RecoveryInfo::altered_columns, CHECK, ColumnDescriptor::columnId, ddl_utils::alter_column_utils::compare_column_descriptors(), recovery_info_, AlterTableAlterColumnCommandRecoveryMgr::RecoveryInfo::renamed_columns, DdlCommand::session_ptr_, ddl_utils::alter_column_utils::CompareResult::sql_types_match, ColumnDescriptor::tableId, TableDescriptor::tableId, and AlterTableAlterColumnCommandRecoveryMgr::RecoveryInfo::updated_dict_cds.
Referenced by populateAndWriteRecoveryInfo().
|
overridevirtual |
Executes the DDL command corresponding to provided JSON payload.
_return | result of DDL command execution (if applicable) |
Implements DdlCommand.
Definition at line 3074 of file DdlCommandExecutor.cpp.
References alterColumn(), g_cluster, and legacylockmgr::getExecuteReadLock().
Referenced by heavydb.cursor.Cursor::executemany().
|
private |
Definition at line 2959 of file DdlCommandExecutor.cpp.
References CHECK_GT, collectExpectedCatalogChanges(), AlterTableAlterColumnCommandRecoveryMgr::getRecoveryFilepathInfo(), TableDescriptor::hasDeletedCol, AlterTableAlterColumnCommandRecoveryMgr::RecoveryInfo::is_vacuumed, recovery_info_, recovery_mgr_, AlterTableAlterColumnCommandRecoveryMgr::recoveryFilepath(), DdlCommand::session_ptr_, AlterTableAlterColumnCommandRecoveryMgr::RecoveryInfo::src_dst_cds, AlterTableAlterColumnCommandRecoveryMgr::RecoveryInfo::table_epoch, TableDescriptor::tableId, and AlterTableAlterColumnCommandRecoveryMgr::writeSerializedRecoveryInformation().
Referenced by alterColumnTypes().
|
private |
Definition at line 2806 of file DdlCommandExecutor.cpp.
References ddl_utils::alter_column_utils::compare_column_descriptors(), and DdlCommand::session_ptr_.
Referenced by alterColumnTypes().
|
private |
Definition at line 2832 of file DdlCommandExecutor.cpp.
References DdlCommand::session_ptr_, and to_string().
Referenced by alterColumnTypes().
|
private |
Definition at line 155 of file DdlCommandExecutor.h.
Referenced by alterColumnTypes(), collectExpectedCatalogChanges(), and populateAndWriteRecoveryInfo().
|
private |
Definition at line 156 of file DdlCommandExecutor.h.
Referenced by alterColumnTypes(), cleanupRecoveryInfo(), and populateAndWriteRecoveryInfo().