Search

How can we change a column data type in Hive?



We can use below command to alter data type of a column in hive.
Shell

ALTER TABLE table_name CHANGE column_name column_name new_datatype;

Example: If we want to change the data type of empid column from integer to bigint in a
table called employee.

Shell

ALTER TABLE employee CHANGE empid empid BIGINT;