1 show databases; 2 desc t_partition001; 3 desc extended t_partition002; 4 desc formatted t_partition002; 5 !clear; 6 !ls; 7 dfs -ls /;
2 DML操作
load
load data local inpath '/root/hivedata/t_partitioned' into table t_partition001 partition(country="Japan"); load data inpath '/t_partitioned' into table t_partition001 partition(country="Japan");
overwrite
load data local inpath '/root/hivedata/stu_partition2' overwrite into table stu_partition partition(city="China");
like
create table t_1 like stu_partition;
insert
insert overwrite table t_1 partition(city='Japan') select id,name,age from stu_partition;
-- 导出数据insert overwrite local directory '/root/hivedata/data' select * from student;
insert overwrite directory '/root/hivedata/data' select * from student;
3 multi insert 多重插入
4 Dynamic partition inserts 动态分区插入
5 自动分区模式
set hive.exec.dynamic.partition.mode=nonstrict;