分区是hive存放数据的一种方式.将列值作为目录来存放数据,就是一个分区.这样where中给出列值时,只需根据列值直接扫描对应目录下的数据,不扫面其他不关心的分区,快速定位,查询节省大量时间.分动态和静态分区两种 动态分区 1)不显示的给出分区名,根据列的取值自动建立对应分区(多少种取值,多少种分区),所以需要限制最大分区数: SET hive.exec.dynamic.partition=true; SET hive.exec.max.dynamic.partitions.pernode=10…