hive 可以通过with查询来提高查询性能,因为先通过with语法将数据查询到内存,然后后面其它查询可以直接使用
with q1 as ( select key from src where key = '5' )
select *
from q1;
-- from style with q1 as ( select * from src where key = '5' )
from q1
select *;
-- chaining CTEs with q1 as ( select key from q2 where key = '5' ),
q2 as ( select key from src where key = '5' )
select * from ( select key from q1) a;
-- union example with q1 as ( select * from src where key = '5' ),
q2 as ( select * from src s2 where key = '4' )
select * from q1 union all select * from q2;
|
CTE in Views, CTAS, and Insert Statements
-- insert example create table s1 like src;
with q1 as ( select key , value from src where key = '5' )
from q1
insert overwrite table s1
select *;
-- ctas example create table s2 as
with q1 as ( select key from src where key = '4' )
select * from q1;
-- view example create view v1 as
with q1 as ( select key from src where key = '5' )
select * from q1;
select * from v1;
-- view example, name collision create view v1 as
with q1 as ( select key from src where key = '5' )
select * from q1;
with q1 as ( select key from src where key = '4' )
select * from v1;
|
相关推荐
Hadoop-2.8.0-HA-Hive安装部署与HQL11.hive的基本语法--CTAS建表.mp4
1.通过java查hive hive查询 2.简单查询及jar包
1 Hive 概念与连接使用: 2 2 Hive支持的数据类型: 2 2.1原子数据类型: 2 2.2复杂数据类型: 2 2.3 Hive类型转换: 3 3 Hive创建/删除数据库 3 3.1创建数据库: 3 3.2 删除数据库: 3 4 Hive 表相关语句 3 4.1 Hive ...
部分普通sql查询在hive中的实现方式详细说明;
如何用Apache Kylin让Hive表查询提速千百倍如何用Apache Kylin让Hive表查询提速千百倍如何用Apache Kylin让Hive表查询提速千百倍
hive数据加载的几种方式、数据的导出、数据简单查询
HIVE HA高可用性及详细使用HIVE HA高可用性及详细使用HIVE HA高可用性及详细使用HIVE HA高可用性及详细使用
01.hive查询语法--基本查询--条件查询--关联查询.mp4
hive 基本操作的命令和hive 实用命令等,有利与学习hive和mysql
Hadoop hbase hive sqoop集群环境安装配置及使用文档
适用人群:hive学习童鞋,hive方面从业人员 从hive的搭建 到 hive的分区表/内部表/外部表/分桶等sql讲解
04_HIve中的case when、cast及unix_timestamp的使用 05_复杂日志分析-需求分析 06_复杂日志分析-需求字段讲解及过滤 07_复杂日志分析-字段提取及临时表的创建 08_复杂日志分析-指标结果的分析实现 09_Hive中数据文件...
Hive原理/Hive SQL/Hive 函数/数据仓库分层和建模/Hive sql优化/数据倾斜
hive基础查询文档上传
hive metastore hive metastore是hive的元数据管理服务,实际应用中很多第三方框架需要访问metastore服务,如spark,impala等。同样hive metastore也提供了java接口。 使用 import org.apache.hadoop.hive.conf....
HIVE安装及详解,及测试,该文档版本是1.2+的。。。。。
Hive是把一个查询转化成多个MapReduce任务,然后一个接一个执行。执行的中间结果通过对磁盘的读写来同步。然而,Presto没有使用MapReduce,它是通过一个定制的查询和执行引擎来完成的。它的所有的查询处理是在内存中...
学习掌握hive原理及查询优化的必备之书学习掌握hive原理及查询优化的必备之书
starting with Hive 0.13.0) SELECT [ALL | DISTINCT] select_expr, select_expr, ... FROM table_reference [WHERE where_condition] [GROUP BY col_list] [ORDER BY col_list] [CLUSTER BY col_list | [DISTRIBUTE...
Hive开发规范及要点,hql 开发基础知识,规范