标签:
Hive的Explain命令,用于显示SQL查询的执行计划。
Hive查询被转化成序列阶段(这是一个有向无环图)。这些阶段可能是mapper/reducer阶段,或者是Metastore或文件系统的操作,如移动和重命名的阶段。
例子
hive> explain > select * from student > cluster by age;
1.查询的抽象语法树。【本人使用hive-0.13,没有显示抽象语法树】
2.执行计划计划的不同阶段之间的依赖关系
OK STAGE DEPENDENCIES: Stage-1 is a root stage Stage-0 is a root stage
3.每个场景的描述
STAGE PLANS: Stage: Stage-1 Map Reduce Map Operator Tree: //发生在job的 map 处理阶段过程 TableScan alias: student //TableScan以 Studen 表作为输入 Statistics: Num rows: 0 Data size: 74 Basic stats: PARTIAL Column stats: NONE Select Operator expressions: age (type: int), name (type: string) outputColumnNames: _col0, _col1 Statistics: Num rows: 0 Data size: 74 Basic stats: PARTIAL Column stats: NONE Reduce Output Operator key expressions: _col0 (type: int) sort order: + Map-reduce partition columns: _col0 (type: int) Statistics: Num rows: 0 Data size: 74 Basic stats: PARTIAL Column stats: NONE value expressions: _col0 (type: int), _col1 (type: string) Reduce Operator Tree: //发生在job的 reduce 处理阶段过程 Extract Statistics: Num rows: 0 Data size: 74 Basic stats: PARTIAL Column stats: NONE File Output Operator compressed: false Statistics: Num rows: 0 Data size: 74 Basic stats: PARTIAL Column stats: NONE table: //说明输入格式是TextInputFormat input format: org.apache.hadoop.mapred.TextInputFormat //说明输出格式是HiveIgnoreKeyTextOutputFormat output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe Stage: Stage-0 Fetch Operator limit: -1 //--job中没有Limit Time taken: 0.085 seconds, Fetched: 36 row(s)
标签:
原文地址:http://www.cnblogs.com/skyl/p/4737411.html