OK ABSTRACT SYNTAX TREE: (TOK_QUERY (TOK_FROM (TOK_TABREF (TOK_TABNAME Table_A) a)) (TOK_INSERT (TOK_DESTINATION (TOK_TAB (TOK_TABNAME dest_Table_A) (TOK_PARTSPEC (TOK_PARTVAL dt '2013-12-02')))) (TOK_SELECT (TOK_SELEXPR (. (TOK_TABLE_OR_COL a) dt)) (TOK_SELEXPR (TOK_FUNCTIONDI count (. (TOK_TABLE_OR_COL a) user)) AllDist) (TOK_SELEXPR (TOK_FUNCTIONDI count (TOK_FUNCTION when (= (. (TOK_TABLE_OR_COL a) type) 111) (. (TOK_TABLE_OR_COL a) user) TOK_NULL)) Type111User) (TOK_SELEXPR (TOK_FUNCTIONDI count (TOK_FUNCTION when (!= (. (TOK_TABLE_OR_COL a) type) 111) (. (TOK_TABLE_OR_COL a) user) TOK_NULL)) Type123User)) (TOK_GROUPBY (. (TOK_TABLE_OR_COL a) dt))) (TOK_INSERT (TOK_DESTINATION (TOK_TAB (TOK_TABNAME dest_Table_B) (TOK_PARTSPEC (TOK_PARTVAL dt '2013-12-02')))) (TOK_SELECT (TOK_SELEXPR (. (TOK_TABLE_OR_COL a) dt)) (TOK_SELEXPR (TOK_FUNCTIONDI count (. (TOK_TABLE_OR_COL a) user)) AllDist) (TOK_SELEXPR (TOK_FUNCTIONDI count (TOK_FUNCTION when (= (. (TOK_TABLE_OR_COL a) type) 111) (. (TOK_TABLE_OR_COL a) user) TOK_NULL)) Type111User) (TOK_SELEXPR (TOK_FUNCTIONDI count (TOK_FUNCTION when (!= (. (TOK_TABLE_OR_COL a) type) 111) (. (TOK_TABLE_OR_COL a) user) TOK_NULL)) Type123User)) (TOK_GROUPBY (. (TOK_TABLE_OR_COL a) dt)))) STAGE DEPENDENCIES: Stage-2 is a root stage Stage-3 depends on stages: Stage-2 Stage-0 depends on stages: Stage-3 Stage-4 depends on stages: Stage-0 Stage-5 depends on stages: Stage-2 Stage-1 depends on stages: Stage-5 Stage-6 depends on stages: Stage-1 STAGE PLANS: Stage: Stage-2 Map Reduce Alias -> Map Operator Tree: a TableScan alias: a Reduce Output Operator key expressions: expr: user type: string expr: CASE WHEN ((type = 111)) THEN (user) ELSE (null) END type: string expr: CASE WHEN ((type <> 111)) THEN (user) ELSE (null) END type: string sort order: +++ Map-reduce partition columns: expr: user type: string expr: CASE WHEN ((type = 111)) THEN (user) ELSE (null) END type: string expr: CASE WHEN ((type <> 111)) THEN (user) ELSE (null) END type: string tag: -1 value expressions: expr: dt type: string Reduce Operator Tree: Forward Group By Operator aggregations: expr: count(DISTINCT KEY._col0) expr: count(DISTINCT KEY._col1) expr: count(DISTINCT KEY._col2) bucketGroup: false keys: expr: VALUE._col0 type: string mode: hash outputColumnNames: _col0, _col1, _col2, _col3 File Output Operator compressed: true GlobalTableId: 0 table: input format: org.apache.hadoop.mapred.SequenceFileInputFormat output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat Group By Operator aggregations: expr: count(DISTINCT KEY._col0) expr: count(DISTINCT KEY._col1) expr: count(DISTINCT KEY._col2) bucketGroup: false keys: expr: VALUE._col0 type: string mode: hash outputColumnNames: _col0, _col1, _col2, _col3 File Output Operator compressed: true GlobalTableId: 0 table: input format: org.apache.hadoop.mapred.SequenceFileInputFormat output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat Stage: Stage-3 Map Reduce Alias -> Map Operator Tree: Reduce Output Operator key expressions: expr: _col0 type: string sort order: + Map-reduce partition columns: expr: _col0 type: string tag: -1 value expressions: expr: _col1 type: bigint expr: _col2 type: bigint expr: _col3 type: bigint Reduce Operator Tree: Group By Operator aggregations: expr: count(VALUE._col0) expr: count(VALUE._col1) expr: count(VALUE._col2) bucketGroup: false keys: expr: KEY._col0 type: string mode: final outputColumnNames: _col0, _col1, _col2, _col3 Select Operator expressions: expr: _col0 type: string expr: _col1 type: bigint expr: _col2 type: bigint expr: _col3 type: bigint outputColumnNames: _col0, _col1, _col2, _col3 Select Operator expressions: expr: _col0 type: string expr: UDFToInteger(_col1) type: int expr: UDFToInteger(_col2) type: int expr: UDFToInteger(_col3) type: int outputColumnNames: _col0, _col1, _col2, _col3 File Output Operator compressed: true GlobalTableId: 1 table: input format: org.apache.hadoop.hive.ql.io.RCFileInputFormat output format: org.apache.hadoop.hive.ql.io.RCFileOutputFormat serde: org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe name: mobile.dest_table_a Stage: Stage-0 Move Operator tables: partition: dt 2013-12-02 replace: true table: input format: org.apache.hadoop.hive.ql.io.RCFileInputFormat output format: org.apache.hadoop.hive.ql.io.RCFileOutputFormat serde: org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe name: mobile.dest_table_a Stage: Stage-4 Stats-Aggr Operator Stage: Stage-5 Map Reduce Alias -> Map Operator Tree: Reduce Output Operator key expressions: expr: _col0 type: string sort order: + Map-reduce partition columns: expr: _col0 type: string tag: -1 value expressions: expr: _col1 type: bigint expr: _col2 type: bigint expr: _col3 type: bigint Reduce Operator Tree: Group By Operator aggregations: expr: count(VALUE._col0) expr: count(VALUE._col1) expr: count(VALUE._col2) bucketGroup: false keys: expr: KEY._col0 type: string mode: final outputColumnNames: _col0, _col1, _col2, _col3 Select Operator expressions: expr: _col0 type: string expr: _col1 type: bigint expr: _col2 type: bigint expr: _col3 type: bigint outputColumnNames: _col0, _col1, _col2, _col3 Select Operator expressions: expr: _col0 type: string expr: UDFToInteger(_col1) type: int expr: UDFToInteger(_col2) type: int expr: UDFToInteger(_col3) type: int outputColumnNames: _col0, _col1, _col2, _col3 File Output Operator compressed: true GlobalTableId: 2 table: input format: org.apache.hadoop.hive.ql.io.RCFileInputFormat output format: org.apache.hadoop.hive.ql.io.RCFileOutputFormat serde: org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe name: mobile.dest_table_b Stage: Stage-1 Move Operator tables: partition: dt 2013-12-02 replace: true table: input format: org.apache.hadoop.hive.ql.io.RCFileInputFormat output format: org.apache.hadoop.hive.ql.io.RCFileOutputFormat serde: org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe name: mobile.dest_table_b Stage: Stage-6 Stats-Aggr Operator