We cannot just remove the table column from the hive table using the following statement, for example sql.
ALTER TABLE tbl_name drop column column_name ---- it will not work.
So, there is a shortcut to remove columns from the hive table.
Let's say we have a beehive table.
From this table I want to remove the Dob column. You can use the ALTER TABLE REPLACE statement to delete a column.
ALTER TABLE test_tbl REPLACE COLUMNS(ID STRING,NAME STRING,AGE STRING); you have to give the column names which you want to keep in the table
source
share