1. 执行计划(Explain)
1)基本语法
EXPLAIN [EXTENDED | DEPENDENCY | AUTHORIZATION] query
2)案例实操
(1)查看下面这条语句的执行计划
没有生成 MR 任务的
hive (default)> explain select * from emp;
OK
Explain
STAGE DEPENDENCIES:
Stage-0 is a root stage
STAGE PLANS:
Stage: Stage-0
Fetch Operator
limit: -1
Processor Tree:
TableScan
alias: emp
Statistics: Num rows: 1 Data size: 6460 Basic stats: COMPLETE Column stats: NONE
Select Operator
expressions: empno (type: int), ename (type: string), job (type: string), mgr (type: int), hiredate (type: string), sal (type: double), comm (type: double), deptno (type: int)
outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7
Statistics: Num rows: 1 Data size: 6460 Basic stats: COMPLETE Column stats: NONE
ListSink
Time taken: 14.564 seconds, Fetched: 17 row(s)
有生成 MR 任务的
hive (default)> explain select deptno, avg(sal) avg_sal fr

最低0.47元/天 解锁文章
630

被折叠的 条评论
为什么被折叠?



