-
Rename the
syntax:
the ALTER the Table table name rename to new table name; -
Add Field:
ALTER table Table add columns (1 Field Name Data Type 1, ...); -
Alternatively modify the field all fields
alter table table replace columns (1 Field Name Data Type 1, ...); -
Nature of the partition table is added to add a new partition on a subdirectory HDFS
ALTER table Table add partition (partition field = value, ...);alter table logs add partition (dt='2018-08-09',country='cq'); alter table studnet_p add partition ( class='bigdata0003' );
-
Delete Partition
alter table table name drop partition (partition field = value, ...);
alter table logs drop partition (dt = '2018-08-09', Country = 'CQ');
alter table studnet_p drop partition (class = 'bigdata0003 '); -
Modify a field
alter table table name change columns (1 Field Name Data Type 1, ...);
Delete the table:
drop table if exists 表名
When the read mode: when the hive queries to check the correctness of the data card
Write mode: pass through a relational database, data is inserted to check the correctness of the data card