其他分享
首页 > 其他分享> > 35-大数据-hive 分区又分桶

35-大数据-hive 分区又分桶

作者:互联网

create table t_part_buck(id int,name string) partitioned by (sex string)
clustered by (id) sorted by (id asc) into 4 buckets
row format delimited fields terminated by ‘,’;

1、插入数据
insert into t_part_buck partition(sex=‘male’) select id,name from t_id ;

2、查看数据
select * from t_part_buck tablesample(bucket 3 out of 4 on id);

标签:buck,分桶,into,35,sex,part,hive,id,select
来源: https://blog.csdn.net/yaoyelinger0912/article/details/95774938