You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by he...@apache.org on 2012/09/30 22:41:03 UTC

svn commit: r1392105 [4/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...

Added: hive/trunk/ql/src/test/results/clientpositive/correlationoptimizer2.q.out
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/results/clientpositive/correlationoptimizer2.q.out?rev=1392105&view=auto
==============================================================================
--- hive/trunk/ql/src/test/results/clientpositive/correlationoptimizer2.q.out (added)
+++ hive/trunk/ql/src/test/results/clientpositive/correlationoptimizer2.q.out Sun Sep 30 20:41:01 2012
@@ -0,0 +1,601 @@
+PREHOOK: query: -- the query is modified from join18.q
+
+CREATE TABLE dest_co1(key1 INT, cnt1 INT, key2 INT, cnt2 INT)
+PREHOOK: type: CREATETABLE
+POSTHOOK: query: -- the query is modified from join18.q
+
+CREATE TABLE dest_co1(key1 INT, cnt1 INT, key2 INT, cnt2 INT)
+POSTHOOK: type: CREATETABLE
+POSTHOOK: Output: default@dest_co1
+PREHOOK: query: CREATE TABLE dest_co2(key1 INT, cnt1 INT, key2 INT, cnt2 INT)
+PREHOOK: type: CREATETABLE
+POSTHOOK: query: CREATE TABLE dest_co2(key1 INT, cnt1 INT, key2 INT, cnt2 INT)
+POSTHOOK: type: CREATETABLE
+POSTHOOK: Output: default@dest_co2
+PREHOOK: query: EXPLAIN
+INSERT OVERWRITE TABLE dest_co1
+SELECT a.key, a.cnt, b.key, b.cnt
+FROM
+(SELECT x.key as key, count(x.value) AS cnt FROM src x group by x.key) a
+JOIN
+(SELECT y.key as key, count(y.value) AS cnt FROM src1 y group by y.key) b
+ON (a.key = b.key)
+PREHOOK: type: QUERY
+POSTHOOK: query: EXPLAIN
+INSERT OVERWRITE TABLE dest_co1
+SELECT a.key, a.cnt, b.key, b.cnt
+FROM
+(SELECT x.key as key, count(x.value) AS cnt FROM src x group by x.key) a
+JOIN
+(SELECT y.key as key, count(y.value) AS cnt FROM src1 y group by y.key) b
+ON (a.key = b.key)
+POSTHOOK: type: QUERY
+ABSTRACT SYNTAX TREE:
+  (TOK_QUERY (TOK_FROM (TOK_JOIN (TOK_SUBQUERY (TOK_QUERY (TOK_FROM (TOK_TABREF (TOK_TABNAME src) x)) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR (. (TOK_TABLE_OR_COL x) key) key) (TOK_SELEXPR (TOK_FUNCTION count (. (TOK_TABLE_OR_COL x) value)) cnt)) (TOK_GROUPBY (. (TOK_TABLE_OR_COL x) key)))) a) (TOK_SUBQUERY (TOK_QUERY (TOK_FROM (TOK_TABREF (TOK_TABNAME src1) y)) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR (. (TOK_TABLE_OR_COL y) key) key) (TOK_SELEXPR (TOK_FUNCTION count (. (TOK_TABLE_OR_COL y) value)) cnt)) (TOK_GROUPBY (. (TOK_TABLE_OR_COL y) key)))) b) (= (. (TOK_TABLE_OR_COL a) key) (. (TOK_TABLE_OR_COL b) key)))) (TOK_INSERT (TOK_DESTINATION (TOK_TAB (TOK_TABNAME dest_co1))) (TOK_SELECT (TOK_SELEXPR (. (TOK_TABLE_OR_COL a) key)) (TOK_SELEXPR (. (TOK_TABLE_OR_COL a) cnt)) (TOK_SELEXPR (. (TOK_TABLE_OR_COL b) key)) (TOK_SELEXPR (. (TOK_TABLE_OR_COL b) cnt)))))
+
+STAGE DEPENDENCIES:
+  Stage-1 is a root stage
+  Stage-2 depends on stages: Stage-1, Stage-4
+  Stage-0 depends on stages: Stage-2
+  Stage-3 depends on stages: Stage-0
+  Stage-4 is a root stage
+
+STAGE PLANS:
+  Stage: Stage-1
+    Map Reduce
+      Alias -> Map Operator Tree:
+        a:x 
+          TableScan
+            alias: x
+            Select Operator
+              expressions:
+                    expr: key
+                    type: string
+                    expr: value
+                    type: string
+              outputColumnNames: key, value
+              Group By Operator
+                aggregations:
+                      expr: count(value)
+                bucketGroup: false
+                keys:
+                      expr: key
+                      type: string
+                mode: hash
+                outputColumnNames: _col0, _col1
+                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
+      Reduce Operator Tree:
+        Group By Operator
+          aggregations:
+                expr: count(VALUE._col0)
+          bucketGroup: false
+          keys:
+                expr: KEY._col0
+                type: string
+          mode: mergepartial
+          outputColumnNames: _col0, _col1
+          Select Operator
+            expressions:
+                  expr: _col0
+                  type: string
+                  expr: _col1
+                  type: bigint
+            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:
+        $INTNAME 
+            Reduce Output Operator
+              key expressions:
+                    expr: _col0
+                    type: string
+              sort order: +
+              Map-reduce partition columns:
+                    expr: _col0
+                    type: string
+              tag: 0
+              value expressions:
+                    expr: _col0
+                    type: string
+                    expr: _col1
+                    type: bigint
+        $INTNAME1 
+            Reduce Output Operator
+              key expressions:
+                    expr: _col0
+                    type: string
+              sort order: +
+              Map-reduce partition columns:
+                    expr: _col0
+                    type: string
+              tag: 1
+              value expressions:
+                    expr: _col0
+                    type: string
+                    expr: _col1
+                    type: bigint
+      Reduce Operator Tree:
+        Join Operator
+          condition map:
+               Inner Join 0 to 1
+          condition expressions:
+            0 {VALUE._col0} {VALUE._col1}
+            1 {VALUE._col0} {VALUE._col1}
+          handleSkewJoin: false
+          outputColumnNames: _col0, _col1, _col2, _col3
+          Select Operator
+            expressions:
+                  expr: _col0
+                  type: string
+                  expr: _col1
+                  type: bigint
+                  expr: _col2
+                  type: string
+                  expr: _col3
+                  type: bigint
+            outputColumnNames: _col0, _col1, _col2, _col3
+            Select Operator
+              expressions:
+                    expr: UDFToInteger(_col0)
+                    type: int
+                    expr: UDFToInteger(_col1)
+                    type: int
+                    expr: UDFToInteger(_col2)
+                    type: int
+                    expr: UDFToInteger(_col3)
+                    type: int
+              outputColumnNames: _col0, _col1, _col2, _col3
+              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
+
+  Stage: Stage-4
+    Map Reduce
+      Alias -> Map Operator Tree:
+        b:y 
+          TableScan
+            alias: y
+            Select Operator
+              expressions:
+                    expr: key
+                    type: string
+                    expr: value
+                    type: string
+              outputColumnNames: key, value
+              Group By Operator
+                aggregations:
+                      expr: count(value)
+                bucketGroup: false
+                keys:
+                      expr: key
+                      type: string
+                mode: hash
+                outputColumnNames: _col0, _col1
+                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
+      Reduce Operator Tree:
+        Group By Operator
+          aggregations:
+                expr: count(VALUE._col0)
+          bucketGroup: false
+          keys:
+                expr: KEY._col0
+                type: string
+          mode: mergepartial
+          outputColumnNames: _col0, _col1
+          Select Operator
+            expressions:
+                  expr: _col0
+                  type: string
+                  expr: _col1
+                  type: bigint
+            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
+
+
+PREHOOK: query: INSERT OVERWRITE TABLE dest_co1
+SELECT a.key, a.cnt, b.key, b.cnt
+FROM
+(SELECT x.key as key, count(x.value) AS cnt FROM src x group by x.key) a
+JOIN
+(SELECT y.key as key, count(y.value) AS cnt FROM src1 y group by y.key) b
+ON (a.key = b.key)
+PREHOOK: type: QUERY
+PREHOOK: Input: default@src
+PREHOOK: Input: default@src1
+PREHOOK: Output: default@dest_co1
+POSTHOOK: query: INSERT OVERWRITE TABLE dest_co1
+SELECT a.key, a.cnt, b.key, b.cnt
+FROM
+(SELECT x.key as key, count(x.value) AS cnt FROM src x group by x.key) a
+JOIN
+(SELECT y.key as key, count(y.value) AS cnt FROM src1 y group by y.key) b
+ON (a.key = b.key)
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@src
+POSTHOOK: Input: default@src1
+POSTHOOK: Output: default@dest_co1
+POSTHOOK: Lineage: dest_co1.cnt1 EXPRESSION [(src)x.FieldSchema(name:value, type:string, comment:default), ]
+POSTHOOK: Lineage: dest_co1.cnt2 EXPRESSION [(src1)y.FieldSchema(name:value, type:string, comment:default), ]
+POSTHOOK: Lineage: dest_co1.key1 EXPRESSION [(src)x.FieldSchema(name:key, type:string, comment:default), ]
+POSTHOOK: Lineage: dest_co1.key2 EXPRESSION [(src1)y.FieldSchema(name:key, type:string, comment:default), ]
+PREHOOK: query: EXPLAIN
+INSERT OVERWRITE TABLE dest_co2
+SELECT a.key, a.cnt, b.key, b.cnt
+FROM
+(SELECT x.key as key, count(x.value) AS cnt FROM src x group by x.key) a
+JOIN
+(SELECT y.key as key, count(y.value) AS cnt FROM src1 y group by y.key) b
+ON (a.key = b.key)
+PREHOOK: type: QUERY
+POSTHOOK: query: EXPLAIN
+INSERT OVERWRITE TABLE dest_co2
+SELECT a.key, a.cnt, b.key, b.cnt
+FROM
+(SELECT x.key as key, count(x.value) AS cnt FROM src x group by x.key) a
+JOIN
+(SELECT y.key as key, count(y.value) AS cnt FROM src1 y group by y.key) b
+ON (a.key = b.key)
+POSTHOOK: type: QUERY
+POSTHOOK: Lineage: dest_co1.cnt1 EXPRESSION [(src)x.FieldSchema(name:value, type:string, comment:default), ]
+POSTHOOK: Lineage: dest_co1.cnt2 EXPRESSION [(src1)y.FieldSchema(name:value, type:string, comment:default), ]
+POSTHOOK: Lineage: dest_co1.key1 EXPRESSION [(src)x.FieldSchema(name:key, type:string, comment:default), ]
+POSTHOOK: Lineage: dest_co1.key2 EXPRESSION [(src1)y.FieldSchema(name:key, type:string, comment:default), ]
+ABSTRACT SYNTAX TREE:
+  (TOK_QUERY (TOK_FROM (TOK_JOIN (TOK_SUBQUERY (TOK_QUERY (TOK_FROM (TOK_TABREF (TOK_TABNAME src) x)) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR (. (TOK_TABLE_OR_COL x) key) key) (TOK_SELEXPR (TOK_FUNCTION count (. (TOK_TABLE_OR_COL x) value)) cnt)) (TOK_GROUPBY (. (TOK_TABLE_OR_COL x) key)))) a) (TOK_SUBQUERY (TOK_QUERY (TOK_FROM (TOK_TABREF (TOK_TABNAME src1) y)) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR (. (TOK_TABLE_OR_COL y) key) key) (TOK_SELEXPR (TOK_FUNCTION count (. (TOK_TABLE_OR_COL y) value)) cnt)) (TOK_GROUPBY (. (TOK_TABLE_OR_COL y) key)))) b) (= (. (TOK_TABLE_OR_COL a) key) (. (TOK_TABLE_OR_COL b) key)))) (TOK_INSERT (TOK_DESTINATION (TOK_TAB (TOK_TABNAME dest_co2))) (TOK_SELECT (TOK_SELEXPR (. (TOK_TABLE_OR_COL a) key)) (TOK_SELEXPR (. (TOK_TABLE_OR_COL a) cnt)) (TOK_SELEXPR (. (TOK_TABLE_OR_COL b) key)) (TOK_SELEXPR (. (TOK_TABLE_OR_COL b) cnt)))))
+
+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:
+        a:x 
+          TableScan
+            alias: x
+            Select Operator
+              expressions:
+                    expr: value
+                    type: string
+                    expr: key
+                    type: string
+              outputColumnNames: value, key
+              Forward
+                Correlation Composite Operator
+                  Reduce Output Operator
+                    key expressions:
+                          expr: key
+                          type: string
+                    sort order: +
+                    Map-reduce partition columns:
+                          expr: key
+                          type: string
+                    tag: 1
+                    value expressions:
+                          expr: value
+                          type: string
+        b:y 
+          TableScan
+            alias: y
+            Select Operator
+              expressions:
+                    expr: value
+                    type: string
+                    expr: key
+                    type: string
+              outputColumnNames: value, key
+              Forward
+                Correlation Composite Operator
+                  Reduce Output Operator
+                    key expressions:
+                          expr: key
+                          type: string
+                    sort order: +
+                    Map-reduce partition columns:
+                          expr: key
+                          type: string
+                    tag: 0
+                    value expressions:
+                          expr: value
+                          type: string
+      Reduce Operator Tree:
+        Correlation Dispatch Operator
+          Group By Operator
+            aggregations:
+                  expr: count(VALUE._col0)
+            bucketGroup: false
+            keys:
+                  expr: KEY._col0
+                  type: string
+            mode: complete
+            outputColumnNames: _col0, _col1
+            Select Operator
+              expressions:
+                    expr: _col0
+                    type: string
+                    expr: _col1
+                    type: bigint
+              outputColumnNames: _col0, _col1
+              Correlation Local Simulative Reduce Output Operator
+                key expressions:
+                      expr: _col0
+                      type: string
+                sort order: +
+                Map-reduce partition columns:
+                      expr: _col0
+                      type: string
+                tag: 0
+                value expressions:
+                      expr: _col0
+                      type: string
+                      expr: _col1
+                      type: bigint
+                Join Operator
+                  condition map:
+                       Inner Join 0 to 1
+                  condition expressions:
+                    0 {VALUE._col0} {VALUE._col1}
+                    1 {VALUE._col0} {VALUE._col1}
+                  handleSkewJoin: false
+                  outputColumnNames: _col0, _col1, _col2, _col3
+                  Select Operator
+                    expressions:
+                          expr: _col0
+                          type: string
+                          expr: _col1
+                          type: bigint
+                          expr: _col2
+                          type: string
+                          expr: _col3
+                          type: bigint
+                    outputColumnNames: _col0, _col1, _col2, _col3
+                    Select Operator
+                      expressions:
+                            expr: UDFToInteger(_col0)
+                            type: int
+                            expr: UDFToInteger(_col1)
+                            type: int
+                            expr: UDFToInteger(_col2)
+                            type: int
+                            expr: UDFToInteger(_col3)
+                            type: int
+                      outputColumnNames: _col0, _col1, _col2, _col3
+                      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
+          Group By Operator
+            aggregations:
+                  expr: count(VALUE._col0)
+            bucketGroup: false
+            keys:
+                  expr: KEY._col0
+                  type: string
+            mode: complete
+            outputColumnNames: _col0, _col1
+            Select Operator
+              expressions:
+                    expr: _col0
+                    type: string
+                    expr: _col1
+                    type: bigint
+              outputColumnNames: _col0, _col1
+              Correlation Local Simulative Reduce Output Operator
+                key expressions:
+                      expr: _col0
+                      type: string
+                sort order: +
+                Map-reduce partition columns:
+                      expr: _col0
+                      type: string
+                tag: 1
+                value expressions:
+                      expr: _col0
+                      type: string
+                      expr: _col1
+                      type: bigint
+                Join Operator
+                  condition map:
+                       Inner Join 0 to 1
+                  condition expressions:
+                    0 {VALUE._col0} {VALUE._col1}
+                    1 {VALUE._col0} {VALUE._col1}
+                  handleSkewJoin: false
+                  outputColumnNames: _col0, _col1, _col2, _col3
+                  Select Operator
+                    expressions:
+                          expr: _col0
+                          type: string
+                          expr: _col1
+                          type: bigint
+                          expr: _col2
+                          type: string
+                          expr: _col3
+                          type: bigint
+                    outputColumnNames: _col0, _col1, _col2, _col3
+                    Select Operator
+                      expressions:
+                            expr: UDFToInteger(_col0)
+                            type: int
+                            expr: UDFToInteger(_col1)
+                            type: int
+                            expr: UDFToInteger(_col2)
+                            type: int
+                            expr: UDFToInteger(_col3)
+                            type: int
+                      outputColumnNames: _col0, _col1, _col2, _col3
+                      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 a.key, a.cnt, b.key, b.cnt
+FROM
+(SELECT x.key as key, count(x.value) AS cnt FROM src x group by x.key) a
+JOIN
+(SELECT y.key as key, count(y.value) AS cnt FROM src1 y group by y.key) b
+ON (a.key = b.key)
+PREHOOK: type: QUERY
+PREHOOK: Input: default@src
+PREHOOK: Input: default@src1
+PREHOOK: Output: default@dest_co2
+POSTHOOK: query: INSERT OVERWRITE TABLE dest_co2
+SELECT a.key, a.cnt, b.key, b.cnt
+FROM
+(SELECT x.key as key, count(x.value) AS cnt FROM src x group by x.key) a
+JOIN
+(SELECT y.key as key, count(y.value) AS cnt FROM src1 y group by y.key) b
+ON (a.key = b.key)
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@src
+POSTHOOK: Input: default@src1
+POSTHOOK: Output: default@dest_co2
+POSTHOOK: Lineage: dest_co1.cnt1 EXPRESSION [(src)x.FieldSchema(name:value, type:string, comment:default), ]
+POSTHOOK: Lineage: dest_co1.cnt2 EXPRESSION [(src1)y.FieldSchema(name:value, type:string, comment:default), ]
+POSTHOOK: Lineage: dest_co1.key1 EXPRESSION [(src)x.FieldSchema(name:key, type:string, comment:default), ]
+POSTHOOK: Lineage: dest_co1.key2 EXPRESSION [(src1)y.FieldSchema(name:key, type:string, comment:default), ]
+POSTHOOK: Lineage: dest_co2.cnt1 EXPRESSION [(src)x.FieldSchema(name:value, type:string, comment:default), ]
+POSTHOOK: Lineage: dest_co2.cnt2 EXPRESSION [(src1)y.FieldSchema(name:value, type:string, comment:default), ]
+POSTHOOK: Lineage: dest_co2.key1 EXPRESSION [(src)x.FieldSchema(name:key, type:string, comment:default), ]
+POSTHOOK: Lineage: dest_co2.key2 EXPRESSION [(src1)y.FieldSchema(name:key, type:string, comment:default), ]
+PREHOOK: query: -- dest_co1 and dest_co2 should be same
+SELECT * FROM dest_co1 x ORDER BY x.key1, x.key2, x.cnt1, x.cnt2
+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.key1, x.key2, x.cnt1, x.cnt2
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@dest_co1
+#### A masked pattern was here ####
+POSTHOOK: Lineage: dest_co1.cnt1 EXPRESSION [(src)x.FieldSchema(name:value, type:string, comment:default), ]
+POSTHOOK: Lineage: dest_co1.cnt2 EXPRESSION [(src1)y.FieldSchema(name:value, type:string, comment:default), ]
+POSTHOOK: Lineage: dest_co1.key1 EXPRESSION [(src)x.FieldSchema(name:key, type:string, comment:default), ]
+POSTHOOK: Lineage: dest_co1.key2 EXPRESSION [(src1)y.FieldSchema(name:key, type:string, comment:default), ]
+POSTHOOK: Lineage: dest_co2.cnt1 EXPRESSION [(src)x.FieldSchema(name:value, type:string, comment:default), ]
+POSTHOOK: Lineage: dest_co2.cnt2 EXPRESSION [(src1)y.FieldSchema(name:value, type:string, comment:default), ]
+POSTHOOK: Lineage: dest_co2.key1 EXPRESSION [(src)x.FieldSchema(name:key, type:string, comment:default), ]
+POSTHOOK: Lineage: dest_co2.key2 EXPRESSION [(src1)y.FieldSchema(name:key, type:string, comment:default), ]
+66	1	66	1
+98	2	98	1
+128	3	128	1
+146	2	146	1
+150	1	150	1
+213	2	213	1
+224	2	224	1
+238	2	238	1
+255	2	255	1
+273	3	273	1
+278	2	278	1
+311	3	311	1
+369	3	369	1
+401	5	401	1
+406	4	406	1
+PREHOOK: query: SELECT * FROM dest_co2 x ORDER BY x.key1, x.key2, x.cnt1, x.cnt2
+PREHOOK: type: QUERY
+PREHOOK: Input: default@dest_co2
+#### A masked pattern was here ####
+POSTHOOK: query: SELECT * FROM dest_co2 x ORDER BY x.key1, x.key2, x.cnt1, x.cnt2
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@dest_co2
+#### A masked pattern was here ####
+POSTHOOK: Lineage: dest_co1.cnt1 EXPRESSION [(src)x.FieldSchema(name:value, type:string, comment:default), ]
+POSTHOOK: Lineage: dest_co1.cnt2 EXPRESSION [(src1)y.FieldSchema(name:value, type:string, comment:default), ]
+POSTHOOK: Lineage: dest_co1.key1 EXPRESSION [(src)x.FieldSchema(name:key, type:string, comment:default), ]
+POSTHOOK: Lineage: dest_co1.key2 EXPRESSION [(src1)y.FieldSchema(name:key, type:string, comment:default), ]
+POSTHOOK: Lineage: dest_co2.cnt1 EXPRESSION [(src)x.FieldSchema(name:value, type:string, comment:default), ]
+POSTHOOK: Lineage: dest_co2.cnt2 EXPRESSION [(src1)y.FieldSchema(name:value, type:string, comment:default), ]
+POSTHOOK: Lineage: dest_co2.key1 EXPRESSION [(src)x.FieldSchema(name:key, type:string, comment:default), ]
+POSTHOOK: Lineage: dest_co2.key2 EXPRESSION [(src1)y.FieldSchema(name:key, type:string, comment:default), ]
+66	1	66	1
+98	2	98	1
+128	3	128	1
+146	2	146	1
+150	1	150	1
+213	2	213	1
+224	2	224	1
+238	2	238	1
+255	2	255	1
+273	3	273	1
+278	2	278	1
+311	3	311	1
+369	3	369	1
+401	5	401	1
+406	4	406	1

Added: hive/trunk/ql/src/test/results/clientpositive/correlationoptimizer3.q.out
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/results/clientpositive/correlationoptimizer3.q.out?rev=1392105&view=auto
==============================================================================
--- hive/trunk/ql/src/test/results/clientpositive/correlationoptimizer3.q.out (added)
+++ hive/trunk/ql/src/test/results/clientpositive/correlationoptimizer3.q.out Sun Sep 30 20:41:01 2012
@@ -0,0 +1,705 @@
+PREHOOK: query: CREATE TABLE dest_co1(key INT, cnt INT, value STRING)
+PREHOOK: type: CREATETABLE
+POSTHOOK: query: CREATE TABLE dest_co1(key INT, cnt INT, value STRING)
+POSTHOOK: type: CREATETABLE
+POSTHOOK: Output: default@dest_co1
+PREHOOK: query: CREATE TABLE dest_co2(key INT, cnt INT, value STRING)
+PREHOOK: type: CREATETABLE
+POSTHOOK: query: CREATE TABLE dest_co2(key INT, cnt INT, value STRING)
+POSTHOOK: type: CREATETABLE
+POSTHOOK: Output: default@dest_co2
+PREHOOK: query: EXPLAIN
+INSERT OVERWRITE TABLE dest_co1
+SELECT b.key, b.cnt, d.value
+FROM
+(SELECT x.key, count(1) AS cnt FROM src1 x JOIN src y ON (x.key = y.key) group by x.key) b
+JOIN
+(SELECT x.key, x.value FROM src1 x JOIN src y ON (x.key = y.key)) d
+ON b.key = d.key
+PREHOOK: type: QUERY
+POSTHOOK: query: EXPLAIN
+INSERT OVERWRITE TABLE dest_co1
+SELECT b.key, b.cnt, d.value
+FROM
+(SELECT x.key, count(1) AS cnt FROM src1 x JOIN src y ON (x.key = y.key) group by x.key) b
+JOIN
+(SELECT x.key, x.value FROM src1 x JOIN src y ON (x.key = y.key)) d
+ON b.key = d.key
+POSTHOOK: type: QUERY
+ABSTRACT SYNTAX TREE:
+  (TOK_QUERY (TOK_FROM (TOK_JOIN (TOK_SUBQUERY (TOK_QUERY (TOK_FROM (TOK_JOIN (TOK_TABREF (TOK_TABNAME src1) x) (TOK_TABREF (TOK_TABNAME src) y) (= (. (TOK_TABLE_OR_COL x) key) (. (TOK_TABLE_OR_COL y) key)))) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR (. (TOK_TABLE_OR_COL x) key)) (TOK_SELEXPR (TOK_FUNCTION count 1) cnt)) (TOK_GROUPBY (. (TOK_TABLE_OR_COL x) key)))) b) (TOK_SUBQUERY (TOK_QUERY (TOK_FROM (TOK_JOIN (TOK_TABREF (TOK_TABNAME src1) x) (TOK_TABREF (TOK_TABNAME src) y) (= (. (TOK_TABLE_OR_COL x) key) (. (TOK_TABLE_OR_COL y) key)))) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR (. (TOK_TABLE_OR_COL x) key)) (TOK_SELEXPR (. (TOK_TABLE_OR_COL x) value))))) d) (= (. (TOK_TABLE_OR_COL b) key) (. (TOK_TABLE_OR_COL d) key)))) (TOK_INSERT (TOK_DESTINATION (TOK_TAB (TOK_TABNAME dest_co1))) (TOK_SELECT (TOK_SELEXPR (. (TOK_TABLE_OR_COL b) key)) (TOK_SELEXPR (. (TOK_TABLE_OR_COL b) cnt)) (TOK_SELEXPR (. (TOK_T
 ABLE_OR_COL d) value)))))
+
+STAGE DEPENDENCIES:
+  Stage-1 is a root stage
+  Stage-2 depends on stages: Stage-1, Stage-6
+  Stage-0 depends on stages: Stage-2
+  Stage-3 depends on stages: Stage-0
+  Stage-5 is a root stage
+  Stage-6 depends on stages: Stage-5
+
+STAGE PLANS:
+  Stage: Stage-1
+    Map Reduce
+      Alias -> Map Operator Tree:
+        d:x 
+          TableScan
+            alias: x
+            Reduce Output Operator
+              key expressions:
+                    expr: key
+                    type: string
+              sort order: +
+              Map-reduce partition columns:
+                    expr: key
+                    type: string
+              tag: 0
+              value expressions:
+                    expr: key
+                    type: string
+                    expr: value
+                    type: string
+        d:y 
+          TableScan
+            alias: y
+            Reduce Output Operator
+              key expressions:
+                    expr: key
+                    type: string
+              sort order: +
+              Map-reduce partition columns:
+                    expr: key
+                    type: string
+              tag: 1
+      Reduce Operator Tree:
+        Join Operator
+          condition map:
+               Inner Join 0 to 1
+          condition expressions:
+            0 {VALUE._col0} {VALUE._col1}
+            1 
+          handleSkewJoin: false
+          outputColumnNames: _col0, _col1
+          Select Operator
+            expressions:
+                  expr: _col0
+                  type: string
+                  expr: _col1
+                  type: string
+            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:
+        $INTNAME 
+            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: string
+        $INTNAME1 
+            Reduce Output Operator
+              key expressions:
+                    expr: _col0
+                    type: string
+              sort order: +
+              Map-reduce partition columns:
+                    expr: _col0
+                    type: string
+              tag: 0
+              value expressions:
+                    expr: _col0
+                    type: string
+                    expr: _col1
+                    type: bigint
+      Reduce Operator Tree:
+        Join Operator
+          condition map:
+               Inner Join 0 to 1
+          condition expressions:
+            0 {VALUE._col0} {VALUE._col1}
+            1 {VALUE._col1}
+          handleSkewJoin: false
+          outputColumnNames: _col0, _col1, _col3
+          Select Operator
+            expressions:
+                  expr: _col0
+                  type: string
+                  expr: _col1
+                  type: bigint
+                  expr: _col3
+                  type: string
+            outputColumnNames: _col0, _col1, _col2
+            Select Operator
+              expressions:
+                    expr: UDFToInteger(_col0)
+                    type: int
+                    expr: UDFToInteger(_col1)
+                    type: int
+                    expr: _col2
+                    type: string
+              outputColumnNames: _col0, _col1, _col2
+              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
+
+  Stage: Stage-5
+    Map Reduce
+      Alias -> Map Operator Tree:
+        b:x 
+          TableScan
+            alias: x
+            Reduce Output Operator
+              key expressions:
+                    expr: key
+                    type: string
+              sort order: +
+              Map-reduce partition columns:
+                    expr: key
+                    type: string
+              tag: 0
+              value expressions:
+                    expr: key
+                    type: string
+        b:y 
+          TableScan
+            alias: y
+            Reduce Output Operator
+              key expressions:
+                    expr: key
+                    type: string
+              sort order: +
+              Map-reduce partition columns:
+                    expr: key
+                    type: string
+              tag: 1
+      Reduce Operator Tree:
+        Join Operator
+          condition map:
+               Inner Join 0 to 1
+          condition expressions:
+            0 {VALUE._col0}
+            1 
+          handleSkewJoin: false
+          outputColumnNames: _col0
+          Select Operator
+            expressions:
+                  expr: _col0
+                  type: string
+            outputColumnNames: _col0
+            Group By Operator
+              aggregations:
+                    expr: count(1)
+              bucketGroup: false
+              keys:
+                    expr: _col0
+                    type: string
+              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-6
+    Map Reduce
+      Alias -> Map Operator Tree:
+#### A masked pattern was here ####
+            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
+      Reduce Operator Tree:
+        Group By Operator
+          aggregations:
+                expr: count(VALUE._col0)
+          bucketGroup: false
+          keys:
+                expr: KEY._col0
+                type: string
+          mode: mergepartial
+          outputColumnNames: _col0, _col1
+          Select Operator
+            expressions:
+                  expr: _col0
+                  type: string
+                  expr: _col1
+                  type: bigint
+            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
+
+
+PREHOOK: query: INSERT OVERWRITE TABLE dest_co1
+SELECT b.key, b.cnt, d.value
+FROM
+(SELECT x.key, count(1) AS cnt FROM src1 x JOIN src y ON (x.key = y.key) group by x.key) b
+JOIN
+(SELECT x.key, x.value FROM src1 x JOIN src y ON (x.key = y.key)) d
+ON b.key = d.key
+PREHOOK: type: QUERY
+PREHOOK: Input: default@src
+PREHOOK: Input: default@src1
+PREHOOK: Output: default@dest_co1
+POSTHOOK: query: INSERT OVERWRITE TABLE dest_co1
+SELECT b.key, b.cnt, d.value
+FROM
+(SELECT x.key, count(1) AS cnt FROM src1 x JOIN src y ON (x.key = y.key) group by x.key) b
+JOIN
+(SELECT x.key, x.value FROM src1 x JOIN src y ON (x.key = y.key)) d
+ON b.key = d.key
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@src
+POSTHOOK: Input: default@src1
+POSTHOOK: Output: default@dest_co1
+POSTHOOK: Lineage: dest_co1.cnt EXPRESSION [(src1)x.null, (src1)x.null, (src)y.null, ]
+POSTHOOK: Lineage: dest_co1.key EXPRESSION [(src1)x.FieldSchema(name:key, type:string, comment:default), ]
+POSTHOOK: Lineage: dest_co1.value SIMPLE [(src1)x.FieldSchema(name:value, type:string, comment:default), ]
+PREHOOK: query: EXPLAIN
+INSERT OVERWRITE TABLE dest_co2
+SELECT b.key, b.cnt, d.value
+FROM
+(SELECT x.key, count(1) AS cnt FROM src1 x JOIN src y ON (x.key = y.key) group by x.key) b
+JOIN
+(SELECT x.key, x.value FROM src1 x JOIN src y ON (x.key = y.key)) d
+ON b.key = d.key
+PREHOOK: type: QUERY
+POSTHOOK: query: EXPLAIN
+INSERT OVERWRITE TABLE dest_co2
+SELECT b.key, b.cnt, d.value
+FROM
+(SELECT x.key, count(1) AS cnt FROM src1 x JOIN src y ON (x.key = y.key) group by x.key) b
+JOIN
+(SELECT x.key, x.value FROM src1 x JOIN src y ON (x.key = y.key)) d
+ON b.key = d.key
+POSTHOOK: type: QUERY
+POSTHOOK: Lineage: dest_co1.cnt EXPRESSION [(src1)x.null, (src1)x.null, (src)y.null, ]
+POSTHOOK: Lineage: dest_co1.key EXPRESSION [(src1)x.FieldSchema(name:key, type:string, comment:default), ]
+POSTHOOK: Lineage: dest_co1.value SIMPLE [(src1)x.FieldSchema(name:value, type:string, comment:default), ]
+ABSTRACT SYNTAX TREE:
+  (TOK_QUERY (TOK_FROM (TOK_JOIN (TOK_SUBQUERY (TOK_QUERY (TOK_FROM (TOK_JOIN (TOK_TABREF (TOK_TABNAME src1) x) (TOK_TABREF (TOK_TABNAME src) y) (= (. (TOK_TABLE_OR_COL x) key) (. (TOK_TABLE_OR_COL y) key)))) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR (. (TOK_TABLE_OR_COL x) key)) (TOK_SELEXPR (TOK_FUNCTION count 1) cnt)) (TOK_GROUPBY (. (TOK_TABLE_OR_COL x) key)))) b) (TOK_SUBQUERY (TOK_QUERY (TOK_FROM (TOK_JOIN (TOK_TABREF (TOK_TABNAME src1) x) (TOK_TABREF (TOK_TABNAME src) y) (= (. (TOK_TABLE_OR_COL x) key) (. (TOK_TABLE_OR_COL y) key)))) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR (. (TOK_TABLE_OR_COL x) key)) (TOK_SELEXPR (. (TOK_TABLE_OR_COL x) value))))) d) (= (. (TOK_TABLE_OR_COL b) key) (. (TOK_TABLE_OR_COL d) key)))) (TOK_INSERT (TOK_DESTINATION (TOK_TAB (TOK_TABNAME dest_co2))) (TOK_SELECT (TOK_SELEXPR (. (TOK_TABLE_OR_COL b) key)) (TOK_SELEXPR (. (TOK_TABLE_OR_COL b) cnt)) (TOK_SELEXPR (. (TOK_T
 ABLE_OR_COL d) value)))))
+
+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:
+        d:x 
+          TableScan
+            alias: x
+            Select Operator
+              expressions:
+                    expr: key
+                    type: string
+                    expr: value
+                    type: string
+              outputColumnNames: key, value
+              Forward
+                Correlation Composite Operator
+                  Reduce Output Operator
+                    key expressions:
+                          expr: key
+                          type: string
+                    sort order: +
+                    Map-reduce partition columns:
+                          expr: key
+                          type: string
+                    tag: 0
+                    value expressions:
+                          expr: key
+                          type: string
+                          expr: value
+                          type: string
+              Forward
+                Correlation Composite Operator
+                  Reduce Output Operator
+                    key expressions:
+                          expr: key
+                          type: string
+                    sort order: +
+                    Map-reduce partition columns:
+                          expr: key
+                          type: string
+                    tag: 0
+                    value expressions:
+                          expr: key
+                          type: string
+                          expr: value
+                          type: string
+        d:y 
+          TableScan
+            alias: y
+            Select Operator
+              expressions:
+                    expr: key
+                    type: string
+              outputColumnNames: key
+              Forward
+                Correlation Composite Operator
+                  Reduce Output Operator
+                    key expressions:
+                          expr: key
+                          type: string
+                    sort order: +
+                    Map-reduce partition columns:
+                          expr: key
+                          type: string
+                    tag: 1
+              Forward
+                Correlation Composite Operator
+                  Reduce Output Operator
+                    key expressions:
+                          expr: key
+                          type: string
+                    sort order: +
+                    Map-reduce partition columns:
+                          expr: key
+                          type: string
+                    tag: 1
+      Reduce Operator Tree:
+        Correlation Dispatch Operator
+          Join Operator
+            condition map:
+                 Inner Join 0 to 1
+            condition expressions:
+              0 {VALUE._col0}
+              1 
+            handleSkewJoin: false
+            outputColumnNames: _col0
+            Select Operator
+              expressions:
+                    expr: _col0
+                    type: string
+              outputColumnNames: _col0
+              Correlation Local Simulative Reduce Output Operator
+                key expressions:
+                      expr: _col0
+                      type: string
+                sort order: +
+                Map-reduce partition columns:
+                      expr: _col0
+                      type: string
+                tag: -1
+                value expressions:
+                      expr: 1
+                      type: int
+                Group By Operator
+                  aggregations:
+                        expr: count(VALUE._col0)
+                  bucketGroup: false
+                  keys:
+                        expr: KEY._col0
+                        type: string
+                  mode: complete
+                  outputColumnNames: _col0, _col1
+                  Select Operator
+                    expressions:
+                          expr: _col0
+                          type: string
+                          expr: _col1
+                          type: bigint
+                    outputColumnNames: _col0, _col1
+                    Correlation Local Simulative Reduce Output Operator
+                      key expressions:
+                            expr: _col0
+                            type: string
+                      sort order: +
+                      Map-reduce partition columns:
+                            expr: _col0
+                            type: string
+                      tag: 0
+                      value expressions:
+                            expr: _col0
+                            type: string
+                            expr: _col1
+                            type: bigint
+                      Join Operator
+                        condition map:
+                             Inner Join 0 to 1
+                        condition expressions:
+                          0 {VALUE._col0} {VALUE._col1}
+                          1 {VALUE._col1}
+                        handleSkewJoin: false
+                        outputColumnNames: _col0, _col1, _col3
+                        Select Operator
+                          expressions:
+                                expr: _col0
+                                type: string
+                                expr: _col1
+                                type: bigint
+                                expr: _col3
+                                type: string
+                          outputColumnNames: _col0, _col1, _col2
+                          Select Operator
+                            expressions:
+                                  expr: UDFToInteger(_col0)
+                                  type: int
+                                  expr: UDFToInteger(_col1)
+                                  type: int
+                                  expr: _col2
+                                  type: string
+                            outputColumnNames: _col0, _col1, _col2
+                            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
+          Join Operator
+            condition map:
+                 Inner Join 0 to 1
+            condition expressions:
+              0 {VALUE._col0} {VALUE._col1}
+              1 
+            handleSkewJoin: false
+            outputColumnNames: _col0, _col1
+            Select Operator
+              expressions:
+                    expr: _col0
+                    type: string
+                    expr: _col1
+                    type: string
+              outputColumnNames: _col0, _col1
+              Correlation Local Simulative 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: string
+                Join Operator
+                  condition map:
+                       Inner Join 0 to 1
+                  condition expressions:
+                    0 {VALUE._col0} {VALUE._col1}
+                    1 {VALUE._col1}
+                  handleSkewJoin: false
+                  outputColumnNames: _col0, _col1, _col3
+                  Select Operator
+                    expressions:
+                          expr: _col0
+                          type: string
+                          expr: _col1
+                          type: bigint
+                          expr: _col3
+                          type: string
+                    outputColumnNames: _col0, _col1, _col2
+                    Select Operator
+                      expressions:
+                            expr: UDFToInteger(_col0)
+                            type: int
+                            expr: UDFToInteger(_col1)
+                            type: int
+                            expr: _col2
+                            type: string
+                      outputColumnNames: _col0, _col1, _col2
+                      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 b.key, b.cnt, d.value
+FROM
+(SELECT x.key, count(1) AS cnt FROM src1 x JOIN src y ON (x.key = y.key) group by x.key) b
+JOIN
+(SELECT x.key, x.value FROM src1 x JOIN src y ON (x.key = y.key)) d
+ON b.key = d.key
+PREHOOK: type: QUERY
+PREHOOK: Input: default@src
+PREHOOK: Input: default@src1
+PREHOOK: Output: default@dest_co2
+POSTHOOK: query: INSERT OVERWRITE TABLE dest_co2
+SELECT b.key, b.cnt, d.value
+FROM
+(SELECT x.key, count(1) AS cnt FROM src1 x JOIN src y ON (x.key = y.key) group by x.key) b
+JOIN
+(SELECT x.key, x.value FROM src1 x JOIN src y ON (x.key = y.key)) d
+ON b.key = d.key
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@src
+POSTHOOK: Input: default@src1
+POSTHOOK: Output: default@dest_co2
+POSTHOOK: Lineage: dest_co1.cnt EXPRESSION [(src1)x.null, (src1)x.null, (src)y.null, ]
+POSTHOOK: Lineage: dest_co1.key EXPRESSION [(src1)x.FieldSchema(name:key, type:string, comment:default), ]
+POSTHOOK: Lineage: dest_co1.value SIMPLE [(src1)x.FieldSchema(name:value, type:string, comment:default), ]
+POSTHOOK: Lineage: dest_co2.cnt EXPRESSION [(src1)x.null, (src1)x.null, (src)y.null, ]
+POSTHOOK: Lineage: dest_co2.key EXPRESSION [(src1)x.FieldSchema(name:key, type:string, comment:default), ]
+POSTHOOK: Lineage: dest_co2.value SIMPLE [(src1)x.FieldSchema(name:value, type:string, comment:default), ]
+PREHOOK: query: -- dest_co1 and dest_co2 should be same
+SELECT * FROM dest_co1 x ORDER BY x.key, x.cnt, x.value
+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, x.value
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@dest_co1
+#### A masked pattern was here ####
+POSTHOOK: Lineage: dest_co1.cnt EXPRESSION [(src1)x.null, (src1)x.null, (src)y.null, ]
+POSTHOOK: Lineage: dest_co1.key EXPRESSION [(src1)x.FieldSchema(name:key, type:string, comment:default), ]
+POSTHOOK: Lineage: dest_co1.value SIMPLE [(src1)x.FieldSchema(name:value, type:string, comment:default), ]
+POSTHOOK: Lineage: dest_co2.cnt EXPRESSION [(src1)x.null, (src1)x.null, (src)y.null, ]
+POSTHOOK: Lineage: dest_co2.key EXPRESSION [(src1)x.FieldSchema(name:key, type:string, comment:default), ]
+POSTHOOK: Lineage: dest_co2.value SIMPLE [(src1)x.FieldSchema(name:value, type:string, comment:default), ]
+66	1	val_66
+98	2	val_98
+98	2	val_98
+128	3	
+128	3	
+128	3	
+146	2	val_146
+146	2	val_146
+150	1	val_150
+213	2	val_213
+213	2	val_213
+224	2	
+224	2	
+238	2	val_238
+238	2	val_238
+255	2	val_255
+255	2	val_255
+273	3	val_273
+273	3	val_273
+273	3	val_273
+278	2	val_278
+278	2	val_278
+311	3	val_311
+311	3	val_311
+311	3	val_311
+369	3	
+369	3	
+369	3	
+401	5	val_401
+401	5	val_401
+401	5	val_401
+401	5	val_401
+401	5	val_401
+406	4	val_406
+406	4	val_406
+406	4	val_406
+406	4	val_406
+PREHOOK: query: SELECT * FROM dest_co2 x ORDER BY x.key, x.cnt, x.value
+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, x.value
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@dest_co2
+#### A masked pattern was here ####
+POSTHOOK: Lineage: dest_co1.cnt EXPRESSION [(src1)x.null, (src1)x.null, (src)y.null, ]
+POSTHOOK: Lineage: dest_co1.key EXPRESSION [(src1)x.FieldSchema(name:key, type:string, comment:default), ]
+POSTHOOK: Lineage: dest_co1.value SIMPLE [(src1)x.FieldSchema(name:value, type:string, comment:default), ]
+POSTHOOK: Lineage: dest_co2.cnt EXPRESSION [(src1)x.null, (src1)x.null, (src)y.null, ]
+POSTHOOK: Lineage: dest_co2.key EXPRESSION [(src1)x.FieldSchema(name:key, type:string, comment:default), ]
+POSTHOOK: Lineage: dest_co2.value SIMPLE [(src1)x.FieldSchema(name:value, type:string, comment:default), ]
+66	1	val_66
+98	2	val_98
+98	2	val_98
+128	3	
+128	3	
+128	3	
+146	2	val_146
+146	2	val_146
+150	1	val_150
+213	2	val_213
+213	2	val_213
+224	2	
+224	2	
+238	2	val_238
+238	2	val_238
+255	2	val_255
+255	2	val_255
+273	3	val_273
+273	3	val_273
+273	3	val_273
+278	2	val_278
+278	2	val_278
+311	3	val_311
+311	3	val_311
+311	3	val_311
+369	3	
+369	3	
+369	3	
+401	5	val_401
+401	5	val_401
+401	5	val_401
+401	5	val_401
+401	5	val_401
+406	4	val_406
+406	4	val_406
+406	4	val_406
+406	4	val_406