Hive Alter table change Column Name

Change Column Name/Type/Position/Comment: ALTER TABLE table_name CHANGE [COLUMN] col_old_name col_new_name column_type [COMMENT col_comment] [FIRST|AFTER column_name] Example: CREATE TABLE test_change (a int, b int, c int); // will change column a’s name to a1 ALTER TABLE test_change CHANGE a a1 INT;

error: ALTER TYPE … ADD cannot run inside a transaction block

As it was mentioned above you can’t edit enum within transaction block. But you can create the new one. Here are the steps: Change type from request_type to varchar for all columns/tables which use this type: ALTER TABLE table_name ALTER COLUMN column_name TYPE VARCHAR(255); Drop and create again request_type enum: DROP TYPE IF EXISTS request_type; … Read more