解决方案: 1.删除分区后重新跑数据 alter table drop partition(分区字段=“”): 2.新增字段运行程序后其实数据已经有了,只是查询hive的时候无法显示出来, 这个时候只要刷新一下表结构就出来了 ALTER TABLE name REPLACE COLUMNS (col_spec[, col_spec ...]):
分区是hive存放数据的一种方式.将列值作为目录来存放数据,就是一个分区.这样where中给出列值时,只需根据列值直接扫描对应目录下的数据,不扫面其他不关心的分区,快速定位,查询节省大量时间.分动态和静态分区两种 动态分区 1)不显示的给出分区名,根据列的取值自动建立对应分区(多少种取值,多少种分区),所以需要限制最大分区数: SET hive.exec.dynamic.partition=true; SET hive.exec.max.dynamic.partitions.pernode=10
一.普通磁盘分区管理方式 1.对磁盘进行分区 列出磁盘 # fdisk -l # fdisk /dev/vdb Welcome to fdisk (util-linux 2.23.2). Changes will remain in memory only, until you decide to write them. Be careful before using the write command. Device does not contain a recognized partitio