黑猴子的家:Hive 优化之 EXPLAIN(执行计划)

1、基本语法

EXPLAIN [EXTENDED | DEPENDENCY | AUTHORIZATION] query

2、案例实操

(1)查看下面这条语句的执行计划

hive (default)> explain select * from emp;

hive (default)> explain select deptno, avg(sal) avg_sal from emp group by deptno;

(2)查看详细执行计划

hive (default)> explain extended select * from emp;
hive (default)> explain extended select deptno, avg(sal) avg_sal from emp 
                group by deptno;

你可能感兴趣的:(Hive)