您的位置:首页 > 其它

Hive 分区

2016-05-10 08:28 253 查看
1. 建立多个表,每个表导入不同的数据
create table test_1 (id int);
create table test_2 (id int);

create
table test_3 (id int);

............
2.
创建分区表
create table test(id int) partitioned by (name sting);
alter table test add partition (name = '1')
alter table test add partition (name = '2')
切忌分区过多, namenode 压力太大
3. 分区数目太多可以考虑分桶

create table test(id int, name string) partitioned by (age int) clustered by (id) into 96 buckets;
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: