Partition 对应于数据库的 Partition 列的密集索引
在 Hive 中,表中的一个 Partition 对应于表下的一个目录,所有的 Partition 的数据都存储在对应的目录中
- 例如:
- test表中包含 date 和 city 两个 Partition
则对应于date=20130201, city = bj 的 HDFS 子目录为:
/warehouse/test/date=20130201/city=bj
对应于date=20130202, city=sh 的HDFS 子目录为;
/warehouse/test/date=20130202/city=sh
创建表
create table partition_table(id int,name string) partitioned by(age int,high int);alter table partition_table add partition (age=20,high=180);insert into hive_test.partition_table PARTITION (age,high) values (1,'xubin',20,180);insert overwrite table partition_table partition (age=20,high=180) select id,name from external_table where age =20 and high = 180;insert overwrite table partition_table partition (age=21,high=180) select id,name from external_table where age =21 and high = 180; 继续阅读与本文标签相同的文章
上一篇 :
eclipse启动报错
下一篇 :
hive分桶表
-
弹性伸缩定时任务支持Crontab
2026-05-25栏目: 教程
-
关于Python的几个过坑指南(MySQL-python、tornado)
2026-05-25栏目: 教程
-
教你如何使用 flask 框架在浏览器打印 hello world
2026-05-25栏目: 教程
-
@ConditionalOn...注解,条件组合你知道吗?
2026-05-25栏目: 教程
-
表观调控13张图之一证明基因干扰有效性
2026-05-25栏目: 教程
