Wednesday 12 August 2015

Alter table Statements in hive


Hive allows to add additional table properties or modify existing properties of a table using alter statements, but not to remove them.

Renaming a table column:-

The following alter query renames the column name and its datatype-

Alter table clus3 change column id1 id_1 int after name;

Modifying existing table storage properties:-

The following query will modify the properties of array:-

Alter table clus2 set SERDEPROPERTIES ('colection.delim'= '=');

The following query will modify the properties of row fields:-

Alter table clus2 set SERDEPROPERTIES ('field.delim'= ':');

The following query will modify the properties of Map datatype:-


Alter table clus2 set SERDEPROPERTIES ('mapkey.delim'= '|');

No comments:

Post a Comment