Hive's explain command, which displays the execution plan for the SQL query.
The hive query is transformed into a sequence phase (this is a forward-free graph). These stages may be mapper/reducer stages, or Metastore or file system operations, such as move and rename phases.
Example
Hive> explain >Select* from student > by age;
1. Abstract syntax tree for queries. "I use hive-0.13, not showing abstract syntax tree"
2. Dependencies between different phases of the implementation plan plan
okstage DEPENDENCIES: Stage-1 is a root stage stage-0 is a root Stage
3. Description of each scenario
STAGE PLANS:Stage:Stage-1map Reduce Map Operator Tree:// occurs during the map processing phase of the job Tablescan alias:student//tablescan with Studen table as inputStatistics: Num rows:0Data Size: AboutBasic stats:partialColumnStats:noneSelectOperator expressions:age (type:int), name (type:string) Outputcolumnnames: _col0, _col1Statistics: Num rows:0Data Size: AboutBasic stats:partialColumnstats:none Reduce Output OperatorKeyExpressions: _col0 (Type:int) SortOrder:+Map-Reduce partition columns: _col0 (Type:int) Statistics: Num rows:0Data Size: AboutBasic stats:partialColumnstats:none Value Expressions: _col0 (Type:int), _col1 (type:string) Reduce Operator Tree:// occurs during the reduce processing phase of the job ExtractStatistics: Num rows:0Data Size: AboutBasic stats:partialColumnStats:noneFileOutput Operator Compressed:falseStatistics: Num rows:0Data Size: AboutBasic stats:partialColumnStats:noneTable: // Description The input format is Textinputformat input Format:org.apache.hadoop.mapred.TextInputFormat // Description Output format is Hiveignorekeytextoutputformat output Format:org.apache.hadoop.hive.ql.io.HiveIgnoreKey Textoutputformat serde:org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe stage:stage-0 FetchOperator Limit:-1 //-- No limit in job Time taken:0.085Seconds, fetched: $Row (s)
Hive's explain command