explain 实战-----查看hive sql执行计划

目录

1.join/left join/full join 语句会过滤关联字段 null 的值吗?

(1)join 

(2) left join /full join

2.group by 分组语句会进行排序吗?


1.join/left join/full join 语句会过滤关联字段 null 的值吗?

(1)join 

sql:

explain 
selecta.into_id,a.into_bus_id,b.customer_type  as customer_type
from
--进件表
(select * from dp_ods.o_fk_eagle_jsd_intopieces_s
where etl_date = '2023-09-06' and substr(into_time ,1,4) >= '2019' ) a
join 
(select * from dp_ods.o_hyd_jsd_loan_order_s  where etl_date = '2023-09-06') b
on a.into_id=b.loan_id 
STAGE DEPENDENCIES:Stage-1 is a root stageStage-0 depends on stages: Stage-1STAGE PLANS:Stage: Stage-1Map ReduceMap Operator Tree:TableScanalias: o_fk_eagle_jsd_intopieces_sStatistics: Num rows: 36940508 Data size: 360575316992 Basic stats: COMPLETE Column stats: NONEFilter Operatorpredicate: ((substr(into_time, 1, 4) >= '2019') and into_id is not null) (type: boolean)Statistics: Num rows: 12313502 Data size: 120191765823 Basic stats: COMPLETE Column stats: NONESelect Operatorexpressions: into_id (type: string), into_bus_id (type: string)outputColumnNames: _col0, _col1Statistics: Num rows: 12313502 Data size: 120191765823 Basic stats: COMPLETE Column stats: NONEReduce Output Operatorkey expressions: _col0 (type: string)sort order: +Map-reduce partition columns: _col0 (type: string)Statistics: Num rows: 12313502 Data size: 120191765823 Basic stats: COMPLETE Column stats: NONEvalue expressions: _col1 (type: string)TableScanalias: o_hyd_jsd_loan_order_sStatistics: Num rows: 44174590 Data size: 84039429353 Basic stats: COMPLETE Column stats: NONEFilter Operatorpredicate: loan_id is not null (type: boolean)Statistics: Num rows: 44174590 Data size: 84039429353 Basic stats: COMPLETE Column stats: NONESelect Operatorexpressions: loan_id (type: string), customer_type (type: int)outputColumnNames: _col0, _col1Statistics: Num rows: 44174590 Data size: 84039429353 Basic stats: COMPLETE Column stats: NONEReduce Output Operatorkey expressions: _col0 (type: string)sort order: +Map-reduce partition columns: _col0 (type: string)Statistics: Num rows: 44174590 Data size: 84039429353 Basic stats: COMPLETE Column stats: NONEvalue expressions: _col1 (type: int)Reduce Operator Tree:Join Operatorcondition map:Inner Join 0 to 1keys:0 _col0 (type: string)1 _col0 (type: string)outputColumnNames: _col0, _col1, _col3Statistics: Num rows: 48592050 Data size: 92443374291 Basic stats: COMPLETE Column stats: NONESelect Operatorexpressions: _col0 (type: string), _col1 (type: string), _col3 (type: int)outputColumnNames: _col0, _col1, _col2Statistics: Num rows: 48592050 Data size: 92443374291 Basic stats: COMPLETE Column stats: NONEFile Output Operatorcompressed: falseStatistics: Num rows: 48592050 Data size: 92443374291 Basic stats: COMPLETE Column stats: NONEtable:input format: org.apache.hadoop.mapred.TextInputFormatoutput format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormatserde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDeStage: Stage-0Fetch Operatorlimit: -1Processor Tree:ListSink

可以看到filter 顾虑部分有比原sql多了关联字段不为空的判断

(2) left join /full join

没有相关的过滤空值操作

2.group by 分组语句会进行排序吗?

explain
select date(create_time),max(actual_amount) max_actual_amount 
from dp_ods.o_hyd_jsd_loan_order_s  
where etl_date = '2023-09-06'
group by date(create_time)
STAGE DEPENDENCIES:Stage-1 is a root stageStage-2 depends on stages: Stage-1Stage-0 depends on stages: Stage-2STAGE PLANS:Stage: Stage-1Map ReduceMap Operator Tree:TableScanalias: o_hyd_jsd_loan_order_sStatistics: Num rows: 44174590 Data size: 84039429353 Basic stats: COMPLETE Column stats: NONESelect Operatorexpressions: CAST( create_time AS DATE) (type: date), actual_amount (type: double)outputColumnNames: _col0, _col1Statistics: Num rows: 44174590 Data size: 84039429353 Basic stats: COMPLETE Column stats: NONEGroup By Operatoraggregations: max(_col1)keys: _col0 (type: date)mode: hashoutputColumnNames: _col0, _col1Statistics: Num rows: 44174590 Data size: 84039429353 Basic stats: COMPLETE Column stats: NONEReduce Output Operatorkey expressions: _col0 (type: date)sort order: +Map-reduce partition columns: rand() (type: double)Statistics: Num rows: 44174590 Data size: 84039429353 Basic stats: COMPLETE Column stats: NONEvalue expressions: _col1 (type: double)Reduce Operator Tree:Group By Operatoraggregations: max(VALUE._col0)keys: KEY._col0 (type: date)mode: partialsoutputColumnNames: _col0, _col1Statistics: Num rows: 44174590 Data size: 84039429353 Basic stats: COMPLETE Column stats: NONEFile Output Operatorcompressed: falsetable:input format: org.apache.hadoop.mapred.SequenceFileInputFormatoutput format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormatserde: org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDeStage: Stage-2Map ReduceMap Operator Tree:TableScanReduce Output Operatorkey expressions: _col0 (type: date)sort order: +Map-reduce partition columns: _col0 (type: date)Statistics: Num rows: 44174590 Data size: 84039429353 Basic stats: COMPLETE Column stats: NONEvalue expressions: _col1 (type: double)Reduce Operator Tree:Group By Operatoraggregations: max(VALUE._col0)keys: KEY._col0 (type: date)mode: finaloutputColumnNames: _col0, _col1Statistics: Num rows: 22087295 Data size: 42019714676 Basic stats: COMPLETE Column stats: NONEFile Output Operatorcompressed: falseStatistics: Num rows: 22087295 Data size: 42019714676 Basic stats: COMPLETE Column stats: NONEtable:input format: org.apache.hadoop.mapred.TextInputFormatoutput format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormatserde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDeStage: Stage-0Fetch Operatorlimit: -1Processor Tree:ListSink

可以看到group by 字段是进行了正序排序的,查看sql执行结果也能看到。

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/72151.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

【java】【SSM框架系列】【一】Spring

目录 一、简介 1.1 为什么学 1.2 学什么 1.3 怎么学 1.4 初识Spring 1.5 Spring发展史 1.6 Spring Framework系统架构图 1.7 Spring Framework学习线路 二、核心概念(IoC/DI,IoC容器,Bean) 2.1 概念 2.2 IoC入门案例 …

docker安装RabbitMQ教程

可以通过Docker来安装RabbitMQ,具体步骤如下: 安装Docker:请参考官方文档进行安装。 拉取RabbitMQ镜像:通过以下命令拉取最新版本的RabbitMQ镜像。 docker pull rabbitmq:latest运行RabbitMQ容器:通过以下命令运行Rab…

简单YUV数据转换

YUV是一种亮度信号Y和色度信号U、V是分离的色彩空间,它主要用于优化彩色视频信号的传输,使其向后相容老式黑白电视。其中“Y”表示明亮度(Luminance或Luma),也就是灰阶值;而“U”和“V”表示的则是色度&…

vue3 defineExpose 显示的指定组件需要暴露的属性

简介&#xff1a; 是 vue3 新增的一个 api &#xff0c;用在 <script setup>中使用&#xff0c;用于显示的把组件的属性和方法暴露出来。可用于父子组件通信&#xff0c;子组件使用 defineExpose 将自身的方法或者属性暴露出去&#xff0c;父组件中通过 ref 获取子组件 D…

Android12.0首次开机默认授予app运行时权限(去掉运行时授权弹窗)第二种方法

1.概述 在12.0的系统产品开发中,在6.0以后对于权限的申请,都需要动态申请,所以会在系统首次启动后,在app的首次运行时,会弹出授权窗口,会让用户手动授予app运行时权限,在由于系统产品开发需要要求默认授予app运行时权限,不需要用户默认授予运行时弹窗,所以需要在首次开…

CH06_第一组重构(上)

提取函数&#xff08;Extract Function |106&#xff09; 曾用名&#xff1a;提炼函数&#xff08;Extract Function&#xff09; 反向重构&#xff1a;内联函数&#xff08;115&#xff09; 示例代码 function printOwing(invoice) {printBanner();let outstanding calcul…

API安全学习 - crAPI漏洞靶场与API测试思路

crAPI漏洞靶场与解题思路 1. 前置基础1.1 认识crAPI1.2 环境搭建1.3 API的分类与鉴别 2. 漏洞验证2.1 失效的对象级别授权挑战1&#xff1a;访问其它用户车辆的详细信息挑战2&#xff1a;访问其它用户的机械报告 2.2 失效的用户身份验证挑战3&#xff1a;重置其它用户的密码 2.…

NIFI实现JSON转SQL并插入到数据库表中

说明 本文中的NIFI是使用docker进行安装的&#xff0c;所有的配置参考&#xff1a;docker安装Apache NIFI 需求背景 现在有一个文件&#xff0c;里面存储的是一些json格式的数据&#xff0c;要求将文件中的数据存入数据库表中&#xff0c;以下是一些模拟的数据和对应的数据库…

centos7使用docker-compose一键搭建mysql高可用主从集群

docker部署 环境准备 卸载旧版本 yum remove -y docker \docker-client \docker-client-latest \docker-common \docker-latest \docker-latest-logrotate \docker-logrotate \docker-selinux \docker-engine-selinux \docker-engine 安装依赖 yum install -y yum-utils \…

伪微分反馈控制(Pesudo-Drivative Feedback Control——PDF)

运动控制-单轴伺服控制带宽分析&#xff08;二&#xff09; - 知乎 (zhihu.com) 伪微分反馈控制_百度百科 (baidu.com) 伺服电机控制器的参数整定_老马过河hhh的博客-CSDN博客 伪微分PIIP控制_yukee10的博客-CSDN博客

Java8实战-总结23

Java8实战-总结23 使用流构建流由值创建流由数组创建流由文件生成流由函数生成流&#xff1a;创建无限流 小结 使用流 构建流 流对于表达数据处理查询是非常强大而有用的。到目前为止&#xff0c;已经能够使用stream方法从集合生成流了。此外&#xff0c;还介绍了如何根据数值…

docker搭建个人网盘和私有仓库Harbor

目录 1、使用mysql:5.7和 owncloud 镜像&#xff0c;构建一个个人网盘 2、安装搭建私有仓库 Harbor 1、使用mysql:5.7和owncloud&#xff0c;构建一个个人网盘 1.拉取mysql:5.6镜像&#xff0c;并且运行mysql容器 [rootnode8 ~]# docker pull mysql:5.7 [rootnode8 ~]# doc…

Excel VSTO开发10 -自定义任务面板

版权声明&#xff1a;本文为博主原创文章&#xff0c;转载请在显著位置标明本文出处以及作者网名&#xff0c;未经作者允许不得用于商业目的。 10 自定义任务面板 自定义任务面板&#xff08;有些地方称为侧边面板&#xff09;即CustomTaskPane&#xff0c;这个类在Microsoft…

代码随想录二刷day15

提示&#xff1a;文章写完后&#xff0c;目录可以自动生成&#xff0c;如何生成可参考右边的帮助文档 文章目录 前言一、力扣102. 二叉树的层序遍历二、力扣107. 二叉树的层序遍历 II三、力扣199. 二叉树的右视图四、力扣637. 二叉树的层平均值五、力扣429. N 叉树的层序遍历六…

leetcode 第 361 场周赛

2843. 统计对称整数的数目 核心思想&#xff1a;枚举每一个数是否是对称整数,第一种写法为python写法&#xff0c;第二种为一般写法我觉得更好&#xff0c;非常有思想性。 2844. 生成特殊数字的最少操作 核心思想&#xff1a;枚举特殊数字结尾的几种可能。其实自己做的时候一…

2023/09/07 c++qt day2

#include <iostream>using namespace std; //封装一个学生类 struct stu { private://存放学生的成绩int stu_score[256];//记录学生个数int stu_num; public://用于设置学生个数void setNum(){cout<<"请输入学生的个数"<<" ";cin>&g…

Stable Diffuse 之 本地环境部署 WebUI 进行汉化操作

Stable Diffuse 之 本地环境部署 WebUI 进行汉化操作 目录 Stable Diffuse 之 本地环境部署 WebUI 进行汉化操作 一、简单介绍 二、汉化操作 附录&#xff1a; 一、Install from URL 中出现 Failed to connect to 127.0.0.1 port 7890: Connection refused 错误&#xf…

蓝桥杯练习题(3的倍数)

问题描述 小蓝对 3 的倍数很感兴趣。现在他手头有三个不同的数 a,b,c, 他想知道, 这三个数中是不是有两个数的和是 3 的倍数。 例如, 当 a3,b4,c6 时, 可以找到 a 和 c 的和是 3 的倍数。 例如, 当 a3,b4,c7 时, 没办法找到两个数的和是 3 的倍数。 输入格式 输入三行, 每行…

vscode ros配置

【ROS】VSCODE ROS 配置方法&#xff08;保姆级教程&#xff0c;总结了多篇&#xff09;_ros vscode_晴明大大的博客-CSDN博客

网络编程、多路复用和多路并发的区别、

在网络编程中&#xff0c;多路复用&#xff08;Multiplexing&#xff09;和多路并发&#xff08;Multithreading/Multiprocessing&#xff09;是两种不同的技术&#xff0c;用于处理多个客户端连接。它们有以下区别&#xff1a; 1.多路复用&#xff08;Multiplexing&#xff0…