Hive动态分区
来源:互联网 发布:数据库原理视频教程 编辑:程序博客网 时间:2024/05/26 02:52
动态分区指不需要为不同的分区添加不同的插入语句,分区不确定,需要从数据中获取。
相关参数设置
set hive.exec.dynamic.partition=true; //使用动态分区(可通过这个语句查看:set hive.exec.dynamic.partition;) set hive.exec.dynamic.partition.mode=nonstrict;//无限制模式 如果模式是strict,则必须有一个静态分区,且放在最前面。SET hive.exec.max.dynamic.partitions.pernode=10000;每个节点生成动态分区最大个数set hive.exec.max.dynamic.partitions=100000;,生成动态分区最大个数,如果自动分区数大于这个参数,将会报错set hive.exec.max.created.files=150000; //一个任务最多可以创建的文件数目set dfs.datanode.max.xcievers=8192;//限定一次最多打开的文件数
一个分区的情况
create table dynpar(name string)partitioned by (value string)row format delimited fields terminated by '\t' lines terminated by '\n' stored as textfile;
·
两个分区的情况
create table dynpar2(name string)partitioned by (value string,dt string)row format delimited fields terminated by '\t' lines terminated by '\n' stored as textfile;insert overwrite table dynpar2 partition(value,dt)select 'test' as name, addr as value, name as dtfrom testtable;show partitions dynpar2;select * from dynpar2;如果模式是strict,则必须有一个静态分区,且放在最前面。eg:insert overwrite table dynpar2 partition(value='10001',dt)select 'test' as name, name as dtfrom testtable;否则,不能够成功。
0 0
- Hive 动态分区 & 静态分区
- hive动态分区
- Hive动态分区
- Hive动态分区
- HIVE动态分区实战
- Hive动态分区
- Hive动态分区
- hive 动态分区
- 05-Hive动态分区
- hive动态分区
- Hive动态分区
- hive动态分区
- Hive动态分区
- hive 动态分区使用
- Hive动态分区配置
- hive实战---动态分区
- Hive动态分区
- hive 动态分区
- wordpress添加后台菜单及权限设置
- maven的pom.xml详解
- Inotify监视限值不足问题
- c++ 遍历lua table方法
- zoj 3636 Decode
- Hive动态分区
- 飞机最少换乘次数问题
- 初识WebP
- DIY:使用扩展程序在Chrome下干掉各种恶心的广告
- input输入框中的光标上下不居中的解决方法
- Java内存模型
- 水王争霸
- 别人——要什么
- LINQ使用与并行