hive分区表几大注意事项
来源:互联网 发布:手机淘宝脸部拍摄认证 编辑:程序博客网 时间:2024/05/16 13:16
分区表:
1.问题的引入
1).bf_log
/usr/hive/warehouse
20170910.log
20170922.log
我想分析某一天的数据,如果按照以上的就会扫描全表,从而增加了数据库的压力,引入了分区表
2)./usr/hive/warehouse
20170910/
20170910.log
20170922/
20170922.log
2.分区表实际上就是对应一个HDFS文件的文件系统上一个文件夹,该文件下就是该分区所有数据的文件,hive中的分区就是分目录,就是把一个大的数据集根据业务需求拆分成更小的数据集.就跟Java中的查询时通过where子句中的表达式来选择分区,这样的查询效率会提高很多。
create table db_hive.dept_partition(
deptno int,dname string,loc string)
partitioned by(month string)
row format delimited fields terminated by ‘\t’;
load data local inpath ‘数据路径’ into table db_hive.dept_partition partition(month=’2017-09-12’);
注意事项:
create table db_hive.dept_partition(
deptno int,dname string,loc string)
row format delimited fields terminated by ‘\t’;
create table db_hive.dept_partition(
deptno int,dname string,loc string)
partitioned by(month string)
row format delimited fields terminated by ‘\t’;
向hdfs上传对应的数据
msck repair table db_hive.dept_partition;就可以加载导数据
alert table db_hive.dept_partition add partition(day string);
- hive分区表几大注意事项
- Hive分区表添加分区时的注意事项
- hive 分区表使用的一些注意事项
- hive 分区表
- Hive分区表
- Hive分区表
- Hive分区表
- hive 分区表
- hive分区表
- hive分区表
- Hive静态分区表&动态分区表
- [Hive]Hive分区表新增字段
- 友情链接交换的几大注意事项
- hive sql分区表
- hive创建分区表问题
- hive sql分区表
- hive创建分区表问题
- HIVE的分区表
- Java-String总结
- ACL访问控制列表
- 轨迹数据挖掘(trajectory data mining)
- hdu 3182(状压dp)
- 泛函分析简列:度量空间之逼近定理及有穷维B*空间刻画
- hive分区表几大注意事项
- Java堆栈常量池深入
- tomcat手动部署war包
- 深度学习与传统机器学习算法的区别与应用
- ARP地址解析协议
- 阵元校正
- [bzoj1095][ZJOI2007]Hide 捉迷藏(动态点分治)
- MiniGUI 体系结构之二
- Equifax 与传统密码的危机