hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From heyongqi...@apache.org
Subject svn commit: r1392105 [5/7] - in /hive/trunk: common/src/java/org/apache/hadoop/hive/conf/ conf/ ql/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/ql/plan/api/ ql/src/java/org/apache/hadoop/hive/ql/exec/ ql/src/java/org/apache/hadoop/hive/ql/optimiz...
Date Sun, 30 Sep 2012 20:41:03 GMT
Added: hive/trunk/ql/src/test/results/clientpositive/correlationoptimizer4.q.out
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/results/clientpositive/correlationoptimizer4.q.out?rev=1392105&view=auto
==============================================================================
--- hive/trunk/ql/src/test/results/clientpositive/correlationoptimizer4.q.out (added)
+++ hive/trunk/ql/src/test/results/clientpositive/correlationoptimizer4.q.out Sun Sep 30 20:41:01 2012
@@ -0,0 +1,2477 @@
+PREHOOK: query: CREATE TABLE T1(key INT, val STRING)
+PREHOOK: type: CREATETABLE
+POSTHOOK: query: CREATE TABLE T1(key INT, val STRING)
+POSTHOOK: type: CREATETABLE
+POSTHOOK: Output: default@T1
+PREHOOK: query: LOAD DATA LOCAL INPATH '../data/files/T1.txt' INTO TABLE T1
+PREHOOK: type: LOAD
+PREHOOK: Output: default@t1
+POSTHOOK: query: LOAD DATA LOCAL INPATH '../data/files/T1.txt' INTO TABLE T1
+POSTHOOK: type: LOAD
+POSTHOOK: Output: default@t1
+PREHOOK: query: CREATE TABLE T2(key INT, val STRING)
+PREHOOK: type: CREATETABLE
+POSTHOOK: query: CREATE TABLE T2(key INT, val STRING)
+POSTHOOK: type: CREATETABLE
+POSTHOOK: Output: default@T2
+PREHOOK: query: LOAD DATA LOCAL INPATH '../data/files/T2.txt' INTO TABLE T2
+PREHOOK: type: LOAD
+PREHOOK: Output: default@t2
+POSTHOOK: query: LOAD DATA LOCAL INPATH '../data/files/T2.txt' INTO TABLE T2
+POSTHOOK: type: LOAD
+POSTHOOK: Output: default@t2
+PREHOOK: query: CREATE TABLE dest_co1(key INT, cnt INT)
+PREHOOK: type: CREATETABLE
+POSTHOOK: query: CREATE TABLE dest_co1(key INT, cnt INT)
+POSTHOOK: type: CREATETABLE
+POSTHOOK: Output: default@dest_co1
+PREHOOK: query: CREATE TABLE dest_co2(key INT, cnt INT)
+PREHOOK: type: CREATETABLE
+POSTHOOK: query: CREATE TABLE dest_co2(key INT, cnt INT)
+POSTHOOK: type: CREATETABLE
+POSTHOOK: Output: default@dest_co2
+PREHOOK: query: -- INNER JOIN should be optimized
+EXPLAIN
+INSERT OVERWRITE TABLE dest_co1
+SELECT y.key, count(1) FROM T2 x JOIN T1 y ON (x.key = y.key) GROUP BY y.key
+PREHOOK: type: QUERY
+POSTHOOK: query: -- INNER JOIN should be optimized
+EXPLAIN
+INSERT OVERWRITE TABLE dest_co1
+SELECT y.key, count(1) FROM T2 x JOIN T1 y ON (x.key = y.key) GROUP BY y.key
+POSTHOOK: type: QUERY
+ABSTRACT SYNTAX TREE:
+  (TOK_QUERY (TOK_FROM (TOK_JOIN (TOK_TABREF (TOK_TABNAME T2) x) (TOK_TABREF (TOK_TABNAME T1) y) (= (. (TOK_TABLE_OR_COL x) key) (. (TOK_TABLE_OR_COL y) key)))) (TOK_INSERT (TOK_DESTINATION (TOK_TAB (TOK_TABNAME dest_co1))) (TOK_SELECT (TOK_SELEXPR (. (TOK_TABLE_OR_COL y) key)) (TOK_SELEXPR (TOK_FUNCTION count 1))) (TOK_GROUPBY (. (TOK_TABLE_OR_COL y) key))))
+
+STAGE DEPENDENCIES:
+  Stage-1 is a root stage
+  Stage-2 depends on stages: Stage-1
+  Stage-0 depends on stages: Stage-2
+  Stage-3 depends on stages: Stage-0
+
+STAGE PLANS:
+  Stage: Stage-1
+    Map Reduce
+      Alias -> Map Operator Tree:
+        x 
+          TableScan
+            alias: x
+            Reduce Output Operator
+              key expressions:
+                    expr: key
+                    type: int
+              sort order: +
+              Map-reduce partition columns:
+                    expr: key
+                    type: int
+              tag: 0
+        y 
+          TableScan
+            alias: y
+            Reduce Output Operator
+              key expressions:
+                    expr: key
+                    type: int
+              sort order: +
+              Map-reduce partition columns:
+                    expr: key
+                    type: int
+              tag: 1
+              value expressions:
+                    expr: key
+                    type: int
+      Reduce Operator Tree:
+        Join Operator
+          condition map:
+               Inner Join 0 to 1
+          condition expressions:
+            0 
+            1 {VALUE._col0}
+          handleSkewJoin: false
+          outputColumnNames: _col4
+          Select Operator
+            expressions:
+                  expr: _col4
+                  type: int
+            outputColumnNames: _col4
+            Group By Operator
+              aggregations:
+                    expr: count(1)
+              bucketGroup: false
+              keys:
+                    expr: _col4
+                    type: int
+              mode: hash
+              outputColumnNames: _col0, _col1
+              File Output Operator
+                compressed: false
+                GlobalTableId: 0
+                table:
+                    input format: org.apache.hadoop.mapred.SequenceFileInputFormat
+                    output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
+
+  Stage: Stage-2
+    Map Reduce
+      Alias -> Map Operator Tree:
+#### A masked pattern was here ####
+            Reduce Output Operator
+              key expressions:
+                    expr: _col0
+                    type: int
+              sort order: +
+              Map-reduce partition columns:
+                    expr: _col0
+                    type: int
+              tag: -1
+              value expressions:
+                    expr: _col1
+                    type: bigint
+      Reduce Operator Tree:
+        Group By Operator
+          aggregations:
+                expr: count(VALUE._col0)
+          bucketGroup: false
+          keys:
+                expr: KEY._col0
+                type: int
+          mode: mergepartial
+          outputColumnNames: _col0, _col1
+          Select Operator
+            expressions:
+                  expr: _col0
+                  type: int
+                  expr: _col1
+                  type: bigint
+            outputColumnNames: _col0, _col1
+            Select Operator
+              expressions:
+                    expr: _col0
+                    type: int
+                    expr: UDFToInteger(_col1)
+                    type: int
+              outputColumnNames: _col0, _col1
+              File Output Operator
+                compressed: false
+                GlobalTableId: 1
+                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
+                    name: default.dest_co1
+
+  Stage: Stage-0
+    Move Operator
+      tables:
+          replace: true
+          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
+              name: default.dest_co1
+
+  Stage: Stage-3
+    Stats-Aggr Operator
+
+
+PREHOOK: query: INSERT OVERWRITE TABLE dest_co1
+SELECT y.key, count(1) FROM T2 x JOIN T1 y ON (x.key = y.key) GROUP BY y.key
+PREHOOK: type: QUERY
+PREHOOK: Input: default@t1
+PREHOOK: Input: default@t2
+PREHOOK: Output: default@dest_co1
+POSTHOOK: query: INSERT OVERWRITE TABLE dest_co1
+SELECT y.key, count(1) FROM T2 x JOIN T1 y ON (x.key = y.key) GROUP BY y.key
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@t1
+POSTHOOK: Input: default@t2
+POSTHOOK: Output: default@dest_co1
+POSTHOOK: Lineage: dest_co1.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co1.key SIMPLE [(t1)y.FieldSchema(name:key, type:int, comment:null), ]
+PREHOOK: query: EXPLAIN
+INSERT OVERWRITE TABLE dest_co2
+SELECT y.key, count(1) FROM T2 x JOIN T1 y ON (x.key = y.key) GROUP BY y.key
+PREHOOK: type: QUERY
+POSTHOOK: query: EXPLAIN
+INSERT OVERWRITE TABLE dest_co2
+SELECT y.key, count(1) FROM T2 x JOIN T1 y ON (x.key = y.key) GROUP BY y.key
+POSTHOOK: type: QUERY
+POSTHOOK: Lineage: dest_co1.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co1.key SIMPLE [(t1)y.FieldSchema(name:key, type:int, comment:null), ]
+ABSTRACT SYNTAX TREE:
+  (TOK_QUERY (TOK_FROM (TOK_JOIN (TOK_TABREF (TOK_TABNAME T2) x) (TOK_TABREF (TOK_TABNAME T1) y) (= (. (TOK_TABLE_OR_COL x) key) (. (TOK_TABLE_OR_COL y) key)))) (TOK_INSERT (TOK_DESTINATION (TOK_TAB (TOK_TABNAME dest_co2))) (TOK_SELECT (TOK_SELEXPR (. (TOK_TABLE_OR_COL y) key)) (TOK_SELEXPR (TOK_FUNCTION count 1))) (TOK_GROUPBY (. (TOK_TABLE_OR_COL y) key))))
+
+STAGE DEPENDENCIES:
+  Stage-1 is a root stage
+  Stage-0 depends on stages: Stage-1
+  Stage-2 depends on stages: Stage-0
+
+STAGE PLANS:
+  Stage: Stage-1
+    Map Reduce
+      Alias -> Map Operator Tree:
+        x 
+          TableScan
+            alias: x
+            Select Operator
+              expressions:
+                    expr: key
+                    type: int
+              outputColumnNames: key
+              Forward
+                Correlation Composite Operator
+                  Reduce Output Operator
+                    key expressions:
+                          expr: key
+                          type: int
+                    sort order: +
+                    Map-reduce partition columns:
+                          expr: key
+                          type: int
+                    tag: 1
+        y 
+          TableScan
+            alias: y
+            Select Operator
+              expressions:
+                    expr: key
+                    type: int
+              outputColumnNames: key
+              Forward
+                Correlation Composite Operator
+                  Reduce Output Operator
+                    key expressions:
+                          expr: key
+                          type: int
+                    sort order: +
+                    Map-reduce partition columns:
+                          expr: key
+                          type: int
+                    tag: 0
+                    value expressions:
+                          expr: key
+                          type: int
+      Reduce Operator Tree:
+        Correlation Dispatch Operator
+          Join Operator
+            condition map:
+                 Inner Join 0 to 1
+            condition expressions:
+              0 
+              1 {VALUE._col0}
+            handleSkewJoin: false
+            outputColumnNames: _col4
+            Select Operator
+              expressions:
+                    expr: _col4
+                    type: int
+              outputColumnNames: _col4
+              Correlation Local Simulative Reduce Output Operator
+                key expressions:
+                      expr: _col4
+                      type: int
+                sort order: +
+                Map-reduce partition columns:
+                      expr: _col4
+                      type: int
+                tag: -1
+                value expressions:
+                      expr: 1
+                      type: int
+                Group By Operator
+                  aggregations:
+                        expr: count(VALUE._col0)
+                  bucketGroup: false
+                  keys:
+                        expr: KEY._col0
+                        type: int
+                  mode: complete
+                  outputColumnNames: _col0, _col1
+                  Select Operator
+                    expressions:
+                          expr: _col0
+                          type: int
+                          expr: _col1
+                          type: bigint
+                    outputColumnNames: _col0, _col1
+                    Select Operator
+                      expressions:
+                            expr: _col0
+                            type: int
+                            expr: UDFToInteger(_col1)
+                            type: int
+                      outputColumnNames: _col0, _col1
+                      File Output Operator
+                        compressed: false
+                        GlobalTableId: 1
+                        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
+                            name: default.dest_co2
+
+  Stage: Stage-0
+    Move Operator
+      tables:
+          replace: true
+          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
+              name: default.dest_co2
+
+  Stage: Stage-2
+    Stats-Aggr Operator
+
+
+PREHOOK: query: INSERT OVERWRITE TABLE dest_co2
+SELECT y.key, count(1) FROM T2 x JOIN T1 y ON (x.key = y.key) GROUP BY y.key
+PREHOOK: type: QUERY
+PREHOOK: Input: default@t1
+PREHOOK: Input: default@t2
+PREHOOK: Output: default@dest_co2
+POSTHOOK: query: INSERT OVERWRITE TABLE dest_co2
+SELECT y.key, count(1) FROM T2 x JOIN T1 y ON (x.key = y.key) GROUP BY y.key
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@t1
+POSTHOOK: Input: default@t2
+POSTHOOK: Output: default@dest_co2
+POSTHOOK: Lineage: dest_co1.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co1.key SIMPLE [(t1)y.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co2.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co2.key SIMPLE [(t1)y.FieldSchema(name:key, type:int, comment:null), ]
+PREHOOK: query: -- dest_co1 and dest_co2 should be same
+SELECT * FROM dest_co1 x ORDER BY x.key, x.cnt
+PREHOOK: type: QUERY
+PREHOOK: Input: default@dest_co1
+#### A masked pattern was here ####
+POSTHOOK: query: -- dest_co1 and dest_co2 should be same
+SELECT * FROM dest_co1 x ORDER BY x.key, x.cnt
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@dest_co1
+#### A masked pattern was here ####
+POSTHOOK: Lineage: dest_co1.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co1.key SIMPLE [(t1)y.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co2.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co2.key SIMPLE [(t1)y.FieldSchema(name:key, type:int, comment:null), ]
+2	1
+3	1
+8	4
+PREHOOK: query: SELECT * FROM dest_co2 x ORDER BY x.key, x.cnt
+PREHOOK: type: QUERY
+PREHOOK: Input: default@dest_co2
+#### A masked pattern was here ####
+POSTHOOK: query: SELECT * FROM dest_co2 x ORDER BY x.key, x.cnt
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@dest_co2
+#### A masked pattern was here ####
+POSTHOOK: Lineage: dest_co1.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co1.key SIMPLE [(t1)y.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co2.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co2.key SIMPLE [(t1)y.FieldSchema(name:key, type:int, comment:null), ]
+2	1
+3	1
+8	4
+PREHOOK: query: -- The case that GROUP BY key is from the left table of LEFT OUTER JOIN should be optimized
+EXPLAIN
+INSERT OVERWRITE TABLE dest_co1
+SELECT x.key, count(1) FROM T2 x LEFT OUTER JOIN T1 y ON (x.key = y.key) GROUP BY x.key
+PREHOOK: type: QUERY
+POSTHOOK: query: -- The case that GROUP BY key is from the left table of LEFT OUTER JOIN should be optimized
+EXPLAIN
+INSERT OVERWRITE TABLE dest_co1
+SELECT x.key, count(1) FROM T2 x LEFT OUTER JOIN T1 y ON (x.key = y.key) GROUP BY x.key
+POSTHOOK: type: QUERY
+POSTHOOK: Lineage: dest_co1.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co1.key SIMPLE [(t1)y.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co2.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co2.key SIMPLE [(t1)y.FieldSchema(name:key, type:int, comment:null), ]
+ABSTRACT SYNTAX TREE:
+  (TOK_QUERY (TOK_FROM (TOK_LEFTOUTERJOIN (TOK_TABREF (TOK_TABNAME T2) x) (TOK_TABREF (TOK_TABNAME T1) y) (= (. (TOK_TABLE_OR_COL x) key) (. (TOK_TABLE_OR_COL y) key)))) (TOK_INSERT (TOK_DESTINATION (TOK_TAB (TOK_TABNAME dest_co1))) (TOK_SELECT (TOK_SELEXPR (. (TOK_TABLE_OR_COL x) key)) (TOK_SELEXPR (TOK_FUNCTION count 1))) (TOK_GROUPBY (. (TOK_TABLE_OR_COL x) key))))
+
+STAGE DEPENDENCIES:
+  Stage-1 is a root stage
+  Stage-2 depends on stages: Stage-1
+  Stage-0 depends on stages: Stage-2
+  Stage-3 depends on stages: Stage-0
+
+STAGE PLANS:
+  Stage: Stage-1
+    Map Reduce
+      Alias -> Map Operator Tree:
+        x 
+          TableScan
+            alias: x
+            Reduce Output Operator
+              key expressions:
+                    expr: key
+                    type: int
+              sort order: +
+              Map-reduce partition columns:
+                    expr: key
+                    type: int
+              tag: 0
+              value expressions:
+                    expr: key
+                    type: int
+        y 
+          TableScan
+            alias: y
+            Reduce Output Operator
+              key expressions:
+                    expr: key
+                    type: int
+              sort order: +
+              Map-reduce partition columns:
+                    expr: key
+                    type: int
+              tag: 1
+      Reduce Operator Tree:
+        Join Operator
+          condition map:
+               Left Outer Join0 to 1
+          condition expressions:
+            0 {VALUE._col0}
+            1 
+          handleSkewJoin: false
+          outputColumnNames: _col0
+          Select Operator
+            expressions:
+                  expr: _col0
+                  type: int
+            outputColumnNames: _col0
+            Group By Operator
+              aggregations:
+                    expr: count(1)
+              bucketGroup: false
+              keys:
+                    expr: _col0
+                    type: int
+              mode: hash
+              outputColumnNames: _col0, _col1
+              File Output Operator
+                compressed: false
+                GlobalTableId: 0
+                table:
+                    input format: org.apache.hadoop.mapred.SequenceFileInputFormat
+                    output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
+
+  Stage: Stage-2
+    Map Reduce
+      Alias -> Map Operator Tree:
+#### A masked pattern was here ####
+            Reduce Output Operator
+              key expressions:
+                    expr: _col0
+                    type: int
+              sort order: +
+              Map-reduce partition columns:
+                    expr: _col0
+                    type: int
+              tag: -1
+              value expressions:
+                    expr: _col1
+                    type: bigint
+      Reduce Operator Tree:
+        Group By Operator
+          aggregations:
+                expr: count(VALUE._col0)
+          bucketGroup: false
+          keys:
+                expr: KEY._col0
+                type: int
+          mode: mergepartial
+          outputColumnNames: _col0, _col1
+          Select Operator
+            expressions:
+                  expr: _col0
+                  type: int
+                  expr: _col1
+                  type: bigint
+            outputColumnNames: _col0, _col1
+            Select Operator
+              expressions:
+                    expr: _col0
+                    type: int
+                    expr: UDFToInteger(_col1)
+                    type: int
+              outputColumnNames: _col0, _col1
+              File Output Operator
+                compressed: false
+                GlobalTableId: 1
+                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
+                    name: default.dest_co1
+
+  Stage: Stage-0
+    Move Operator
+      tables:
+          replace: true
+          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
+              name: default.dest_co1
+
+  Stage: Stage-3
+    Stats-Aggr Operator
+
+
+PREHOOK: query: INSERT OVERWRITE TABLE dest_co1
+SELECT x.key, count(1) FROM T2 x LEFT OUTER JOIN T1 y ON (x.key = y.key) GROUP BY x.key
+PREHOOK: type: QUERY
+PREHOOK: Input: default@t1
+PREHOOK: Input: default@t2
+PREHOOK: Output: default@dest_co1
+POSTHOOK: query: INSERT OVERWRITE TABLE dest_co1
+SELECT x.key, count(1) FROM T2 x LEFT OUTER JOIN T1 y ON (x.key = y.key) GROUP BY x.key
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@t1
+POSTHOOK: Input: default@t2
+POSTHOOK: Output: default@dest_co1
+POSTHOOK: Lineage: dest_co1.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co1.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co1.key SIMPLE [(t1)y.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co1.key SIMPLE [(t2)x.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co2.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co2.key SIMPLE [(t1)y.FieldSchema(name:key, type:int, comment:null), ]
+PREHOOK: query: EXPLAIN
+INSERT OVERWRITE TABLE dest_co2
+SELECT x.key, count(1) FROM T2 x LEFT OUTER JOIN T1 y ON (x.key = y.key) GROUP BY x.key
+PREHOOK: type: QUERY
+POSTHOOK: query: EXPLAIN
+INSERT OVERWRITE TABLE dest_co2
+SELECT x.key, count(1) FROM T2 x LEFT OUTER JOIN T1 y ON (x.key = y.key) GROUP BY x.key
+POSTHOOK: type: QUERY
+POSTHOOK: Lineage: dest_co1.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co1.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co1.key SIMPLE [(t1)y.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co1.key SIMPLE [(t2)x.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co2.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co2.key SIMPLE [(t1)y.FieldSchema(name:key, type:int, comment:null), ]
+ABSTRACT SYNTAX TREE:
+  (TOK_QUERY (TOK_FROM (TOK_LEFTOUTERJOIN (TOK_TABREF (TOK_TABNAME T2) x) (TOK_TABREF (TOK_TABNAME T1) y) (= (. (TOK_TABLE_OR_COL x) key) (. (TOK_TABLE_OR_COL y) key)))) (TOK_INSERT (TOK_DESTINATION (TOK_TAB (TOK_TABNAME dest_co2))) (TOK_SELECT (TOK_SELEXPR (. (TOK_TABLE_OR_COL x) key)) (TOK_SELEXPR (TOK_FUNCTION count 1))) (TOK_GROUPBY (. (TOK_TABLE_OR_COL x) key))))
+
+STAGE DEPENDENCIES:
+  Stage-1 is a root stage
+  Stage-0 depends on stages: Stage-1
+  Stage-2 depends on stages: Stage-0
+
+STAGE PLANS:
+  Stage: Stage-1
+    Map Reduce
+      Alias -> Map Operator Tree:
+        x 
+          TableScan
+            alias: x
+            Select Operator
+              expressions:
+                    expr: key
+                    type: int
+              outputColumnNames: key
+              Forward
+                Correlation Composite Operator
+                  Reduce Output Operator
+                    key expressions:
+                          expr: key
+                          type: int
+                    sort order: +
+                    Map-reduce partition columns:
+                          expr: key
+                          type: int
+                    tag: 1
+                    value expressions:
+                          expr: key
+                          type: int
+        y 
+          TableScan
+            alias: y
+            Select Operator
+              expressions:
+                    expr: key
+                    type: int
+              outputColumnNames: key
+              Forward
+                Correlation Composite Operator
+                  Reduce Output Operator
+                    key expressions:
+                          expr: key
+                          type: int
+                    sort order: +
+                    Map-reduce partition columns:
+                          expr: key
+                          type: int
+                    tag: 0
+      Reduce Operator Tree:
+        Correlation Dispatch Operator
+          Join Operator
+            condition map:
+                 Left Outer Join0 to 1
+            condition expressions:
+              0 {VALUE._col0}
+              1 
+            handleSkewJoin: false
+            outputColumnNames: _col0
+            Select Operator
+              expressions:
+                    expr: _col0
+                    type: int
+              outputColumnNames: _col0
+              Correlation Local Simulative Reduce Output Operator
+                key expressions:
+                      expr: _col0
+                      type: int
+                sort order: +
+                Map-reduce partition columns:
+                      expr: _col0
+                      type: int
+                tag: -1
+                value expressions:
+                      expr: 1
+                      type: int
+                Group By Operator
+                  aggregations:
+                        expr: count(VALUE._col0)
+                  bucketGroup: false
+                  keys:
+                        expr: KEY._col0
+                        type: int
+                  mode: complete
+                  outputColumnNames: _col0, _col1
+                  Select Operator
+                    expressions:
+                          expr: _col0
+                          type: int
+                          expr: _col1
+                          type: bigint
+                    outputColumnNames: _col0, _col1
+                    Select Operator
+                      expressions:
+                            expr: _col0
+                            type: int
+                            expr: UDFToInteger(_col1)
+                            type: int
+                      outputColumnNames: _col0, _col1
+                      File Output Operator
+                        compressed: false
+                        GlobalTableId: 1
+                        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
+                            name: default.dest_co2
+
+  Stage: Stage-0
+    Move Operator
+      tables:
+          replace: true
+          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
+              name: default.dest_co2
+
+  Stage: Stage-2
+    Stats-Aggr Operator
+
+
+PREHOOK: query: INSERT OVERWRITE TABLE dest_co2
+SELECT x.key, count(1) FROM T2 x LEFT OUTER JOIN T1 y ON (x.key = y.key) GROUP BY x.key
+PREHOOK: type: QUERY
+PREHOOK: Input: default@t1
+PREHOOK: Input: default@t2
+PREHOOK: Output: default@dest_co2
+POSTHOOK: query: INSERT OVERWRITE TABLE dest_co2
+SELECT x.key, count(1) FROM T2 x LEFT OUTER JOIN T1 y ON (x.key = y.key) GROUP BY x.key
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@t1
+POSTHOOK: Input: default@t2
+POSTHOOK: Output: default@dest_co2
+POSTHOOK: Lineage: dest_co1.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co1.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co1.key SIMPLE [(t1)y.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co1.key SIMPLE [(t2)x.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co2.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co2.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co2.key SIMPLE [(t1)y.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co2.key SIMPLE [(t2)x.FieldSchema(name:key, type:int, comment:null), ]
+PREHOOK: query: -- dest_co1 and dest_co2 should be same
+SELECT * FROM dest_co1 x ORDER BY x.key, x.cnt
+PREHOOK: type: QUERY
+PREHOOK: Input: default@dest_co1
+#### A masked pattern was here ####
+POSTHOOK: query: -- dest_co1 and dest_co2 should be same
+SELECT * FROM dest_co1 x ORDER BY x.key, x.cnt
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@dest_co1
+#### A masked pattern was here ####
+POSTHOOK: Lineage: dest_co1.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co1.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co1.key SIMPLE [(t1)y.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co1.key SIMPLE [(t2)x.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co2.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co2.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co2.key SIMPLE [(t1)y.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co2.key SIMPLE [(t2)x.FieldSchema(name:key, type:int, comment:null), ]
+2	1
+3	1
+4	1
+5	1
+8	4
+PREHOOK: query: SELECT * FROM dest_co2 x ORDER BY x.key, x.cnt
+PREHOOK: type: QUERY
+PREHOOK: Input: default@dest_co2
+#### A masked pattern was here ####
+POSTHOOK: query: SELECT * FROM dest_co2 x ORDER BY x.key, x.cnt
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@dest_co2
+#### A masked pattern was here ####
+POSTHOOK: Lineage: dest_co1.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co1.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co1.key SIMPLE [(t1)y.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co1.key SIMPLE [(t2)x.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co2.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co2.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co2.key SIMPLE [(t1)y.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co2.key SIMPLE [(t2)x.FieldSchema(name:key, type:int, comment:null), ]
+2	1
+3	1
+4	1
+5	1
+8	4
+PREHOOK: query: -- The case that GROUP BY key is from the right table of RIGHT OUTER JOIN should be optimized
+EXPLAIN
+INSERT OVERWRITE TABLE dest_co1
+SELECT y.key, count(1) FROM T2 x RIGHT OUTER JOIN T1 y ON (x.key = y.key) GROUP BY y.key
+PREHOOK: type: QUERY
+POSTHOOK: query: -- The case that GROUP BY key is from the right table of RIGHT OUTER JOIN should be optimized
+EXPLAIN
+INSERT OVERWRITE TABLE dest_co1
+SELECT y.key, count(1) FROM T2 x RIGHT OUTER JOIN T1 y ON (x.key = y.key) GROUP BY y.key
+POSTHOOK: type: QUERY
+POSTHOOK: Lineage: dest_co1.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co1.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co1.key SIMPLE [(t1)y.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co1.key SIMPLE [(t2)x.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co2.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co2.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co2.key SIMPLE [(t1)y.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co2.key SIMPLE [(t2)x.FieldSchema(name:key, type:int, comment:null), ]
+ABSTRACT SYNTAX TREE:
+  (TOK_QUERY (TOK_FROM (TOK_RIGHTOUTERJOIN (TOK_TABREF (TOK_TABNAME T2) x) (TOK_TABREF (TOK_TABNAME T1) y) (= (. (TOK_TABLE_OR_COL x) key) (. (TOK_TABLE_OR_COL y) key)))) (TOK_INSERT (TOK_DESTINATION (TOK_TAB (TOK_TABNAME dest_co1))) (TOK_SELECT (TOK_SELEXPR (. (TOK_TABLE_OR_COL y) key)) (TOK_SELEXPR (TOK_FUNCTION count 1))) (TOK_GROUPBY (. (TOK_TABLE_OR_COL y) key))))
+
+STAGE DEPENDENCIES:
+  Stage-1 is a root stage
+  Stage-2 depends on stages: Stage-1
+  Stage-0 depends on stages: Stage-2
+  Stage-3 depends on stages: Stage-0
+
+STAGE PLANS:
+  Stage: Stage-1
+    Map Reduce
+      Alias -> Map Operator Tree:
+        x 
+          TableScan
+            alias: x
+            Reduce Output Operator
+              key expressions:
+                    expr: key
+                    type: int
+              sort order: +
+              Map-reduce partition columns:
+                    expr: key
+                    type: int
+              tag: 0
+        y 
+          TableScan
+            alias: y
+            Reduce Output Operator
+              key expressions:
+                    expr: key
+                    type: int
+              sort order: +
+              Map-reduce partition columns:
+                    expr: key
+                    type: int
+              tag: 1
+              value expressions:
+                    expr: key
+                    type: int
+      Reduce Operator Tree:
+        Join Operator
+          condition map:
+               Right Outer Join0 to 1
+          condition expressions:
+            0 
+            1 {VALUE._col0}
+          handleSkewJoin: false
+          outputColumnNames: _col4
+          Select Operator
+            expressions:
+                  expr: _col4
+                  type: int
+            outputColumnNames: _col4
+            Group By Operator
+              aggregations:
+                    expr: count(1)
+              bucketGroup: false
+              keys:
+                    expr: _col4
+                    type: int
+              mode: hash
+              outputColumnNames: _col0, _col1
+              File Output Operator
+                compressed: false
+                GlobalTableId: 0
+                table:
+                    input format: org.apache.hadoop.mapred.SequenceFileInputFormat
+                    output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
+
+  Stage: Stage-2
+    Map Reduce
+      Alias -> Map Operator Tree:
+#### A masked pattern was here ####
+            Reduce Output Operator
+              key expressions:
+                    expr: _col0
+                    type: int
+              sort order: +
+              Map-reduce partition columns:
+                    expr: _col0
+                    type: int
+              tag: -1
+              value expressions:
+                    expr: _col1
+                    type: bigint
+      Reduce Operator Tree:
+        Group By Operator
+          aggregations:
+                expr: count(VALUE._col0)
+          bucketGroup: false
+          keys:
+                expr: KEY._col0
+                type: int
+          mode: mergepartial
+          outputColumnNames: _col0, _col1
+          Select Operator
+            expressions:
+                  expr: _col0
+                  type: int
+                  expr: _col1
+                  type: bigint
+            outputColumnNames: _col0, _col1
+            Select Operator
+              expressions:
+                    expr: _col0
+                    type: int
+                    expr: UDFToInteger(_col1)
+                    type: int
+              outputColumnNames: _col0, _col1
+              File Output Operator
+                compressed: false
+                GlobalTableId: 1
+                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
+                    name: default.dest_co1
+
+  Stage: Stage-0
+    Move Operator
+      tables:
+          replace: true
+          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
+              name: default.dest_co1
+
+  Stage: Stage-3
+    Stats-Aggr Operator
+
+
+PREHOOK: query: INSERT OVERWRITE TABLE dest_co1
+SELECT y.key, count(1) FROM T2 x RIGHT OUTER JOIN T1 y ON (x.key = y.key) GROUP BY y.key
+PREHOOK: type: QUERY
+PREHOOK: Input: default@t1
+PREHOOK: Input: default@t2
+PREHOOK: Output: default@dest_co1
+POSTHOOK: query: INSERT OVERWRITE TABLE dest_co1
+SELECT y.key, count(1) FROM T2 x RIGHT OUTER JOIN T1 y ON (x.key = y.key) GROUP BY y.key
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@t1
+POSTHOOK: Input: default@t2
+POSTHOOK: Output: default@dest_co1
+POSTHOOK: Lineage: dest_co1.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co1.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co1.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co1.key SIMPLE [(t1)y.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co1.key SIMPLE [(t2)x.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co1.key SIMPLE [(t1)y.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co2.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co2.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co2.key SIMPLE [(t1)y.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co2.key SIMPLE [(t2)x.FieldSchema(name:key, type:int, comment:null), ]
+PREHOOK: query: EXPLAIN
+INSERT OVERWRITE TABLE dest_co2
+SELECT y.key, count(1) FROM T2 x RIGHT OUTER JOIN T1 y ON (x.key = y.key) GROUP BY y.key
+PREHOOK: type: QUERY
+POSTHOOK: query: EXPLAIN
+INSERT OVERWRITE TABLE dest_co2
+SELECT y.key, count(1) FROM T2 x RIGHT OUTER JOIN T1 y ON (x.key = y.key) GROUP BY y.key
+POSTHOOK: type: QUERY
+POSTHOOK: Lineage: dest_co1.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co1.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co1.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co1.key SIMPLE [(t1)y.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co1.key SIMPLE [(t2)x.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co1.key SIMPLE [(t1)y.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co2.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co2.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co2.key SIMPLE [(t1)y.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co2.key SIMPLE [(t2)x.FieldSchema(name:key, type:int, comment:null), ]
+ABSTRACT SYNTAX TREE:
+  (TOK_QUERY (TOK_FROM (TOK_RIGHTOUTERJOIN (TOK_TABREF (TOK_TABNAME T2) x) (TOK_TABREF (TOK_TABNAME T1) y) (= (. (TOK_TABLE_OR_COL x) key) (. (TOK_TABLE_OR_COL y) key)))) (TOK_INSERT (TOK_DESTINATION (TOK_TAB (TOK_TABNAME dest_co2))) (TOK_SELECT (TOK_SELEXPR (. (TOK_TABLE_OR_COL y) key)) (TOK_SELEXPR (TOK_FUNCTION count 1))) (TOK_GROUPBY (. (TOK_TABLE_OR_COL y) key))))
+
+STAGE DEPENDENCIES:
+  Stage-1 is a root stage
+  Stage-0 depends on stages: Stage-1
+  Stage-2 depends on stages: Stage-0
+
+STAGE PLANS:
+  Stage: Stage-1
+    Map Reduce
+      Alias -> Map Operator Tree:
+        x 
+          TableScan
+            alias: x
+            Select Operator
+              expressions:
+                    expr: key
+                    type: int
+              outputColumnNames: key
+              Forward
+                Correlation Composite Operator
+                  Reduce Output Operator
+                    key expressions:
+                          expr: key
+                          type: int
+                    sort order: +
+                    Map-reduce partition columns:
+                          expr: key
+                          type: int
+                    tag: 1
+        y 
+          TableScan
+            alias: y
+            Select Operator
+              expressions:
+                    expr: key
+                    type: int
+              outputColumnNames: key
+              Forward
+                Correlation Composite Operator
+                  Reduce Output Operator
+                    key expressions:
+                          expr: key
+                          type: int
+                    sort order: +
+                    Map-reduce partition columns:
+                          expr: key
+                          type: int
+                    tag: 0
+                    value expressions:
+                          expr: key
+                          type: int
+      Reduce Operator Tree:
+        Correlation Dispatch Operator
+          Join Operator
+            condition map:
+                 Right Outer Join0 to 1
+            condition expressions:
+              0 
+              1 {VALUE._col0}
+            handleSkewJoin: false
+            outputColumnNames: _col4
+            Select Operator
+              expressions:
+                    expr: _col4
+                    type: int
+              outputColumnNames: _col4
+              Correlation Local Simulative Reduce Output Operator
+                key expressions:
+                      expr: _col4
+                      type: int
+                sort order: +
+                Map-reduce partition columns:
+                      expr: _col4
+                      type: int
+                tag: -1
+                value expressions:
+                      expr: 1
+                      type: int
+                Group By Operator
+                  aggregations:
+                        expr: count(VALUE._col0)
+                  bucketGroup: false
+                  keys:
+                        expr: KEY._col0
+                        type: int
+                  mode: complete
+                  outputColumnNames: _col0, _col1
+                  Select Operator
+                    expressions:
+                          expr: _col0
+                          type: int
+                          expr: _col1
+                          type: bigint
+                    outputColumnNames: _col0, _col1
+                    Select Operator
+                      expressions:
+                            expr: _col0
+                            type: int
+                            expr: UDFToInteger(_col1)
+                            type: int
+                      outputColumnNames: _col0, _col1
+                      File Output Operator
+                        compressed: false
+                        GlobalTableId: 1
+                        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
+                            name: default.dest_co2
+
+  Stage: Stage-0
+    Move Operator
+      tables:
+          replace: true
+          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
+              name: default.dest_co2
+
+  Stage: Stage-2
+    Stats-Aggr Operator
+
+
+PREHOOK: query: INSERT OVERWRITE TABLE dest_co2
+SELECT y.key, count(1) FROM T2 x RIGHT OUTER JOIN T1 y ON (x.key = y.key) GROUP BY y.key
+PREHOOK: type: QUERY
+PREHOOK: Input: default@t1
+PREHOOK: Input: default@t2
+PREHOOK: Output: default@dest_co2
+POSTHOOK: query: INSERT OVERWRITE TABLE dest_co2
+SELECT y.key, count(1) FROM T2 x RIGHT OUTER JOIN T1 y ON (x.key = y.key) GROUP BY y.key
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@t1
+POSTHOOK: Input: default@t2
+POSTHOOK: Output: default@dest_co2
+POSTHOOK: Lineage: dest_co1.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co1.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co1.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co1.key SIMPLE [(t1)y.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co1.key SIMPLE [(t2)x.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co1.key SIMPLE [(t1)y.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co2.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co2.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co2.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co2.key SIMPLE [(t1)y.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co2.key SIMPLE [(t2)x.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co2.key SIMPLE [(t1)y.FieldSchema(name:key, type:int, comment:null), ]
+PREHOOK: query: -- dest_co1 and dest_co2 should be same
+SELECT * FROM dest_co1 x ORDER BY x.key, x.cnt
+PREHOOK: type: QUERY
+PREHOOK: Input: default@dest_co1
+#### A masked pattern was here ####
+POSTHOOK: query: -- dest_co1 and dest_co2 should be same
+SELECT * FROM dest_co1 x ORDER BY x.key, x.cnt
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@dest_co1
+#### A masked pattern was here ####
+POSTHOOK: Lineage: dest_co1.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co1.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co1.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co1.key SIMPLE [(t1)y.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co1.key SIMPLE [(t2)x.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co1.key SIMPLE [(t1)y.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co2.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co2.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co2.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co2.key SIMPLE [(t1)y.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co2.key SIMPLE [(t2)x.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co2.key SIMPLE [(t1)y.FieldSchema(name:key, type:int, comment:null), ]
+1	1
+2	1
+3	1
+7	1
+8	4
+PREHOOK: query: SELECT * FROM dest_co2 x ORDER BY x.key, x.cnt
+PREHOOK: type: QUERY
+PREHOOK: Input: default@dest_co2
+#### A masked pattern was here ####
+POSTHOOK: query: SELECT * FROM dest_co2 x ORDER BY x.key, x.cnt
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@dest_co2
+#### A masked pattern was here ####
+POSTHOOK: Lineage: dest_co1.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co1.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co1.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co1.key SIMPLE [(t1)y.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co1.key SIMPLE [(t2)x.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co1.key SIMPLE [(t1)y.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co2.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co2.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co2.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co2.key SIMPLE [(t1)y.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co2.key SIMPLE [(t2)x.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co2.key SIMPLE [(t1)y.FieldSchema(name:key, type:int, comment:null), ]
+1	1
+2	1
+3	1
+7	1
+8	4
+PREHOOK: query: -- The case that GROUP BY key is from the right table of LEFT OUTER JOIN should not be optimized
+EXPLAIN
+INSERT OVERWRITE TABLE dest_co1
+SELECT y.key, count(1) FROM T2 x LEFT OUTER JOIN T1 y ON (x.key = y.key) GROUP BY y.key
+PREHOOK: type: QUERY
+POSTHOOK: query: -- The case that GROUP BY key is from the right table of LEFT OUTER JOIN should not be optimized
+EXPLAIN
+INSERT OVERWRITE TABLE dest_co1
+SELECT y.key, count(1) FROM T2 x LEFT OUTER JOIN T1 y ON (x.key = y.key) GROUP BY y.key
+POSTHOOK: type: QUERY
+POSTHOOK: Lineage: dest_co1.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co1.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co1.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co1.key SIMPLE [(t1)y.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co1.key SIMPLE [(t2)x.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co1.key SIMPLE [(t1)y.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co2.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co2.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co2.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co2.key SIMPLE [(t1)y.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co2.key SIMPLE [(t2)x.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co2.key SIMPLE [(t1)y.FieldSchema(name:key, type:int, comment:null), ]
+ABSTRACT SYNTAX TREE:
+  (TOK_QUERY (TOK_FROM (TOK_LEFTOUTERJOIN (TOK_TABREF (TOK_TABNAME T2) x) (TOK_TABREF (TOK_TABNAME T1) y) (= (. (TOK_TABLE_OR_COL x) key) (. (TOK_TABLE_OR_COL y) key)))) (TOK_INSERT (TOK_DESTINATION (TOK_TAB (TOK_TABNAME dest_co1))) (TOK_SELECT (TOK_SELEXPR (. (TOK_TABLE_OR_COL y) key)) (TOK_SELEXPR (TOK_FUNCTION count 1))) (TOK_GROUPBY (. (TOK_TABLE_OR_COL y) key))))
+
+STAGE DEPENDENCIES:
+  Stage-1 is a root stage
+  Stage-2 depends on stages: Stage-1
+  Stage-0 depends on stages: Stage-2
+  Stage-3 depends on stages: Stage-0
+
+STAGE PLANS:
+  Stage: Stage-1
+    Map Reduce
+      Alias -> Map Operator Tree:
+        x 
+          TableScan
+            alias: x
+            Reduce Output Operator
+              key expressions:
+                    expr: key
+                    type: int
+              sort order: +
+              Map-reduce partition columns:
+                    expr: key
+                    type: int
+              tag: 0
+        y 
+          TableScan
+            alias: y
+            Reduce Output Operator
+              key expressions:
+                    expr: key
+                    type: int
+              sort order: +
+              Map-reduce partition columns:
+                    expr: key
+                    type: int
+              tag: 1
+              value expressions:
+                    expr: key
+                    type: int
+      Reduce Operator Tree:
+        Join Operator
+          condition map:
+               Left Outer Join0 to 1
+          condition expressions:
+            0 
+            1 {VALUE._col0}
+          handleSkewJoin: false
+          outputColumnNames: _col4
+          Select Operator
+            expressions:
+                  expr: _col4
+                  type: int
+            outputColumnNames: _col4
+            Group By Operator
+              aggregations:
+                    expr: count(1)
+              bucketGroup: false
+              keys:
+                    expr: _col4
+                    type: int
+              mode: hash
+              outputColumnNames: _col0, _col1
+              File Output Operator
+                compressed: false
+                GlobalTableId: 0
+                table:
+                    input format: org.apache.hadoop.mapred.SequenceFileInputFormat
+                    output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
+
+  Stage: Stage-2
+    Map Reduce
+      Alias -> Map Operator Tree:
+#### A masked pattern was here ####
+            Reduce Output Operator
+              key expressions:
+                    expr: _col0
+                    type: int
+              sort order: +
+              Map-reduce partition columns:
+                    expr: _col0
+                    type: int
+              tag: -1
+              value expressions:
+                    expr: _col1
+                    type: bigint
+      Reduce Operator Tree:
+        Group By Operator
+          aggregations:
+                expr: count(VALUE._col0)
+          bucketGroup: false
+          keys:
+                expr: KEY._col0
+                type: int
+          mode: mergepartial
+          outputColumnNames: _col0, _col1
+          Select Operator
+            expressions:
+                  expr: _col0
+                  type: int
+                  expr: _col1
+                  type: bigint
+            outputColumnNames: _col0, _col1
+            Select Operator
+              expressions:
+                    expr: _col0
+                    type: int
+                    expr: UDFToInteger(_col1)
+                    type: int
+              outputColumnNames: _col0, _col1
+              File Output Operator
+                compressed: false
+                GlobalTableId: 1
+                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
+                    name: default.dest_co1
+
+  Stage: Stage-0
+    Move Operator
+      tables:
+          replace: true
+          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
+              name: default.dest_co1
+
+  Stage: Stage-3
+    Stats-Aggr Operator
+
+
+PREHOOK: query: INSERT OVERWRITE TABLE dest_co1
+SELECT y.key, count(1) FROM T2 x LEFT OUTER JOIN T1 y ON (x.key = y.key) GROUP BY y.key
+PREHOOK: type: QUERY
+PREHOOK: Input: default@t1
+PREHOOK: Input: default@t2
+PREHOOK: Output: default@dest_co1
+POSTHOOK: query: INSERT OVERWRITE TABLE dest_co1
+SELECT y.key, count(1) FROM T2 x LEFT OUTER JOIN T1 y ON (x.key = y.key) GROUP BY y.key
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@t1
+POSTHOOK: Input: default@t2
+POSTHOOK: Output: default@dest_co1
+POSTHOOK: Lineage: dest_co1.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co1.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co1.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co1.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co1.key SIMPLE [(t1)y.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co1.key SIMPLE [(t2)x.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co1.key SIMPLE [(t1)y.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co1.key SIMPLE [(t1)y.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co2.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co2.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co2.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co2.key SIMPLE [(t1)y.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co2.key SIMPLE [(t2)x.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co2.key SIMPLE [(t1)y.FieldSchema(name:key, type:int, comment:null), ]
+PREHOOK: query: EXPLAIN
+INSERT OVERWRITE TABLE dest_co2
+SELECT y.key, count(1) FROM T2 x LEFT OUTER JOIN T1 y ON (x.key = y.key) GROUP BY y.key
+PREHOOK: type: QUERY
+POSTHOOK: query: EXPLAIN
+INSERT OVERWRITE TABLE dest_co2
+SELECT y.key, count(1) FROM T2 x LEFT OUTER JOIN T1 y ON (x.key = y.key) GROUP BY y.key
+POSTHOOK: type: QUERY
+POSTHOOK: Lineage: dest_co1.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co1.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co1.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co1.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co1.key SIMPLE [(t1)y.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co1.key SIMPLE [(t2)x.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co1.key SIMPLE [(t1)y.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co1.key SIMPLE [(t1)y.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co2.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co2.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co2.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co2.key SIMPLE [(t1)y.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co2.key SIMPLE [(t2)x.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co2.key SIMPLE [(t1)y.FieldSchema(name:key, type:int, comment:null), ]
+ABSTRACT SYNTAX TREE:
+  (TOK_QUERY (TOK_FROM (TOK_LEFTOUTERJOIN (TOK_TABREF (TOK_TABNAME T2) x) (TOK_TABREF (TOK_TABNAME T1) y) (= (. (TOK_TABLE_OR_COL x) key) (. (TOK_TABLE_OR_COL y) key)))) (TOK_INSERT (TOK_DESTINATION (TOK_TAB (TOK_TABNAME dest_co2))) (TOK_SELECT (TOK_SELEXPR (. (TOK_TABLE_OR_COL y) key)) (TOK_SELEXPR (TOK_FUNCTION count 1))) (TOK_GROUPBY (. (TOK_TABLE_OR_COL y) key))))
+
+STAGE DEPENDENCIES:
+  Stage-1 is a root stage
+  Stage-2 depends on stages: Stage-1
+  Stage-0 depends on stages: Stage-2
+  Stage-3 depends on stages: Stage-0
+
+STAGE PLANS:
+  Stage: Stage-1
+    Map Reduce
+      Alias -> Map Operator Tree:
+        x 
+          TableScan
+            alias: x
+            Reduce Output Operator
+              key expressions:
+                    expr: key
+                    type: int
+              sort order: +
+              Map-reduce partition columns:
+                    expr: key
+                    type: int
+              tag: 0
+        y 
+          TableScan
+            alias: y
+            Reduce Output Operator
+              key expressions:
+                    expr: key
+                    type: int
+              sort order: +
+              Map-reduce partition columns:
+                    expr: key
+                    type: int
+              tag: 1
+              value expressions:
+                    expr: key
+                    type: int
+      Reduce Operator Tree:
+        Join Operator
+          condition map:
+               Left Outer Join0 to 1
+          condition expressions:
+            0 
+            1 {VALUE._col0}
+          handleSkewJoin: false
+          outputColumnNames: _col4
+          Select Operator
+            expressions:
+                  expr: _col4
+                  type: int
+            outputColumnNames: _col4
+            Group By Operator
+              aggregations:
+                    expr: count(1)
+              bucketGroup: false
+              keys:
+                    expr: _col4
+                    type: int
+              mode: hash
+              outputColumnNames: _col0, _col1
+              File Output Operator
+                compressed: false
+                GlobalTableId: 0
+                table:
+                    input format: org.apache.hadoop.mapred.SequenceFileInputFormat
+                    output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
+
+  Stage: Stage-2
+    Map Reduce
+      Alias -> Map Operator Tree:
+#### A masked pattern was here ####
+            Reduce Output Operator
+              key expressions:
+                    expr: _col0
+                    type: int
+              sort order: +
+              Map-reduce partition columns:
+                    expr: _col0
+                    type: int
+              tag: -1
+              value expressions:
+                    expr: _col1
+                    type: bigint
+      Reduce Operator Tree:
+        Group By Operator
+          aggregations:
+                expr: count(VALUE._col0)
+          bucketGroup: false
+          keys:
+                expr: KEY._col0
+                type: int
+          mode: mergepartial
+          outputColumnNames: _col0, _col1
+          Select Operator
+            expressions:
+                  expr: _col0
+                  type: int
+                  expr: _col1
+                  type: bigint
+            outputColumnNames: _col0, _col1
+            Select Operator
+              expressions:
+                    expr: _col0
+                    type: int
+                    expr: UDFToInteger(_col1)
+                    type: int
+              outputColumnNames: _col0, _col1
+              File Output Operator
+                compressed: false
+                GlobalTableId: 1
+                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
+                    name: default.dest_co2
+
+  Stage: Stage-0
+    Move Operator
+      tables:
+          replace: true
+          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
+              name: default.dest_co2
+
+  Stage: Stage-3
+    Stats-Aggr Operator
+
+
+PREHOOK: query: INSERT OVERWRITE TABLE dest_co2
+SELECT y.key, count(1) FROM T2 x LEFT OUTER JOIN T1 y ON (x.key = y.key) GROUP BY y.key
+PREHOOK: type: QUERY
+PREHOOK: Input: default@t1
+PREHOOK: Input: default@t2
+PREHOOK: Output: default@dest_co2
+POSTHOOK: query: INSERT OVERWRITE TABLE dest_co2
+SELECT y.key, count(1) FROM T2 x LEFT OUTER JOIN T1 y ON (x.key = y.key) GROUP BY y.key
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@t1
+POSTHOOK: Input: default@t2
+POSTHOOK: Output: default@dest_co2
+POSTHOOK: Lineage: dest_co1.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co1.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co1.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co1.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co1.key SIMPLE [(t1)y.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co1.key SIMPLE [(t2)x.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co1.key SIMPLE [(t1)y.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co1.key SIMPLE [(t1)y.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co2.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co2.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co2.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co2.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co2.key SIMPLE [(t1)y.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co2.key SIMPLE [(t2)x.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co2.key SIMPLE [(t1)y.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co2.key SIMPLE [(t1)y.FieldSchema(name:key, type:int, comment:null), ]
+PREHOOK: query: -- dest_co1 and dest_co2 should be same
+SELECT * FROM dest_co1 x ORDER BY x.key, x.cnt
+PREHOOK: type: QUERY
+PREHOOK: Input: default@dest_co1
+#### A masked pattern was here ####
+POSTHOOK: query: -- dest_co1 and dest_co2 should be same
+SELECT * FROM dest_co1 x ORDER BY x.key, x.cnt
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@dest_co1
+#### A masked pattern was here ####
+POSTHOOK: Lineage: dest_co1.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co1.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co1.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co1.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co1.key SIMPLE [(t1)y.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co1.key SIMPLE [(t2)x.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co1.key SIMPLE [(t1)y.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co1.key SIMPLE [(t1)y.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co2.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co2.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co2.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co2.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co2.key SIMPLE [(t1)y.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co2.key SIMPLE [(t2)x.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co2.key SIMPLE [(t1)y.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co2.key SIMPLE [(t1)y.FieldSchema(name:key, type:int, comment:null), ]
+NULL	2
+2	1
+3	1
+8	4
+PREHOOK: query: SELECT * FROM dest_co2 x ORDER BY x.key, x.cnt
+PREHOOK: type: QUERY
+PREHOOK: Input: default@dest_co2
+#### A masked pattern was here ####
+POSTHOOK: query: SELECT * FROM dest_co2 x ORDER BY x.key, x.cnt
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@dest_co2
+#### A masked pattern was here ####
+POSTHOOK: Lineage: dest_co1.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co1.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co1.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co1.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co1.key SIMPLE [(t1)y.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co1.key SIMPLE [(t2)x.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co1.key SIMPLE [(t1)y.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co1.key SIMPLE [(t1)y.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co2.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co2.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co2.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co2.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co2.key SIMPLE [(t1)y.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co2.key SIMPLE [(t2)x.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co2.key SIMPLE [(t1)y.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co2.key SIMPLE [(t1)y.FieldSchema(name:key, type:int, comment:null), ]
+NULL	2
+2	1
+3	1
+8	4
+PREHOOK: query: -- The case that GROUP BY key is from the left table of RIGHT OUTER JOIN should not be optimized
+EXPLAIN
+INSERT OVERWRITE TABLE dest_co1
+SELECT x.key, count(1) FROM T2 x RIGHT OUTER JOIN T1 y ON (x.key = y.key) GROUP BY x.key
+PREHOOK: type: QUERY
+POSTHOOK: query: -- The case that GROUP BY key is from the left table of RIGHT OUTER JOIN should not be optimized
+EXPLAIN
+INSERT OVERWRITE TABLE dest_co1
+SELECT x.key, count(1) FROM T2 x RIGHT OUTER JOIN T1 y ON (x.key = y.key) GROUP BY x.key
+POSTHOOK: type: QUERY
+POSTHOOK: Lineage: dest_co1.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co1.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co1.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co1.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co1.key SIMPLE [(t1)y.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co1.key SIMPLE [(t2)x.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co1.key SIMPLE [(t1)y.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co1.key SIMPLE [(t1)y.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co2.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co2.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co2.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co2.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co2.key SIMPLE [(t1)y.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co2.key SIMPLE [(t2)x.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co2.key SIMPLE [(t1)y.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co2.key SIMPLE [(t1)y.FieldSchema(name:key, type:int, comment:null), ]
+ABSTRACT SYNTAX TREE:
+  (TOK_QUERY (TOK_FROM (TOK_RIGHTOUTERJOIN (TOK_TABREF (TOK_TABNAME T2) x) (TOK_TABREF (TOK_TABNAME T1) y) (= (. (TOK_TABLE_OR_COL x) key) (. (TOK_TABLE_OR_COL y) key)))) (TOK_INSERT (TOK_DESTINATION (TOK_TAB (TOK_TABNAME dest_co1))) (TOK_SELECT (TOK_SELEXPR (. (TOK_TABLE_OR_COL x) key)) (TOK_SELEXPR (TOK_FUNCTION count 1))) (TOK_GROUPBY (. (TOK_TABLE_OR_COL x) key))))
+
+STAGE DEPENDENCIES:
+  Stage-1 is a root stage
+  Stage-2 depends on stages: Stage-1
+  Stage-0 depends on stages: Stage-2
+  Stage-3 depends on stages: Stage-0
+
+STAGE PLANS:
+  Stage: Stage-1
+    Map Reduce
+      Alias -> Map Operator Tree:
+        x 
+          TableScan
+            alias: x
+            Reduce Output Operator
+              key expressions:
+                    expr: key
+                    type: int
+              sort order: +
+              Map-reduce partition columns:
+                    expr: key
+                    type: int
+              tag: 0
+              value expressions:
+                    expr: key
+                    type: int
+        y 
+          TableScan
+            alias: y
+            Reduce Output Operator
+              key expressions:
+                    expr: key
+                    type: int
+              sort order: +
+              Map-reduce partition columns:
+                    expr: key
+                    type: int
+              tag: 1
+      Reduce Operator Tree:
+        Join Operator
+          condition map:
+               Right Outer Join0 to 1
+          condition expressions:
+            0 {VALUE._col0}
+            1 
+          handleSkewJoin: false
+          outputColumnNames: _col0
+          Select Operator
+            expressions:
+                  expr: _col0
+                  type: int
+            outputColumnNames: _col0
+            Group By Operator
+              aggregations:
+                    expr: count(1)
+              bucketGroup: false
+              keys:
+                    expr: _col0
+                    type: int
+              mode: hash
+              outputColumnNames: _col0, _col1
+              File Output Operator
+                compressed: false
+                GlobalTableId: 0
+                table:
+                    input format: org.apache.hadoop.mapred.SequenceFileInputFormat
+                    output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
+
+  Stage: Stage-2
+    Map Reduce
+      Alias -> Map Operator Tree:
+#### A masked pattern was here ####
+            Reduce Output Operator
+              key expressions:
+                    expr: _col0
+                    type: int
+              sort order: +
+              Map-reduce partition columns:
+                    expr: _col0
+                    type: int
+              tag: -1
+              value expressions:
+                    expr: _col1
+                    type: bigint
+      Reduce Operator Tree:
+        Group By Operator
+          aggregations:
+                expr: count(VALUE._col0)
+          bucketGroup: false
+          keys:
+                expr: KEY._col0
+                type: int
+          mode: mergepartial
+          outputColumnNames: _col0, _col1
+          Select Operator
+            expressions:
+                  expr: _col0
+                  type: int
+                  expr: _col1
+                  type: bigint
+            outputColumnNames: _col0, _col1
+            Select Operator
+              expressions:
+                    expr: _col0
+                    type: int
+                    expr: UDFToInteger(_col1)
+                    type: int
+              outputColumnNames: _col0, _col1
+              File Output Operator
+                compressed: false
+                GlobalTableId: 1
+                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
+                    name: default.dest_co1
+
+  Stage: Stage-0
+    Move Operator
+      tables:
+          replace: true
+          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
+              name: default.dest_co1
+
+  Stage: Stage-3
+    Stats-Aggr Operator
+
+
+PREHOOK: query: INSERT OVERWRITE TABLE dest_co1
+SELECT x.key, count(1) FROM T2 x RIGHT OUTER JOIN T1 y ON (x.key = y.key) GROUP BY x.key
+PREHOOK: type: QUERY
+PREHOOK: Input: default@t1
+PREHOOK: Input: default@t2
+PREHOOK: Output: default@dest_co1
+POSTHOOK: query: INSERT OVERWRITE TABLE dest_co1
+SELECT x.key, count(1) FROM T2 x RIGHT OUTER JOIN T1 y ON (x.key = y.key) GROUP BY x.key
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@t1
+POSTHOOK: Input: default@t2
+POSTHOOK: Output: default@dest_co1
+POSTHOOK: Lineage: dest_co1.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co1.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co1.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co1.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co1.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co1.key SIMPLE [(t1)y.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co1.key SIMPLE [(t2)x.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co1.key SIMPLE [(t1)y.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co1.key SIMPLE [(t1)y.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co1.key SIMPLE [(t2)x.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co2.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co2.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co2.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co2.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co2.key SIMPLE [(t1)y.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co2.key SIMPLE [(t2)x.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co2.key SIMPLE [(t1)y.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co2.key SIMPLE [(t1)y.FieldSchema(name:key, type:int, comment:null), ]
+PREHOOK: query: EXPLAIN
+INSERT OVERWRITE TABLE dest_co2
+SELECT x.key, count(1) FROM T2 x RIGHT OUTER JOIN T1 y ON (x.key = y.key) GROUP BY x.key
+PREHOOK: type: QUERY
+POSTHOOK: query: EXPLAIN
+INSERT OVERWRITE TABLE dest_co2
+SELECT x.key, count(1) FROM T2 x RIGHT OUTER JOIN T1 y ON (x.key = y.key) GROUP BY x.key
+POSTHOOK: type: QUERY
+POSTHOOK: Lineage: dest_co1.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co1.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co1.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co1.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co1.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co1.key SIMPLE [(t1)y.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co1.key SIMPLE [(t2)x.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co1.key SIMPLE [(t1)y.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co1.key SIMPLE [(t1)y.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co1.key SIMPLE [(t2)x.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co2.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co2.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co2.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co2.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co2.key SIMPLE [(t1)y.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co2.key SIMPLE [(t2)x.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co2.key SIMPLE [(t1)y.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co2.key SIMPLE [(t1)y.FieldSchema(name:key, type:int, comment:null), ]
+ABSTRACT SYNTAX TREE:
+  (TOK_QUERY (TOK_FROM (TOK_RIGHTOUTERJOIN (TOK_TABREF (TOK_TABNAME T2) x) (TOK_TABREF (TOK_TABNAME T1) y) (= (. (TOK_TABLE_OR_COL x) key) (. (TOK_TABLE_OR_COL y) key)))) (TOK_INSERT (TOK_DESTINATION (TOK_TAB (TOK_TABNAME dest_co2))) (TOK_SELECT (TOK_SELEXPR (. (TOK_TABLE_OR_COL x) key)) (TOK_SELEXPR (TOK_FUNCTION count 1))) (TOK_GROUPBY (. (TOK_TABLE_OR_COL x) key))))
+
+STAGE DEPENDENCIES:
+  Stage-1 is a root stage
+  Stage-2 depends on stages: Stage-1
+  Stage-0 depends on stages: Stage-2
+  Stage-3 depends on stages: Stage-0
+
+STAGE PLANS:
+  Stage: Stage-1
+    Map Reduce
+      Alias -> Map Operator Tree:
+        x 
+          TableScan
+            alias: x
+            Reduce Output Operator
+              key expressions:
+                    expr: key
+                    type: int
+              sort order: +
+              Map-reduce partition columns:
+                    expr: key
+                    type: int
+              tag: 0
+              value expressions:
+                    expr: key
+                    type: int
+        y 
+          TableScan
+            alias: y
+            Reduce Output Operator
+              key expressions:
+                    expr: key
+                    type: int
+              sort order: +
+              Map-reduce partition columns:
+                    expr: key
+                    type: int
+              tag: 1
+      Reduce Operator Tree:
+        Join Operator
+          condition map:
+               Right Outer Join0 to 1
+          condition expressions:
+            0 {VALUE._col0}
+            1 
+          handleSkewJoin: false
+          outputColumnNames: _col0
+          Select Operator
+            expressions:
+                  expr: _col0
+                  type: int
+            outputColumnNames: _col0
+            Group By Operator
+              aggregations:
+                    expr: count(1)
+              bucketGroup: false
+              keys:
+                    expr: _col0
+                    type: int
+              mode: hash
+              outputColumnNames: _col0, _col1
+              File Output Operator
+                compressed: false
+                GlobalTableId: 0
+                table:
+                    input format: org.apache.hadoop.mapred.SequenceFileInputFormat
+                    output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
+
+  Stage: Stage-2
+    Map Reduce
+      Alias -> Map Operator Tree:
+#### A masked pattern was here ####
+            Reduce Output Operator
+              key expressions:
+                    expr: _col0
+                    type: int
+              sort order: +
+              Map-reduce partition columns:
+                    expr: _col0
+                    type: int
+              tag: -1
+              value expressions:
+                    expr: _col1
+                    type: bigint
+      Reduce Operator Tree:
+        Group By Operator
+          aggregations:
+                expr: count(VALUE._col0)
+          bucketGroup: false
+          keys:
+                expr: KEY._col0
+                type: int
+          mode: mergepartial
+          outputColumnNames: _col0, _col1
+          Select Operator
+            expressions:
+                  expr: _col0
+                  type: int
+                  expr: _col1
+                  type: bigint
+            outputColumnNames: _col0, _col1
+            Select Operator
+              expressions:
+                    expr: _col0
+                    type: int
+                    expr: UDFToInteger(_col1)
+                    type: int
+              outputColumnNames: _col0, _col1
+              File Output Operator
+                compressed: false
+                GlobalTableId: 1
+                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
+                    name: default.dest_co2
+
+  Stage: Stage-0
+    Move Operator
+      tables:
+          replace: true
+          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
+              name: default.dest_co2
+
+  Stage: Stage-3
+    Stats-Aggr Operator
+
+
+PREHOOK: query: INSERT OVERWRITE TABLE dest_co2
+SELECT x.key, count(1) FROM T2 x RIGHT OUTER JOIN T1 y ON (x.key = y.key) GROUP BY x.key
+PREHOOK: type: QUERY
+PREHOOK: Input: default@t1
+PREHOOK: Input: default@t2
+PREHOOK: Output: default@dest_co2
+POSTHOOK: query: INSERT OVERWRITE TABLE dest_co2
+SELECT x.key, count(1) FROM T2 x RIGHT OUTER JOIN T1 y ON (x.key = y.key) GROUP BY x.key
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@t1
+POSTHOOK: Input: default@t2
+POSTHOOK: Output: default@dest_co2
+POSTHOOK: Lineage: dest_co1.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co1.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co1.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co1.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co1.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co1.key SIMPLE [(t1)y.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co1.key SIMPLE [(t2)x.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co1.key SIMPLE [(t1)y.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co1.key SIMPLE [(t1)y.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co1.key SIMPLE [(t2)x.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co2.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co2.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co2.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co2.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co2.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co2.key SIMPLE [(t1)y.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co2.key SIMPLE [(t2)x.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co2.key SIMPLE [(t1)y.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co2.key SIMPLE [(t1)y.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co2.key SIMPLE [(t2)x.FieldSchema(name:key, type:int, comment:null), ]
+PREHOOK: query: -- dest_co1 and dest_co2 should be same
+SELECT * FROM dest_co1 x ORDER BY x.key, x.cnt
+PREHOOK: type: QUERY
+PREHOOK: Input: default@dest_co1
+#### A masked pattern was here ####
+POSTHOOK: query: -- dest_co1 and dest_co2 should be same
+SELECT * FROM dest_co1 x ORDER BY x.key, x.cnt
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@dest_co1
+#### A masked pattern was here ####
+POSTHOOK: Lineage: dest_co1.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co1.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co1.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co1.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co1.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co1.key SIMPLE [(t1)y.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co1.key SIMPLE [(t2)x.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co1.key SIMPLE [(t1)y.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co1.key SIMPLE [(t1)y.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co1.key SIMPLE [(t2)x.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co2.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co2.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co2.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co2.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co2.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co2.key SIMPLE [(t1)y.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co2.key SIMPLE [(t2)x.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co2.key SIMPLE [(t1)y.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co2.key SIMPLE [(t1)y.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co2.key SIMPLE [(t2)x.FieldSchema(name:key, type:int, comment:null), ]
+NULL	2
+2	1
+3	1
+8	4
+PREHOOK: query: SELECT * FROM dest_co2 x ORDER BY x.key, x.cnt
+PREHOOK: type: QUERY
+PREHOOK: Input: default@dest_co2
+#### A masked pattern was here ####
+POSTHOOK: query: SELECT * FROM dest_co2 x ORDER BY x.key, x.cnt
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@dest_co2
+#### A masked pattern was here ####
+POSTHOOK: Lineage: dest_co1.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co1.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co1.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co1.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co1.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co1.key SIMPLE [(t1)y.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co1.key SIMPLE [(t2)x.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co1.key SIMPLE [(t1)y.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co1.key SIMPLE [(t1)y.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co1.key SIMPLE [(t2)x.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co2.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co2.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co2.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co2.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co2.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co2.key SIMPLE [(t1)y.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co2.key SIMPLE [(t2)x.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co2.key SIMPLE [(t1)y.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co2.key SIMPLE [(t1)y.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co2.key SIMPLE [(t2)x.FieldSchema(name:key, type:int, comment:null), ]
+NULL	2
+2	1
+3	1
+8	4
+PREHOOK: query: -- FULL OUTER JOIN will not be optimized
+EXPLAIN
+INSERT OVERWRITE TABLE dest_co1
+SELECT x.key, count(1) FROM T2 x FULL OUTER JOIN T1 y ON (x.key = y.key) GROUP BY x.key
+PREHOOK: type: QUERY
+POSTHOOK: query: -- FULL OUTER JOIN will not be optimized
+EXPLAIN
+INSERT OVERWRITE TABLE dest_co1
+SELECT x.key, count(1) FROM T2 x FULL OUTER JOIN T1 y ON (x.key = y.key) GROUP BY x.key
+POSTHOOK: type: QUERY
+POSTHOOK: Lineage: dest_co1.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co1.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co1.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co1.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co1.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co1.key SIMPLE [(t1)y.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co1.key SIMPLE [(t2)x.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co1.key SIMPLE [(t1)y.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co1.key SIMPLE [(t1)y.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co1.key SIMPLE [(t2)x.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co2.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co2.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co2.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co2.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co2.cnt EXPRESSION [(t2)x.null, (t1)y.null, ]
+POSTHOOK: Lineage: dest_co2.key SIMPLE [(t1)y.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co2.key SIMPLE [(t2)x.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co2.key SIMPLE [(t1)y.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co2.key SIMPLE [(t1)y.FieldSchema(name:key, type:int, comment:null), ]
+POSTHOOK: Lineage: dest_co2.key SIMPLE [(t2)x.FieldSchema(name:key, type:int, comment:null), ]
+ABSTRACT SYNTAX TREE:

[... 444 lines stripped ...]


Mime
View raw message