05分布式数据仓库 HIVE -- 分区表的操作
来源:互联网 发布:类似foxtable的软件 编辑:程序博客网 时间:2024/05/21 03:29
创建分区
create table user(
name string
)
partitioned by (dt string,b string);
添加分区
alter table user add if not exists partition(dt='20140405',b='boy');
删除分区
alter table user drop if extists partition(dt='20140405',b='girl');
导入分区数据
load data local inpath '/home/data/user.txt' overwrite into table user partition(dt='20140405'); //overwrite覆盖原始文件。非overwrite
load data inpath '/home/data/user.txt' overwrite into table userr partition(dt='20140405'); //剪切过去,不是复制过去。
insert into(overwrite) table user partition(dt='20140405')
select name,age from student
where sex = 1;
自动化分区
create table user{name} partitioned by (dt string) row format delimited fields terminated by '\t' lines terminated by '\n' stored as textfil;
show partitions user;
select * from user;
set hive.exec.dynamic.partition = true; //在一次hive cli界面内生效。
set hive.exec.dynamic.parttion.mode = nonstrict; //strict第一个分区需要固定
insert overwrite table user partiton(dt) select name,age as dt from student;
show partitions user;
select * from user where dt = '1';
hadoop fs -text "warehouse/user";
分区在创建,插入,查询阶段,需要保持分区的顺序一致。
- 05分布式数据仓库 HIVE -- 分区表的操作
- 02分布式数据仓库 HIVE -- 表的相关操作
- 03分布式数据仓库 HIVE -- 数据的相关操作
- Hive中分区表的操作
- Hive学习笔记 --- Hive分区表的操作
- 关于HIVE数据仓库的基本操作
- 关于HIVE数据仓库的基本操作
- Hive分区表操作
- Hive数据仓库相关操作
- 07分布式数据仓库 HIVE -- 函数
- hive 的表操作问题 hive中简单介绍分区表
- 09分布式数据仓库 HIVE -- HIVE优化
- HIVE的分区表
- Hive的数据模型-分区表
- 06分布式数据仓库 HIVE -- 数据的查询(HQL Hive Query Language)
- HIVE在腾讯分布式数据仓库实践
- 01分布式数据仓库 HIVE -- 数据类型-文件格式
- 04分布式数据仓库 HIVE -- 导出分析结果
- LEETCODE: Edit Distance
- 【Linux-FTP】CentOS6.4_X64安装配置vsFTP-2.2.2
- 《世界因你而不同》阅读笔记
- OC-4
- 【好程序员特训营】Java中随机数处理
- 05分布式数据仓库 HIVE -- 分区表的操作
- activity切换时的动画
- 第十七周项目五玩日期时间(1)(2)(3)(4)
- 【记录】Coolpy开机自启之Windows
- 第17周项目4.1 日期结构体——该年第几天
- ios block 的使用
- Linux终端字符颜色设置
- 天声人語 20141223
- ucGUI VC6.0 仿真 开发板 产品式例程