使用EXPLAIN(执行计划)
1)基本语法
EXPLAIN [EXTENDED | DEPENDENCY | AUTHORIZATION] query
2)案例实操
(1)查看下面这条语句的执行计划
hive (default)> explain select * from course;
hive (default)> explain select s_id ,avg(s_score) avgscore from score group by s_id;
(2)查看详细执行计划
hive (default)> explain extended select * from course;
hive (default)> explain extended select s_id ,avg(s_score) avgscore from score group by s_id;