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;

-- 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;

hive中的with用法相关推荐

  1. 转:hive中regexp_extract的用法总结

    hive中regexp_extract的用法总结 如: 1)  select regexp_extract('hitdecisiondlist','(i)(.*?)(e)',0) ; 得到的结果为: ...

  2. Hive中row_number()函数用法详解及示例

    目录 一.Hive 中row_number()函数介绍 二.使用示例 三.总结 四.附录 在Oracle中,我们经常会用到row_number() over(partition by clo1 ord ...

  3. Hive中explode的用法

    hive的explode 函数通常是与侧视图(lateral view)一起使用, 主要用于规范化行 或者解析json 一个数据表的表数据如下所示. 1.我们如何把student这一列中的数据由一行变 ...

  4. hive中 不等号 的用法

    背景: A表中uuid 字段存在三种情况.第一种为空的情况(即为null),第二种为字符串'null',第三种正常情况. 要求:给出规则,过滤出是为字符串'null'的异常数据量? 解决思路: 第一种 ...

  5. hive中over的用法

    http://lxw1234.com/archives/2015/04/176.htm 转载于:https://www.cnblogs.com/yuanninesuns/p/9953471.html

  6. Hive中JOIN的使用入门

    Hive中join的用法 Hive中Join的通常使用有以下几种: inner join 等值连接 left join  right join  full join left semi join cr ...

  7. Hive 中 formatted 的使用

    hive 中 formatted 的用法: select * from 表名: 查询该表名的所有字段记录 desc formatted 表名: 查看该表的结构化数据,但并不列出表中的数据 示例: 创建 ...

  8. Hive中COUNT的高级用法(条件过滤等)

    在HIVE中,除了COUNT(*)外,COUNT还可以有很多高级用法. SELECTtype, count(*), count(DISTINCT u), count(CASE WHEN plat=1 ...

  9. Hive 中的复合数据结构简介以及一些函数的用法说明

    目前 hive 支持的复合数据类型有以下几种: map (key1, value1, key2, value2, ...) Creates a map with the given key/value ...

最新文章

  1. x3650m5不自动进系统_自动起停系统不工作?可能有这几种情况
  2. C语言 二维数组复制、清零及打印显示
  3. 《数据结构》c语言版学习笔记——其他链表(线性表的链式存储结构Part2)
  4. 数据结构——图-有向带权图的邻接表基础
  5. BugkuCTF-Reverse题easy-100(LCTF)
  6. 正则只能小于0负数_2019–2020学年七年级数学期末考试考点之正数与负数考点详解...
  7. 如何给table表格的tr行加border边框(解决篇)
  8. AsyncTask 异步任务基本使用-下载视频
  9. 使用Python验证6174猜想
  10. mysql 重启_解决MYSQL死机,定时重启MYSQL,wdcp计划任务设定方法,
  11. 苹果内容拦截器在哪_苹果全家桶,真的有别人说的那么香吗?
  12. Fortran77基础
  13. rdkit Recap、BRICS分子片段拆分与合成
  14. 《Arduino》开发 之 用 u8g2 库 给 0.96寸OLED 刷bmp图片,OLED图片取模
  15. html5毕业论文总结,毕业论文总结4
  16. 模拟电子中放大电路的基本分析方法
  17. wx.getImageInfo(Object object)获取图片信息
  18. 像素三国志在线html5小游戏,激萌三国志H5
  19. 虚拟机与本机可以互ping,但是Xshell连不上虚拟机 的解决方法
  20. 蜂巢3.0(原 素材管理器)开发笔记

热门文章

  1. 教你用flash打造梦幻仙境效果
  2. 新型智能助手|chatgpt|小智ai
  3. Web3中文|未来的工作模式:VR头显、元宇宙和供应商协作
  4. 管理故事216之022-好团队应是学习型团队
  5. “马蜂窝裁员40%”的背后:我们如何避免城门失火,殃及池鱼?
  6. Angular 全局监听键盘事件
  7. neutron-metering解读分析
  8. 程序员的时间管理-谷歌日历
  9. 经典的设计模式14——命令模式
  10. Loader的用法详解