HIVE Schema Design 模式设计
来源:互联网 发布:淘宝的英树是正品吗 编辑:程序博客网 时间:2024/06/06 16:32
Table-by-Day
hive> CREATE TABLE supply_2011_01_02 (id int, part string, quantity int);hive> CREATE TABLE supply_2011_01_03 (id int, part string, quantity int);hive> CREATE TABLE supply_2011_01_04 (id int, part string, quantity int);hive> .... load data ...hive> SELECT part,quantity supply_2011_01_02 > UNION ALL > SELECT part,quantity from supply_2011_01_03 > WHERE quantity < 4;
hive> CREATE TABLE supply (id int, part string, quantity int) > PARTITIONED BY (day int);hive> ALTER TABLE supply add PARTITION (day=20110102);
hive> ALTER TABLE supply add PARTITION (day=20110103);hive> ALTER TABLE supply add PARTITION (day=20110102);hive> .... load data ...hive> SELECT part,quantity FROM supply > WHERE day>=20110102 AND day<20110103 AND quantity < 4;
Adding Columns to a Table
hive> CREATE TABLE weblogs (version LONG, url STRING) > PARTITIONED BY (hit_date int) > ROW FORMAT DELIMITED FIELDS TERMINATED BY '\t';hive> ! cat log1.txt1 /mystuff1 /toyshive> LOAD DATA LOCAL INPATH 'log1.txt' int weblogs partition(20110101);hive> SELECT * FROM weblogs;1 /mystuff 201101011 /toys 20110101
hive> ! cat log2.txt2 /cars bob2 /stuff terryhive> ALTER TABLE weblogs ADD COLUMNS (user_id string);hive> LOAD DATA LOCAL INPATH 'log2.txt' int weblogs partition(20110102);hive> SELECT * from weblogs1 /mystuff 20110101 NULL1 /toys 20110101 NULL2 /cars 20110102 bob2 /stuff 20110102 terry
- HIVE Schema Design 模式设计
- MongoDB Schema Design(MongoDB模式设计)
- 文档(Documents), 字段(Fields), 及模式设计(Schema Design)
- Design pattern设计模式
- Design Pattern, 设计模式
- 设计模式-Design Patterns
- Design patterns 设计模式
- 设计模式 - Design Patterns
- 设计模式(Design Pattern)
- Hive模式设计
- Hive-模式设计
- 设计模式(Design Pattern)
- 设计模式 英文名Design Pattern
- 设计模式(Design Patterns)
- 设计模式(Design Patterns)
- Java design pattern 设计模式
- 设计模式(Design Patterns)
- 设计模式(Design Patterns)
- 深入浅出MIPS 四 MIPS的异常与中断
- github被封解决办法
- C/C++链接有关的问题
- Android_Handler Looper Message的关系
- Android打包签名-生成keystore文件
- HIVE Schema Design 模式设计
- 杭电1232
- Android Parcelable和Serializable的区别
- 《Ruminations on C++》读书笔记
- 处事感悟——给刚参加工作的朋友
- 线段树+DP 求区间连续最大子段和 hoj Candy
- 《More Exceptional C++》读书笔记
- 《Exceptional C++ Style》读书笔记
- 10个重要的算法C语言实现源代码