一、修改hive表注释
ALTER TABLE 表名 SET TBLPROPERTIES('comment' = '表注释内容');
二、修改hive表字段注释
ALTER TABLE 表名 CHANGE 列名 新的列名 新列名类型 COMMENT '列注释';
CREATE TABLE test_change (a int , b int , c int );
// First change column a's name to a1.
ALTER TABLE test_change CHANGE a a1 INT;
// Next change column a1's name to a2, its data type to string, and put it after column b.
ALTER TABLE test_change CHANGE a1 a2 STRING AFTER b;
// The new table's structure is: b int, a2 string, c int.
// Then change column c's name to c1, and put it as the first column.
ALTER TABLE test_change CHANGE c c1 INT FIRST;
// The new table's structure is: c1 int, b int, a2 string.
// Add a comment to column a1
ALTER TABLE test_change CHANGE a1 a1 INT COMMENT 'this is column a1' ;
|