Hive-3.hive 的 hql 语句
2016-01-27 11:33
423 查看
创建的hql主要包括以下内容
(1)表定义,创建表的时候使用
create table t
(2) 过滤数据,备份表,创建临时表
create table t_tmp as select * from t;
(3)已经存在表,向表中添加数据
load data [local] inpath 'data/a.txt' into table t;
(4)已经存在表定义,需要从其他表加载数据到表中
insert table t_1 select * from t;
(5)增加分区
alter table t add partition(provice='bj',city='haidian');
(6)case ... when 关键字使用
select case id when 1 then 'one' when 2 then 'two' else 'other' end from stu;
(7)实现单词计数
split explode
(8) 实现列转行
concat_ws
(9)实现行转列
split explode
(10)创建表
create table staff(id int,name string);
create table student(id int ,name string,birthday date,info map<string,string>);
(1)表定义,创建表的时候使用
create table t
(2) 过滤数据,备份表,创建临时表
create table t_tmp as select * from t;
(3)已经存在表,向表中添加数据
load data [local] inpath 'data/a.txt' into table t;
(4)已经存在表定义,需要从其他表加载数据到表中
insert table t_1 select * from t;
(5)增加分区
alter table t add partition(provice='bj',city='haidian');
(6)case ... when 关键字使用
select case id when 1 then 'one' when 2 then 'two' else 'other' end from stu;
(7)实现单词计数
split explode
(8) 实现列转行
concat_ws
(9)实现行转列
split explode
(10)创建表
create table staff(id int,name string);
create table student(id int ,name string,birthday date,info map<string,string>);
相关文章推荐
- 享元模式
- [LeetCode] Count of Range Sum 区间和计数
- SQL Server 中截取字符串常用的函数
- CentOS 6.5安装MySQL中文乱码问题解决
- C++【String类】String删除单个字符,删除字符串的函数实现
- iOS开发-基础:监听app从后台恢复到前台
- 运算符优先级
- Android studio SweetAlert for Android
- 从 IT 中断中学到的最佳监控实践
- li中包含div内容越界问题
- AngularJS转换响应内容
- 从 IT 中断中学到的最佳监控实践
- XML数据解析(GDataXMLNode的使用)
- 推送
- Hive-2.HiveQL查询中分析函数
- 监控之我见
- RGB颜色对照表
- AngularJS转换请求内容
- POJ2828 Buy Tickets 【线段树】+【单点更新】+【逆序】
- background-position: -24px 0px