0: jdbc:hive2://127.0.0.1:10000/default> set hive.execution.engine=spark; No rows affected (0.003 seconds) 0: jdbc:hive2://127.0.0.1:10000/default> explain WITH TEMP_VIEW AS . . . . . . . . . . . . . . . . . . . .> (SELECT COLUMNA,COLUMNB,COLUMNC,COLUMND,COLUMNE . . . . . . . . . . . . . . . . . . . .> FROM TABLE_A . . . . . . . . . . . . . . . . . . . .> WHERE COLUMNA='1' OR COLUMNA='10') . . . . . . . . . . . . . . . . . . . .> SELECT COLUMNA, COLUMNB, MAX (COLUMNC) . . . . . . . . . . . . . . . . . . . .> FROM TEMP_VIEW . . . . . . . . . . . . . . . . . . . .> WHERE COLUMNA='1' AND COLUMND='Case 1' . . . . . . . . . . . . . . . . . . . .> GROUP BY COLUMNA,COLUMNB . . . . . . . . . . . . . . . . . . . .> UNION ALL . . . . . . . . . . . . . . . . . . . .> SELECT COLUMNA, COLUMNB, MIN (COLUMNC) . . . . . . . . . . . . . . . . . . . .> FROM TEMP_VIEW . . . . . . . . . . . . . . . . . . . .> WHERE COLUMNA='10' AND COLUMNE='Case 2' . . . . . . . . . . . . . . . . . . . .> GROUP BY COLUMNA,COLUMNB; INFO : Compiling command(queryId=hive_20161021114242_df5f1dfe-09ac-422a-afdc-ddf8d5af36e9): explain WITH TEMP_VIEW AS (SELECT COLUMNA,COLUMNB,COLUMNC,COLUMND,COLUMNE FROM TABLE_A WHERE COLUMNA='1' OR COLUMNA='10') SELECT COLUMNA, COLUMNB, MAX (COLUMNC) FROM TEMP_VIEW WHERE COLUMNA='1' AND COLUMND='Case 1' GROUP BY COLUMNA,COLUMNB UNION ALL SELECT COLUMNA, COLUMNB, MIN (COLUMNC) FROM TEMP_VIEW WHERE COLUMNA='10' AND COLUMNE='Case 2' GROUP BY COLUMNA,COLUMNB INFO : Semantic Analysis Completed INFO : Returning Hive schema: Schema(fieldSchemas:[FieldSchema(name:Explain, type:string, comment:null)], properties:null) INFO : Completed compiling command(queryId=hive_20161021114242_df5f1dfe-09ac-422a-afdc-ddf8d5af36e9); Time taken: 0.114 seconds INFO : Executing command(queryId=hive_20161021114242_df5f1dfe-09ac-422a-afdc-ddf8d5af36e9): explain WITH TEMP_VIEW AS (SELECT COLUMNA,COLUMNB,COLUMNC,COLUMND,COLUMNE FROM TABLE_A WHERE COLUMNA='1' OR COLUMNA='10') SELECT COLUMNA, COLUMNB, MAX (COLUMNC) FROM TEMP_VIEW WHERE COLUMNA='1' AND COLUMND='Case 1' GROUP BY COLUMNA,COLUMNB UNION ALL SELECT COLUMNA, COLUMNB, MIN (COLUMNC) FROM TEMP_VIEW WHERE COLUMNA='10' AND COLUMNE='Case 2' GROUP BY COLUMNA,COLUMNB INFO : Starting task [Stage-2:EXPLAIN] in serial mode INFO : Completed executing command(queryId=hive_20161021114242_df5f1dfe-09ac-422a-afdc-ddf8d5af36e9); Time taken: 0.017 seconds INFO : OK +-----------------------------------------------------------------------------------------------------------------------------------------+--+ | Explain | +-----------------------------------------------------------------------------------------------------------------------------------------+--+ | STAGE DEPENDENCIES: | | Stage-1 is a root stage | | Stage-0 depends on stages: Stage-1 | | | | STAGE PLANS: | | Stage: Stage-1 | | Spark | | Edges: | | Reducer 2 <- Map 1 (GROUP, 4) | | Reducer 4 <- Map 3 (GROUP, 4) | | DagName: hive_20161021114242_df5f1dfe-09ac-422a-afdc-ddf8d5af36e9:12 | | Vertices: | | Map 1 | | Map Operator Tree: | | TableScan | | alias: table_a | | filterExpr: ((((columna = '1') or (columna = '10')) and (columna = '1')) and (columnd = 'Case 1')) (type: boolean) | | Statistics: Num rows: 2566 Data size: 531182 Basic stats: COMPLETE Column stats: NONE | | Filter Operator | | predicate: ((((columna = '1') or (columna = '10')) and (columna = '1')) and (columnd = 'Case 1')) (type: boolean) | | Statistics: Num rows: 641 Data size: 132691 Basic stats: COMPLETE Column stats: NONE | | Select Operator | | expressions: '1' (type: string), columnb (type: string), columnc (type: string) | | outputColumnNames: _col0, _col1, _col2 | | Statistics: Num rows: 641 Data size: 132691 Basic stats: COMPLETE Column stats: NONE | | Group By Operator | | aggregations: max(_col2) | | keys: _col0 (type: string), _col1 (type: string) | | mode: hash | | outputColumnNames: _col0, _col1, _col2 | | Statistics: Num rows: 641 Data size: 132691 Basic stats: COMPLETE Column stats: NONE | | Reduce Output Operator | | key expressions: _col0 (type: string), _col1 (type: string) | | sort order: ++ | | Map-reduce partition columns: _col0 (type: string), _col1 (type: string) | | Statistics: Num rows: 641 Data size: 132691 Basic stats: COMPLETE Column stats: NONE | | value expressions: _col2 (type: string) | | Map 3 | | Map Operator Tree: | | TableScan | | alias: table_a | | filterExpr: ((((columna = '1') or (columna = '10')) and (columna = '10')) and (columne = 'Case 2')) (type: boolean) | | Statistics: Num rows: 2553 Data size: 531182 Basic stats: COMPLETE Column stats: NONE | | Filter Operator | | predicate: ((((columna = '1') or (columna = '10')) and (columna = '10')) and (columne = 'Case 2')) (type: boolean) | | Statistics: Num rows: 638 Data size: 132743 Basic stats: COMPLETE Column stats: NONE | | Select Operator | | expressions: '10' (type: string), columnb (type: string), columnc (type: string) | | outputColumnNames: _col0, _col1, _col2 | | Statistics: Num rows: 638 Data size: 132743 Basic stats: COMPLETE Column stats: NONE | | Group By Operator | | aggregations: min(_col2) | | keys: _col0 (type: string), _col1 (type: string) | | mode: hash | | outputColumnNames: _col0, _col1, _col2 | | Statistics: Num rows: 638 Data size: 132743 Basic stats: COMPLETE Column stats: NONE | | Reduce Output Operator | | key expressions: _col0 (type: string), _col1 (type: string) | | sort order: ++ | | Map-reduce partition columns: _col0 (type: string), _col1 (type: string) | | Statistics: Num rows: 638 Data size: 132743 Basic stats: COMPLETE Column stats: NONE | | value expressions: _col2 (type: string) | | Reducer 2 | | Reduce Operator Tree: | | Group By Operator | | aggregations: max(VALUE._col0) | | keys: KEY._col0 (type: string), KEY._col1 (type: string) | | mode: mergepartial | | outputColumnNames: _col0, _col1, _col2 | | Statistics: Num rows: 320 Data size: 66241 Basic stats: COMPLETE Column stats: NONE | | File Output Operator | | compressed: false | | Statistics: Num rows: 639 Data size: 132612 Basic stats: COMPLETE Column stats: NONE | | table: | | input format: org.apache.hadoop.mapred.TextInputFormat | | output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat | | serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe | | Reducer 4 | | Reduce Operator Tree: | | Group By Operator | | aggregations: min(VALUE._col0) | | keys: KEY._col0 (type: string), KEY._col1 (type: string) | | mode: mergepartial | | outputColumnNames: _col0, _col1, _col2 | | Statistics: Num rows: 319 Data size: 66371 Basic stats: COMPLETE Column stats: NONE | | File Output Operator | | compressed: false | | Statistics: Num rows: 639 Data size: 132612 Basic stats: COMPLETE Column stats: NONE | | table: | | input format: org.apache.hadoop.mapred.TextInputFormat | | output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat | | serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe | | | | Stage: Stage-0 | | Fetch Operator | | limit: -1 | | Processor Tree: | | ListSink | | | +-----------------------------------------------------------------------------------------------------------------------------------------+--+ 99 rows selected (0.221 seconds) 0: jdbc:hive2://127.0.0.1:10000/default>