hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hashut...@apache.org
Subject svn commit: r1598678 [7/31] - in /hive/trunk: cli/src/java/org/apache/hadoop/hive/cli/ common/src/java/org/apache/hadoop/hive/common/io/ itests/util/src/main/java/org/apache/hadoop/hive/ql/ ql/src/java/org/apache/hadoop/hive/ql/ ql/src/java/org/apache/...
Date Fri, 30 May 2014 17:37:15 GMT
Modified: hive/trunk/ql/src/test/results/clientpositive/column_access_stats.q.out
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/results/clientpositive/column_access_stats.q.out?rev=1598678&r1=1598677&r2=1598678&view=diff
==============================================================================
--- hive/trunk/ql/src/test/results/clientpositive/column_access_stats.q.out (original)
+++ hive/trunk/ql/src/test/results/clientpositive/column_access_stats.q.out Fri May 30 17:37:05 2014
@@ -1,4 +1,5 @@
-PREHOOK: query: -- This test is used for testing the ColumnAccessAnalyzer
+PREHOOK: query: -- SORT_QUERY_RESULTS
+-- This test is used for testing the ColumnAccessAnalyzer
 
 CREATE TABLE T1(key STRING, val STRING) STORED AS TEXTFILE
 PREHOOK: type: CREATETABLE
@@ -17,7 +18,7 @@ PREHOOK: query: CREATE TABLE T4(key STRI
 PREHOOK: type: CREATETABLE
 PREHOOK: Output: database:default
 PREHOOK: query: -- Simple select queries
-SELECT key FROM T1 ORDER BY key
+SELECT key FROM T1
 PREHOOK: type: QUERY
 PREHOOK: Input: default@t1
 #### A masked pattern was here ####
@@ -30,7 +31,7 @@ Columns:key
 7
 8
 8
-PREHOOK: query: SELECT key, val FROM T1 ORDER BY key, val
+PREHOOK: query: SELECT key, val FROM T1
 PREHOOK: type: QUERY
 PREHOOK: Input: default@t1
 #### A masked pattern was here ####
@@ -75,7 +76,7 @@ Table:default@t4
 Columns:p,val
 
 PREHOOK: query: -- More complicated select queries
-EXPLAIN SELECT key FROM (SELECT key, val FROM T1) subq1 ORDER BY key
+EXPLAIN SELECT key FROM (SELECT key, val FROM T1) subq1
 PREHOOK: type: QUERY
 STAGE DEPENDENCIES:
   Stage-1 is a root stage
@@ -92,21 +93,13 @@ STAGE PLANS:
               expressions: key (type: string)
               outputColumnNames: _col0
               Statistics: Num rows: 0 Data size: 30 Basic stats: PARTIAL Column stats: NONE
-              Reduce Output Operator
-                key expressions: _col0 (type: string)
-                sort order: +
+              File Output Operator
+                compressed: false
                 Statistics: Num rows: 0 Data size: 30 Basic stats: PARTIAL Column stats: NONE
-                value expressions: _col0 (type: string)
-      Reduce Operator Tree:
-        Extract
-          Statistics: Num rows: 0 Data size: 30 Basic stats: PARTIAL Column stats: NONE
-          File Output Operator
-            compressed: false
-            Statistics: Num rows: 0 Data size: 30 Basic stats: PARTIAL Column stats: NONE
-            table:
-                input format: org.apache.hadoop.mapred.TextInputFormat
-                output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
-                serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+                table:
+                    input format: org.apache.hadoop.mapred.TextInputFormat
+                    output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+                    serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
 
   Stage: Stage-0
     Fetch Operator
@@ -114,7 +107,7 @@ STAGE PLANS:
       Processor Tree:
         ListSink
 
-PREHOOK: query: SELECT key FROM (SELECT key, val FROM T1) subq1 ORDER BY key
+PREHOOK: query: SELECT key FROM (SELECT key, val FROM T1) subq1
 PREHOOK: type: QUERY
 PREHOOK: Input: default@t1
 #### A masked pattern was here ####
@@ -127,7 +120,7 @@ Columns:key
 7
 8
 8
-PREHOOK: query: EXPLAIN SELECT k FROM (SELECT key as k, val as v FROM T1) subq1 ORDER BY k
+PREHOOK: query: EXPLAIN SELECT k FROM (SELECT key as k, val as v FROM T1) subq1
 PREHOOK: type: QUERY
 STAGE DEPENDENCIES:
   Stage-1 is a root stage
@@ -144,21 +137,13 @@ STAGE PLANS:
               expressions: key (type: string)
               outputColumnNames: _col0
               Statistics: Num rows: 0 Data size: 30 Basic stats: PARTIAL Column stats: NONE
-              Reduce Output Operator
-                key expressions: _col0 (type: string)
-                sort order: +
+              File Output Operator
+                compressed: false
                 Statistics: Num rows: 0 Data size: 30 Basic stats: PARTIAL Column stats: NONE
-                value expressions: _col0 (type: string)
-      Reduce Operator Tree:
-        Extract
-          Statistics: Num rows: 0 Data size: 30 Basic stats: PARTIAL Column stats: NONE
-          File Output Operator
-            compressed: false
-            Statistics: Num rows: 0 Data size: 30 Basic stats: PARTIAL Column stats: NONE
-            table:
-                input format: org.apache.hadoop.mapred.TextInputFormat
-                output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
-                serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+                table:
+                    input format: org.apache.hadoop.mapred.TextInputFormat
+                    output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+                    serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
 
   Stage: Stage-0
     Fetch Operator
@@ -166,7 +151,7 @@ STAGE PLANS:
       Processor Tree:
         ListSink
 
-PREHOOK: query: SELECT k FROM (SELECT key as k, val as v FROM T1) subq1 ORDER BY k
+PREHOOK: query: SELECT k FROM (SELECT key as k, val as v FROM T1) subq1
 PREHOOK: type: QUERY
 PREHOOK: Input: default@t1
 #### A masked pattern was here ####
@@ -179,7 +164,7 @@ Columns:key
 7
 8
 8
-PREHOOK: query: SELECT key + 1 as k FROM T1 ORDER BY k
+PREHOOK: query: SELECT key + 1 as k FROM T1
 PREHOOK: type: QUERY
 PREHOOK: Input: default@t1
 #### A masked pattern was here ####
@@ -192,7 +177,7 @@ Columns:key
 8.0
 9.0
 9.0
-PREHOOK: query: SELECT key + val as k FROM T1 ORDER BY k
+PREHOOK: query: SELECT key + val as k FROM T1
 PREHOOK: type: QUERY
 PREHOOK: Input: default@t1
 #### A masked pattern was here ####
@@ -211,7 +196,7 @@ SELECT * FROM (
 SELECT key as c FROM T1
  UNION ALL
 SELECT val as c FROM T1
-) subq1 ORDER BY c
+) subq1
 PREHOOK: type: QUERY
 STAGE DEPENDENCIES:
   Stage-1 is a root stage
@@ -234,11 +219,13 @@ STAGE PLANS:
                   expressions: _col0 (type: string)
                   outputColumnNames: _col0
                   Statistics: Num rows: 0 Data size: 60 Basic stats: PARTIAL Column stats: NONE
-                  Reduce Output Operator
-                    key expressions: _col0 (type: string)
-                    sort order: +
+                  File Output Operator
+                    compressed: false
                     Statistics: Num rows: 0 Data size: 60 Basic stats: PARTIAL Column stats: NONE
-                    value expressions: _col0 (type: string)
+                    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
           TableScan
             alias: t1
             Statistics: Num rows: 0 Data size: 30 Basic stats: PARTIAL Column stats: NONE
@@ -252,21 +239,13 @@ STAGE PLANS:
                   expressions: _col0 (type: string)
                   outputColumnNames: _col0
                   Statistics: Num rows: 0 Data size: 60 Basic stats: PARTIAL Column stats: NONE
-                  Reduce Output Operator
-                    key expressions: _col0 (type: string)
-                    sort order: +
+                  File Output Operator
+                    compressed: false
                     Statistics: Num rows: 0 Data size: 60 Basic stats: PARTIAL Column stats: NONE
-                    value expressions: _col0 (type: string)
-      Reduce Operator Tree:
-        Extract
-          Statistics: Num rows: 0 Data size: 60 Basic stats: PARTIAL Column stats: NONE
-          File Output Operator
-            compressed: false
-            Statistics: Num rows: 0 Data size: 60 Basic stats: PARTIAL Column stats: NONE
-            table:
-                input format: org.apache.hadoop.mapred.TextInputFormat
-                output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
-                serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+                    table:
+                        input format: org.apache.hadoop.mapred.TextInputFormat
+                        output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+                        serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
 
   Stage: Stage-0
     Fetch Operator
@@ -278,7 +257,7 @@ PREHOOK: query: SELECT * FROM (
 SELECT key as c FROM T1
  UNION ALL
 SELECT val as c FROM T1
-) subq1 ORDER BY c
+) subq1
 PREHOOK: type: QUERY
 PREHOOK: Input: default@t1
 #### A masked pattern was here ####
@@ -302,7 +281,7 @@ SELECT * FROM (
 SELECT key as c FROM T1
  UNION ALL
 SELECT key as c FROM T1
-) subq1 ORDER BY c
+) subq1
 PREHOOK: type: QUERY
 STAGE DEPENDENCIES:
   Stage-1 is a root stage
@@ -325,11 +304,13 @@ STAGE PLANS:
                   expressions: _col0 (type: string)
                   outputColumnNames: _col0
                   Statistics: Num rows: 0 Data size: 60 Basic stats: PARTIAL Column stats: NONE
-                  Reduce Output Operator
-                    key expressions: _col0 (type: string)
-                    sort order: +
+                  File Output Operator
+                    compressed: false
                     Statistics: Num rows: 0 Data size: 60 Basic stats: PARTIAL Column stats: NONE
-                    value expressions: _col0 (type: string)
+                    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
           TableScan
             alias: t1
             Statistics: Num rows: 0 Data size: 30 Basic stats: PARTIAL Column stats: NONE
@@ -343,21 +324,13 @@ STAGE PLANS:
                   expressions: _col0 (type: string)
                   outputColumnNames: _col0
                   Statistics: Num rows: 0 Data size: 60 Basic stats: PARTIAL Column stats: NONE
-                  Reduce Output Operator
-                    key expressions: _col0 (type: string)
-                    sort order: +
+                  File Output Operator
+                    compressed: false
                     Statistics: Num rows: 0 Data size: 60 Basic stats: PARTIAL Column stats: NONE
-                    value expressions: _col0 (type: string)
-      Reduce Operator Tree:
-        Extract
-          Statistics: Num rows: 0 Data size: 60 Basic stats: PARTIAL Column stats: NONE
-          File Output Operator
-            compressed: false
-            Statistics: Num rows: 0 Data size: 60 Basic stats: PARTIAL Column stats: NONE
-            table:
-                input format: org.apache.hadoop.mapred.TextInputFormat
-                output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
-                serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+                    table:
+                        input format: org.apache.hadoop.mapred.TextInputFormat
+                        output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+                        serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
 
   Stage: Stage-0
     Fetch Operator
@@ -369,7 +342,7 @@ PREHOOK: query: SELECT * FROM (
 SELECT key as c FROM T1
  UNION ALL
 SELECT key as c FROM T1
-) subq1 ORDER BY c
+) subq1
 PREHOOK: type: QUERY
 PREHOOK: Input: default@t1
 #### A masked pattern was here ####
@@ -403,7 +376,6 @@ PREHOOK: query: -- Simple joins
 SELECT *
 FROM T1 JOIN T2
 ON T1.key = T2.key
-ORDER BY T1.key, T1.val, T2.key, T2.val
 PREHOOK: type: QUERY
 PREHOOK: Input: default@t1
 PREHOOK: Input: default@t2
@@ -424,12 +396,10 @@ PREHOOK: query: EXPLAIN
 SELECT T1.key
 FROM T1 JOIN T2
 ON T1.key = T2.key
-ORDER BY T1.key
 PREHOOK: type: QUERY
 STAGE DEPENDENCIES:
   Stage-1 is a root stage
-  Stage-2 depends on stages: Stage-1
-  Stage-0 depends on stages: Stage-2
+  Stage-0 depends on stages: Stage-1
 
 STAGE PLANS:
   Stage: Stage-1
@@ -467,30 +437,11 @@ STAGE PLANS:
             Statistics: Num rows: 5 Data size: 16 Basic stats: COMPLETE Column stats: NONE
             File Output Operator
               compressed: false
-              table:
-                  input format: org.apache.hadoop.mapred.SequenceFileInputFormat
-                  output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
-                  serde: org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe
-
-  Stage: Stage-2
-    Map Reduce
-      Map Operator Tree:
-          TableScan
-            Reduce Output Operator
-              key expressions: _col0 (type: string)
-              sort order: +
               Statistics: Num rows: 5 Data size: 16 Basic stats: COMPLETE Column stats: NONE
-              value expressions: _col0 (type: string)
-      Reduce Operator Tree:
-        Extract
-          Statistics: Num rows: 5 Data size: 16 Basic stats: COMPLETE Column stats: NONE
-          File Output Operator
-            compressed: false
-            Statistics: Num rows: 5 Data size: 16 Basic stats: COMPLETE Column stats: NONE
-            table:
-                input format: org.apache.hadoop.mapred.TextInputFormat
-                output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
-                serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+              table:
+                  input format: org.apache.hadoop.mapred.TextInputFormat
+                  output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+                  serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
 
   Stage: Stage-0
     Fetch Operator
@@ -501,7 +452,6 @@ STAGE PLANS:
 PREHOOK: query: SELECT T1.key
 FROM T1 JOIN T2
 ON T1.key = T2.key
-ORDER BY T1.key
 PREHOOK: type: QUERY
 PREHOOK: Input: default@t1
 PREHOOK: Input: default@t2
@@ -521,7 +471,6 @@ Columns:key
 PREHOOK: query: SELECT *
 FROM T1 JOIN T2
 ON T1.key = T2.key AND T1.val = T2.val
-ORDER BY T1.key, T1.val
 PREHOOK: type: QUERY
 PREHOOK: Input: default@t1
 PREHOOK: Input: default@t2
@@ -536,7 +485,6 @@ PREHOOK: query: -- Map join
 SELECT /*+ MAPJOIN(a) */ * 
 FROM T1 a JOIN T2 b 
 ON a.key = b.key
-ORDER BY a.key, a.val, b.key, b.val
 PREHOOK: type: QUERY
 PREHOOK: Input: default@t1
 PREHOOK: Input: default@t2
@@ -558,12 +506,10 @@ EXPLAIN
 SELECT *
 FROM T1 JOIN T2
 ON T1.key = T2.key AND T1.val = 3 and T2.val = 3
-ORDER BY T1.key, T1.val
 PREHOOK: type: QUERY
 STAGE DEPENDENCIES:
   Stage-1 is a root stage
-  Stage-2 depends on stages: Stage-1
-  Stage-0 depends on stages: Stage-2
+  Stage-0 depends on stages: Stage-1
 
 STAGE PLANS:
   Stage: Stage-1
@@ -608,30 +554,11 @@ STAGE PLANS:
             Statistics: Num rows: 2 Data size: 6 Basic stats: COMPLETE Column stats: NONE
             File Output Operator
               compressed: false
-              table:
-                  input format: org.apache.hadoop.mapred.SequenceFileInputFormat
-                  output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
-                  serde: org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe
-
-  Stage: Stage-2
-    Map Reduce
-      Map Operator Tree:
-          TableScan
-            Reduce Output Operator
-              key expressions: _col0 (type: string), _col1 (type: string)
-              sort order: ++
               Statistics: Num rows: 2 Data size: 6 Basic stats: COMPLETE Column stats: NONE
-              value expressions: _col0 (type: string), _col1 (type: string), _col2 (type: string), _col3 (type: string)
-      Reduce Operator Tree:
-        Extract
-          Statistics: Num rows: 2 Data size: 6 Basic stats: COMPLETE Column stats: NONE
-          File Output Operator
-            compressed: false
-            Statistics: Num rows: 2 Data size: 6 Basic stats: COMPLETE Column stats: NONE
-            table:
-                input format: org.apache.hadoop.mapred.TextInputFormat
-                output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
-                serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+              table:
+                  input format: org.apache.hadoop.mapred.TextInputFormat
+                  output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+                  serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
 
   Stage: Stage-0
     Fetch Operator
@@ -642,7 +569,6 @@ STAGE PLANS:
 PREHOOK: query: SELECT *
 FROM T1 JOIN T2
 ON T1.key = T2.key AND T1.val = 3 and T2.val = 3
-ORDER BY T1.key, T1.val
 PREHOOK: type: QUERY
 PREHOOK: Input: default@t1
 PREHOOK: Input: default@t2
@@ -664,12 +590,10 @@ JOIN 
   SELECT val FROM T2 WHERE key = 6
 ) subq2 
 ON subq1.val = subq2.val
-ORDER BY subq1.val
 PREHOOK: type: QUERY
 STAGE DEPENDENCIES:
   Stage-1 is a root stage
-  Stage-2 depends on stages: Stage-1
-  Stage-0 depends on stages: Stage-2
+  Stage-0 depends on stages: Stage-1
 
 STAGE PLANS:
   Stage: Stage-1
@@ -721,30 +645,11 @@ STAGE PLANS:
             Statistics: Num rows: 2 Data size: 6 Basic stats: COMPLETE Column stats: NONE
             File Output Operator
               compressed: false
-              table:
-                  input format: org.apache.hadoop.mapred.SequenceFileInputFormat
-                  output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
-                  serde: org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe
-
-  Stage: Stage-2
-    Map Reduce
-      Map Operator Tree:
-          TableScan
-            Reduce Output Operator
-              key expressions: _col0 (type: string)
-              sort order: +
               Statistics: Num rows: 2 Data size: 6 Basic stats: COMPLETE Column stats: NONE
-              value expressions: _col0 (type: string)
-      Reduce Operator Tree:
-        Extract
-          Statistics: Num rows: 2 Data size: 6 Basic stats: COMPLETE Column stats: NONE
-          File Output Operator
-            compressed: false
-            Statistics: Num rows: 2 Data size: 6 Basic stats: COMPLETE Column stats: NONE
-            table:
-                input format: org.apache.hadoop.mapred.TextInputFormat
-                output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
-                serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+              table:
+                  input format: org.apache.hadoop.mapred.TextInputFormat
+                  output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+                  serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
 
   Stage: Stage-0
     Fetch Operator
@@ -762,7 +667,6 @@ JOIN 
   SELECT val FROM T2 WHERE key = 6
 ) subq2 
 ON subq1.val = subq2.val
-ORDER BY subq1.val
 PREHOOK: type: QUERY
 PREHOOK: Input: default@t1
 PREHOOK: Input: default@t2
@@ -791,16 +695,14 @@ FROM
 ) T4
 JOIN T3
 ON T3.key = T4.key
-ORDER BY T3.key, T4.key
 PREHOOK: type: QUERY
 STAGE DEPENDENCIES:
-  Stage-3 is a root stage
-  Stage-1 depends on stages: Stage-3
-  Stage-2 depends on stages: Stage-1
-  Stage-0 depends on stages: Stage-2
+  Stage-2 is a root stage
+  Stage-1 depends on stages: Stage-2
+  Stage-0 depends on stages: Stage-1
 
 STAGE PLANS:
-  Stage: Stage-3
+  Stage: Stage-2
     Map Reduce
       Map Operator Tree:
           TableScan
@@ -882,30 +784,11 @@ STAGE PLANS:
             Statistics: Num rows: 5 Data size: 17 Basic stats: COMPLETE Column stats: NONE
             File Output Operator
               compressed: false
-              table:
-                  input format: org.apache.hadoop.mapred.SequenceFileInputFormat
-                  output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
-                  serde: org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe
-
-  Stage: Stage-2
-    Map Reduce
-      Map Operator Tree:
-          TableScan
-            Reduce Output Operator
-              key expressions: _col1 (type: string), _col0 (type: string)
-              sort order: ++
               Statistics: Num rows: 5 Data size: 17 Basic stats: COMPLETE Column stats: NONE
-              value expressions: _col0 (type: string), _col1 (type: string), _col2 (type: string)
-      Reduce Operator Tree:
-        Extract
-          Statistics: Num rows: 5 Data size: 17 Basic stats: COMPLETE Column stats: NONE
-          File Output Operator
-            compressed: false
-            Statistics: Num rows: 5 Data size: 17 Basic stats: COMPLETE Column stats: NONE
-            table:
-                input format: org.apache.hadoop.mapred.TextInputFormat
-                output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
-                serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+              table:
+                  input format: org.apache.hadoop.mapred.TextInputFormat
+                  output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+                  serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
 
   Stage: Stage-0
     Fetch Operator
@@ -929,7 +812,6 @@ FROM
 ) T4
 JOIN T3
 ON T3.key = T4.key
-ORDER BY T3.key, T4.key
 PREHOOK: type: QUERY
 PREHOOK: Input: default@t1
 PREHOOK: Input: default@t2
@@ -962,16 +844,16 @@ PREHOOK: Input: default@srcpart@ds=2008-
 Table:default@srcpart
 Columns:ds,hr,key,value
 
-238	val_238	2008-04-08	11
-86	val_86	2008-04-08	11
-311	val_311	2008-04-08	11
-27	val_27	2008-04-08	11
 165	val_165	2008-04-08	11
-409	val_409	2008-04-08	11
+238	val_238	2008-04-08	11
 255	val_255	2008-04-08	11
+27	val_27	2008-04-08	11
 278	val_278	2008-04-08	11
-98	val_98	2008-04-08	11
+311	val_311	2008-04-08	11
+409	val_409	2008-04-08	11
 484	val_484	2008-04-08	11
+86	val_86	2008-04-08	11
+98	val_98	2008-04-08	11
 PREHOOK: query: SELECT key,ds FROM srcpart TABLESAMPLE (10 ROWS) WHERE hr='11'
 PREHOOK: type: QUERY
 PREHOOK: Input: default@srcpart
@@ -981,16 +863,16 @@ PREHOOK: Input: default@srcpart@ds=2008-
 Table:default@srcpart
 Columns:ds,hr,key
 
-238	2008-04-08
-86	2008-04-08
-311	2008-04-08
-27	2008-04-08
 165	2008-04-08
-409	2008-04-08
+238	2008-04-08
 255	2008-04-08
+27	2008-04-08
 278	2008-04-08
-98	2008-04-08
+311	2008-04-08
+409	2008-04-08
 484	2008-04-08
+86	2008-04-08
+98	2008-04-08
 PREHOOK: query: SELECT value FROM srcpart TABLESAMPLE (10 ROWS) WHERE ds='2008-04-08'
 PREHOOK: type: QUERY
 PREHOOK: Input: default@srcpart
@@ -1000,13 +882,13 @@ PREHOOK: Input: default@srcpart@ds=2008-
 Table:default@srcpart
 Columns:ds,value
 
-val_238
-val_86
-val_311
-val_27
 val_165
-val_409
+val_238
 val_255
+val_27
 val_278
-val_98
+val_311
+val_409
 val_484
+val_86
+val_98

Modified: hive/trunk/ql/src/test/results/clientpositive/columnarserde_create_shortcut.q.out
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/results/clientpositive/columnarserde_create_shortcut.q.out?rev=1598678&r1=1598677&r2=1598678&view=diff
==============================================================================
--- hive/trunk/ql/src/test/results/clientpositive/columnarserde_create_shortcut.q.out (original)
+++ hive/trunk/ql/src/test/results/clientpositive/columnarserde_create_shortcut.q.out Fri May 30 17:37:05 2014
@@ -1,7 +1,11 @@
-PREHOOK: query: CREATE TABLE columnarserde_create_shortcut(a array<int>, b array<string>, c map<string,string>, d int, e string) STORED AS RCFILE
+PREHOOK: query: -- SORT_QUERY_RESULTS
+
+CREATE TABLE columnarserde_create_shortcut(a array<int>, b array<string>, c map<string,string>, d int, e string) STORED AS RCFILE
 PREHOOK: type: CREATETABLE
 PREHOOK: Output: database:default
-POSTHOOK: query: CREATE TABLE columnarserde_create_shortcut(a array<int>, b array<string>, c map<string,string>, d int, e string) STORED AS RCFILE
+POSTHOOK: query: -- SORT_QUERY_RESULTS
+
+CREATE TABLE columnarserde_create_shortcut(a array<int>, b array<string>, c map<string,string>, d int, e string) STORED AS RCFILE
 POSTHOOK: type: CREATETABLE
 POSTHOOK: Output: database:default
 POSTHOOK: Output: default@columnarserde_create_shortcut
@@ -82,6 +86,7 @@ POSTHOOK: query: SELECT columnarserde_cr
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@columnarserde_create_shortcut
 #### A masked pattern was here ####
+NULL	NULL	NULL	0	NULL
 [0,0,0]	["0","0","0"]	{"key_0":"value_0"}	1712634731	record_0
 [1,2,3]	["10","100","1000"]	{"key_1":"value_1"}	465985200	record_1
 [2,4,6]	["20","200","2000"]	{"key_2":"value_2"}	-751827638	record_2
@@ -92,7 +97,6 @@ POSTHOOK: Input: default@columnarserde_c
 [7,14,21]	["70","700","7000"]	{"key_7":"value_7"}	-1461153973	record_7
 [8,16,24]	["80","800","8000"]	{"key_8":"value_8"}	1638581578	record_8
 [9,18,27]	["90","900","9000"]	{"key_9":"value_9"}	336964413	record_9
-NULL	NULL	NULL	0	NULL
 PREHOOK: query: SELECT columnarserde_create_shortcut.a[0], columnarserde_create_shortcut.b[0], columnarserde_create_shortcut.c['key2'], columnarserde_create_shortcut.d, columnarserde_create_shortcut.e FROM columnarserde_create_shortcut CLUSTER BY 1
 PREHOOK: type: QUERY
 PREHOOK: Input: default@columnarserde_create_shortcut
@@ -139,11 +143,11 @@ POSTHOOK: type: DESCTABLE
 POSTHOOK: Input: default@columnshortcuttable
 key                 	string              	                    
 value               	string              	                    
-PREHOOK: query: SELECT columnShortcutTable.* FROM columnShortcutTable ORDER BY key ASC, value ASC
+PREHOOK: query: SELECT * FROM columnShortcutTable
 PREHOOK: type: QUERY
 PREHOOK: Input: default@columnshortcuttable
 #### A masked pattern was here ####
-POSTHOOK: query: SELECT columnShortcutTable.* FROM columnShortcutTable ORDER BY key ASC, value ASC
+POSTHOOK: query: SELECT * FROM columnShortcutTable
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@columnshortcuttable
 #### A masked pattern was here ####
@@ -165,11 +169,11 @@ POSTHOOK: query: ALTER TABLE columnShort
 POSTHOOK: type: ALTERTABLE_ADDCOLS
 POSTHOOK: Input: default@columnshortcuttable
 POSTHOOK: Output: default@columnshortcuttable
-PREHOOK: query: SELECT columnShortcutTable.* FROM columnShortcutTable ORDER BY key ASC, value ASC
+PREHOOK: query: SELECT * FROM columnShortcutTable
 PREHOOK: type: QUERY
 PREHOOK: Input: default@columnshortcuttable
 #### A masked pattern was here ####
-POSTHOOK: query: SELECT columnShortcutTable.* FROM columnShortcutTable ORDER BY key ASC, value ASC
+POSTHOOK: query: SELECT * FROM columnShortcutTable
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@columnshortcuttable
 #### A masked pattern was here ####
@@ -191,21 +195,21 @@ POSTHOOK: query: ALTER TABLE columnShort
 POSTHOOK: type: ALTERTABLE_REPLACECOLS
 POSTHOOK: Input: default@columnshortcuttable
 POSTHOOK: Output: default@columnshortcuttable
-PREHOOK: query: SELECT columnShortcutTable.* FROM columnShortcutTable ORDER BY key ASC
+PREHOOK: query: SELECT * FROM columnShortcutTable
 PREHOOK: type: QUERY
 PREHOOK: Input: default@columnshortcuttable
 #### A masked pattern was here ####
-POSTHOOK: query: SELECT columnShortcutTable.* FROM columnShortcutTable ORDER BY key ASC
+POSTHOOK: query: SELECT * FROM columnShortcutTable
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@columnshortcuttable
 #### A masked pattern was here ####
-27
-86
-98
 165
 238
 255
+27
 278
 311
 409
 484
+86
+98

Modified: hive/trunk/ql/src/test/results/clientpositive/combine1.q.out
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/results/clientpositive/combine1.q.out?rev=1598678&r1=1598677&r2=1598678&view=diff
==============================================================================
--- hive/trunk/ql/src/test/results/clientpositive/combine1.q.out (original)
+++ hive/trunk/ql/src/test/results/clientpositive/combine1.q.out Fri May 30 17:37:05 2014
@@ -1,7 +1,11 @@
-PREHOOK: query: create table combine1_1(key string, value string) stored as textfile
+PREHOOK: query: -- SORT_QUERY_RESULTS
+
+create table combine1_1(key string, value string) stored as textfile
 PREHOOK: type: CREATETABLE
 PREHOOK: Output: database:default
-POSTHOOK: query: create table combine1_1(key string, value string) stored as textfile
+POSTHOOK: query: -- SORT_QUERY_RESULTS
+
+create table combine1_1(key string, value string) stored as textfile
 POSTHOOK: type: CREATETABLE
 POSTHOOK: Output: database:default
 POSTHOOK: Output: default@combine1_1
@@ -17,11 +21,11 @@ POSTHOOK: Input: default@src
 POSTHOOK: Output: default@combine1_1
 POSTHOOK: Lineage: combine1_1.key SIMPLE [(src)src.FieldSchema(name:key, type:string, comment:default), ]
 POSTHOOK: Lineage: combine1_1.value SIMPLE [(src)src.FieldSchema(name:value, type:string, comment:default), ]
-PREHOOK: query: select key, value from combine1_1 ORDER BY key ASC, value ASC
+PREHOOK: query: select key, value from combine1_1
 PREHOOK: type: QUERY
 PREHOOK: Input: default@combine1_1
 #### A masked pattern was here ####
-POSTHOOK: query: select key, value from combine1_1 ORDER BY key ASC, value ASC
+POSTHOOK: query: select key, value from combine1_1
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@combine1_1
 #### A masked pattern was here ####

Modified: hive/trunk/ql/src/test/results/clientpositive/combine2.q.out
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/results/clientpositive/combine2.q.out?rev=1598678&r1=1598677&r2=1598678&view=diff
==============================================================================
--- hive/trunk/ql/src/test/results/clientpositive/combine2.q.out (original)
+++ hive/trunk/ql/src/test/results/clientpositive/combine2.q.out Fri May 30 17:37:05 2014
@@ -5,7 +5,7 @@ POSTHOOK: type: SWITCHDATABASE
 PREHOOK: query: -- EXCLUDE_OS_WINDOWS
 -- excluded on windows because of difference in file name encoding logic
 
-
+-- SORT_QUERY_RESULTS
 
 create table combine2(key string) partitioned by (value string)
 PREHOOK: type: CREATETABLE
@@ -13,7 +13,7 @@ PREHOOK: Output: database:default
 POSTHOOK: query: -- EXCLUDE_OS_WINDOWS
 -- excluded on windows because of difference in file name encoding logic
 
-
+-- SORT_QUERY_RESULTS
 
 create table combine2(key string) partitioned by (value string)
 POSTHOOK: type: CREATETABLE
@@ -85,10 +85,10 @@ value=val_8
 value=val_9
 value=|
 PREHOOK: query: explain
-select key, value from combine2 where value is not null order by key
+select key, value from combine2 where value is not null
 PREHOOK: type: QUERY
 POSTHOOK: query: explain
-select key, value from combine2 where value is not null order by key
+select key, value from combine2 where value is not null
 POSTHOOK: type: QUERY
 STAGE DEPENDENCIES:
   Stage-1 is a root stage
@@ -105,21 +105,13 @@ STAGE PLANS:
               expressions: key (type: string), value (type: string)
               outputColumnNames: _col0, _col1
               Statistics: Num rows: 12 Data size: 14 Basic stats: COMPLETE Column stats: NONE
-              Reduce Output Operator
-                key expressions: _col0 (type: string)
-                sort order: +
+              File Output Operator
+                compressed: false
                 Statistics: Num rows: 12 Data size: 14 Basic stats: COMPLETE Column stats: NONE
-                value expressions: _col0 (type: string), _col1 (type: string)
-      Reduce Operator Tree:
-        Extract
-          Statistics: Num rows: 12 Data size: 14 Basic stats: COMPLETE Column stats: NONE
-          File Output Operator
-            compressed: false
-            Statistics: Num rows: 12 Data size: 14 Basic stats: COMPLETE Column stats: NONE
-            table:
-                input format: org.apache.hadoop.mapred.TextInputFormat
-                output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
-                serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+                table:
+                    input format: org.apache.hadoop.mapred.TextInputFormat
+                    output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+                    serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
 
   Stage: Stage-0
     Fetch Operator
@@ -127,7 +119,7 @@ STAGE PLANS:
       Processor Tree:
         ListSink
 
-PREHOOK: query: select key, value from combine2 where value is not null order by key
+PREHOOK: query: select key, value from combine2 where value is not null
 PREHOOK: type: QUERY
 PREHOOK: Input: default@combine2
 PREHOOK: Input: default@combine2@value=2010-04-21 09%3A45%3A00
@@ -139,7 +131,7 @@ PREHOOK: Input: default@combine2@value=v
 PREHOOK: Input: default@combine2@value=val_9
 PREHOOK: Input: default@combine2@value=|
 #### A masked pattern was here ####
-POSTHOOK: query: select key, value from combine2 where value is not null order by key
+POSTHOOK: query: select key, value from combine2 where value is not null
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@combine2
 POSTHOOK: Input: default@combine2@value=2010-04-21 09%3A45%3A00

Modified: hive/trunk/ql/src/test/results/clientpositive/combine2_hadoop20.q.out
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/results/clientpositive/combine2_hadoop20.q.out?rev=1598678&r1=1598677&r2=1598678&view=diff
==============================================================================
--- hive/trunk/ql/src/test/results/clientpositive/combine2_hadoop20.q.out (original)
+++ hive/trunk/ql/src/test/results/clientpositive/combine2_hadoop20.q.out Fri May 30 17:37:05 2014
@@ -5,6 +5,7 @@ POSTHOOK: type: SWITCHDATABASE
 PREHOOK: query: -- EXCLUDE_OS_WINDOWS
 -- excluded on windows because of difference in file name encoding logic
 
+-- SORT_QUERY_RESULTS
 
 create table combine2(key string) partitioned by (value string)
 PREHOOK: type: CREATETABLE
@@ -12,6 +13,7 @@ PREHOOK: Output: database:default
 POSTHOOK: query: -- EXCLUDE_OS_WINDOWS
 -- excluded on windows because of difference in file name encoding logic
 
+-- SORT_QUERY_RESULTS
 
 create table combine2(key string) partitioned by (value string)
 POSTHOOK: type: CREATETABLE
@@ -83,10 +85,10 @@ value=val_8
 value=val_9
 value=|
 PREHOOK: query: explain
-select key, value from combine2 where value is not null order by key
+select key, value from combine2 where value is not null
 PREHOOK: type: QUERY
 POSTHOOK: query: explain
-select key, value from combine2 where value is not null order by key
+select key, value from combine2 where value is not null
 POSTHOOK: type: QUERY
 STAGE DEPENDENCIES:
   Stage-1 is a root stage
@@ -103,21 +105,13 @@ STAGE PLANS:
               expressions: key (type: string), value (type: string)
               outputColumnNames: _col0, _col1
               Statistics: Num rows: 12 Data size: 14 Basic stats: COMPLETE Column stats: NONE
-              Reduce Output Operator
-                key expressions: _col0 (type: string)
-                sort order: +
+              File Output Operator
+                compressed: false
                 Statistics: Num rows: 12 Data size: 14 Basic stats: COMPLETE Column stats: NONE
-                value expressions: _col0 (type: string), _col1 (type: string)
-      Reduce Operator Tree:
-        Extract
-          Statistics: Num rows: 12 Data size: 14 Basic stats: COMPLETE Column stats: NONE
-          File Output Operator
-            compressed: false
-            Statistics: Num rows: 12 Data size: 14 Basic stats: COMPLETE Column stats: NONE
-            table:
-                input format: org.apache.hadoop.mapred.TextInputFormat
-                output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
-                serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+                table:
+                    input format: org.apache.hadoop.mapred.TextInputFormat
+                    output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+                    serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
 
   Stage: Stage-0
     Fetch Operator
@@ -125,7 +119,7 @@ STAGE PLANS:
       Processor Tree:
         ListSink
 
-PREHOOK: query: select key, value from combine2 where value is not null order by key
+PREHOOK: query: select key, value from combine2 where value is not null
 PREHOOK: type: QUERY
 PREHOOK: Input: default@combine2
 PREHOOK: Input: default@combine2@value=2010-04-21 09%3A45%3A00
@@ -137,7 +131,7 @@ PREHOOK: Input: default@combine2@value=v
 PREHOOK: Input: default@combine2@value=val_9
 PREHOOK: Input: default@combine2@value=|
 #### A masked pattern was here ####
-POSTHOOK: query: select key, value from combine2 where value is not null order by key
+POSTHOOK: query: select key, value from combine2 where value is not null
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@combine2
 POSTHOOK: Input: default@combine2@value=2010-04-21 09%3A45%3A00

Modified: hive/trunk/ql/src/test/results/clientpositive/correlationoptimizer10.q.out
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/results/clientpositive/correlationoptimizer10.q.out?rev=1598678&r1=1598677&r2=1598678&view=diff
==============================================================================
--- hive/trunk/ql/src/test/results/clientpositive/correlationoptimizer10.q.out (original)
+++ hive/trunk/ql/src/test/results/clientpositive/correlationoptimizer10.q.out Fri May 30 17:37:05 2014
@@ -5,12 +5,15 @@ PREHOOK: query: -- When Correlation Opti
 -- introduce a GroupByOperator before the ReduceSinkOperator of
 -- the right table (yy in queries below)
 -- of LEFT SEMI JOIN.
+
+-- SORT_AND_HASH_QUERY_RESULTS
+
 EXPLAIN
 SELECT xx.key, xx.cnt
 FROM
 (SELECT x.key as key, count(1) as cnt FROM src1 x JOIN src1 y ON (x.key = y.key) group by x.key) xx
 LEFT SEMI JOIN src yy
-ON xx.key=yy.key ORDER BY xx.key, xx.cnt
+ON xx.key=yy.key
 PREHOOK: type: QUERY
 POSTHOOK: query: -- When Correlation Optimizer is turned off, 4 MR jobs are needed.
 -- When Correlation Optimizer is turned on, 2 MR jobs are needed.
@@ -19,22 +22,24 @@ POSTHOOK: query: -- When Correlation Opt
 -- introduce a GroupByOperator before the ReduceSinkOperator of
 -- the right table (yy in queries below)
 -- of LEFT SEMI JOIN.
+
+-- SORT_AND_HASH_QUERY_RESULTS
+
 EXPLAIN
 SELECT xx.key, xx.cnt
 FROM
 (SELECT x.key as key, count(1) as cnt FROM src1 x JOIN src1 y ON (x.key = y.key) group by x.key) xx
 LEFT SEMI JOIN src yy
-ON xx.key=yy.key ORDER BY xx.key, xx.cnt
+ON xx.key=yy.key
 POSTHOOK: type: QUERY
 STAGE DEPENDENCIES:
-  Stage-3 is a root stage
-  Stage-4 depends on stages: Stage-3
-  Stage-1 depends on stages: Stage-4
-  Stage-2 depends on stages: Stage-1
-  Stage-0 depends on stages: Stage-2
+  Stage-2 is a root stage
+  Stage-3 depends on stages: Stage-2
+  Stage-1 depends on stages: Stage-3
+  Stage-0 depends on stages: Stage-1
 
 STAGE PLANS:
-  Stage: Stage-3
+  Stage: Stage-2
     Map Reduce
       Map Operator Tree:
           TableScan
@@ -80,7 +85,7 @@ STAGE PLANS:
                     output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
                     serde: org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe
 
-  Stage: Stage-4
+  Stage: Stage-3
     Map Reduce
       Map Operator Tree:
           TableScan
@@ -150,30 +155,11 @@ STAGE PLANS:
             Statistics: Num rows: 63 Data size: 6393 Basic stats: COMPLETE Column stats: NONE
             File Output Operator
               compressed: false
-              table:
-                  input format: org.apache.hadoop.mapred.SequenceFileInputFormat
-                  output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
-                  serde: org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe
-
-  Stage: Stage-2
-    Map Reduce
-      Map Operator Tree:
-          TableScan
-            Reduce Output Operator
-              key expressions: _col0 (type: string), _col1 (type: bigint)
-              sort order: ++
               Statistics: Num rows: 63 Data size: 6393 Basic stats: COMPLETE Column stats: NONE
-              value expressions: _col0 (type: string), _col1 (type: bigint)
-      Reduce Operator Tree:
-        Extract
-          Statistics: Num rows: 63 Data size: 6393 Basic stats: COMPLETE Column stats: NONE
-          File Output Operator
-            compressed: false
-            Statistics: Num rows: 63 Data size: 6393 Basic stats: COMPLETE Column stats: NONE
-            table:
-                input format: org.apache.hadoop.mapred.TextInputFormat
-                output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
-                serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+              table:
+                  input format: org.apache.hadoop.mapred.TextInputFormat
+                  output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+                  serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
 
   Stage: Stage-0
     Fetch Operator
@@ -185,7 +171,7 @@ PREHOOK: query: SELECT xx.key, xx.cnt
 FROM
 (SELECT x.key as key, count(1) as cnt FROM src1 x JOIN src1 y ON (x.key = y.key) group by x.key) xx
 LEFT SEMI JOIN src yy
-ON xx.key=yy.key ORDER BY xx.key, xx.cnt
+ON xx.key=yy.key
 PREHOOK: type: QUERY
 PREHOOK: Input: default@src
 PREHOOK: Input: default@src1
@@ -194,7 +180,7 @@ POSTHOOK: query: SELECT xx.key, xx.cnt
 FROM
 (SELECT x.key as key, count(1) as cnt FROM src1 x JOIN src1 y ON (x.key = y.key) group by x.key) xx
 LEFT SEMI JOIN src yy
-ON xx.key=yy.key ORDER BY xx.key, xx.cnt
+ON xx.key=yy.key
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@src
 POSTHOOK: Input: default@src1
@@ -214,24 +200,24 @@ POSTHOOK: Input: default@src1
 406	1
 66	1
 98	1
+XifREjIWNTdZii76gCxhIQ==
 PREHOOK: query: EXPLAIN
 SELECT xx.key, xx.cnt
 FROM
 (SELECT x.key as key, count(1) as cnt FROM src1 x JOIN src1 y ON (x.key = y.key) group by x.key) xx
 LEFT SEMI JOIN src yy
-ON xx.key=yy.key ORDER BY xx.key, xx.cnt
+ON xx.key=yy.key
 PREHOOK: type: QUERY
 POSTHOOK: query: EXPLAIN
 SELECT xx.key, xx.cnt
 FROM
 (SELECT x.key as key, count(1) as cnt FROM src1 x JOIN src1 y ON (x.key = y.key) group by x.key) xx
 LEFT SEMI JOIN src yy
-ON xx.key=yy.key ORDER BY xx.key, xx.cnt
+ON xx.key=yy.key
 POSTHOOK: type: QUERY
 STAGE DEPENDENCIES:
   Stage-1 is a root stage
-  Stage-2 depends on stages: Stage-1
-  Stage-0 depends on stages: Stage-2
+  Stage-0 depends on stages: Stage-1
 
 STAGE PLANS:
   Stage: Stage-1
@@ -314,10 +300,11 @@ STAGE PLANS:
                           Statistics: Num rows: 0 Data size: 0 Basic stats: NONE Column stats: NONE
                           File Output Operator
                             compressed: false
+                            Statistics: Num rows: 0 Data size: 0 Basic stats: NONE Column stats: NONE
                             table:
-                                input format: org.apache.hadoop.mapred.SequenceFileInputFormat
-                                output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
-                                serde: org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe
+                                input format: org.apache.hadoop.mapred.TextInputFormat
+                                output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+                                serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
           Mux Operator
             Statistics: Num rows: 62 Data size: 6244 Basic stats: COMPLETE Column stats: NONE
             Join Operator
@@ -334,30 +321,11 @@ STAGE PLANS:
                 Statistics: Num rows: 0 Data size: 0 Basic stats: NONE Column stats: NONE
                 File Output Operator
                   compressed: false
+                  Statistics: Num rows: 0 Data size: 0 Basic stats: NONE Column stats: NONE
                   table:
-                      input format: org.apache.hadoop.mapred.SequenceFileInputFormat
-                      output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
-                      serde: org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe
-
-  Stage: Stage-2
-    Map Reduce
-      Map Operator Tree:
-          TableScan
-            Reduce Output Operator
-              key expressions: _col0 (type: string), _col1 (type: bigint)
-              sort order: ++
-              Statistics: Num rows: 0 Data size: 0 Basic stats: NONE Column stats: NONE
-              value expressions: _col0 (type: string), _col1 (type: bigint)
-      Reduce Operator Tree:
-        Extract
-          Statistics: Num rows: 0 Data size: 0 Basic stats: NONE Column stats: NONE
-          File Output Operator
-            compressed: false
-            Statistics: Num rows: 0 Data size: 0 Basic stats: NONE Column stats: NONE
-            table:
-                input format: org.apache.hadoop.mapred.TextInputFormat
-                output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
-                serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+                      input format: org.apache.hadoop.mapred.TextInputFormat
+                      output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+                      serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
 
   Stage: Stage-0
     Fetch Operator
@@ -369,7 +337,7 @@ PREHOOK: query: SELECT xx.key, xx.cnt
 FROM
 (SELECT x.key as key, count(1) as cnt FROM src1 x JOIN src1 y ON (x.key = y.key) group by x.key) xx
 LEFT SEMI JOIN src yy
-ON xx.key=yy.key ORDER BY xx.key, xx.cnt
+ON xx.key=yy.key
 PREHOOK: type: QUERY
 PREHOOK: Input: default@src
 PREHOOK: Input: default@src1
@@ -378,7 +346,7 @@ POSTHOOK: query: SELECT xx.key, xx.cnt
 FROM
 (SELECT x.key as key, count(1) as cnt FROM src1 x JOIN src1 y ON (x.key = y.key) group by x.key) xx
 LEFT SEMI JOIN src yy
-ON xx.key=yy.key ORDER BY xx.key, xx.cnt
+ON xx.key=yy.key
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@src
 POSTHOOK: Input: default@src1
@@ -398,6 +366,7 @@ POSTHOOK: Input: default@src1
 406	1
 66	1
 98	1
+XifREjIWNTdZii76gCxhIQ==
 PREHOOK: query: -- When Correlation Optimizer is turned off, 4 MR jobs are needed.
 -- When Correlation Optimizer is turned on, 2 MR jobs are needed.
 -- The first job will evaluate subquery xx and xx join yy.
@@ -409,12 +378,12 @@ EXPLAIN
 SELECT xx.key, xx.value
 FROM
 src1 xx
-LEFT SEMI JOIN 
-(SELECT x.key as key 
+LEFT SEMI JOIN
+(SELECT x.key as key
  FROM src x JOIN src y ON (x.key = y.key)
  WHERE x.key < 200 AND
        y.key > 20) yy
-ON xx.key=yy.key ORDER BY xx.key, xx.value
+ON xx.key=yy.key
 PREHOOK: type: QUERY
 POSTHOOK: query: -- When Correlation Optimizer is turned off, 4 MR jobs are needed.
 -- When Correlation Optimizer is turned on, 2 MR jobs are needed.
@@ -427,18 +396,17 @@ EXPLAIN
 SELECT xx.key, xx.value
 FROM
 src1 xx
-LEFT SEMI JOIN 
-(SELECT x.key as key 
+LEFT SEMI JOIN
+(SELECT x.key as key
  FROM src x JOIN src y ON (x.key = y.key)
  WHERE x.key < 200 AND
        y.key > 20) yy
-ON xx.key=yy.key ORDER BY xx.key, xx.value
+ON xx.key=yy.key
 POSTHOOK: type: QUERY
 STAGE DEPENDENCIES:
   Stage-1 is a root stage
   Stage-2 depends on stages: Stage-1
-  Stage-3 depends on stages: Stage-2
-  Stage-0 depends on stages: Stage-3
+  Stage-0 depends on stages: Stage-2
 
 STAGE PLANS:
   Stage: Stage-1
@@ -525,30 +493,11 @@ STAGE PLANS:
             Statistics: Num rows: 6 Data size: 727 Basic stats: COMPLETE Column stats: NONE
             File Output Operator
               compressed: false
-              table:
-                  input format: org.apache.hadoop.mapred.SequenceFileInputFormat
-                  output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
-                  serde: org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe
-
-  Stage: Stage-3
-    Map Reduce
-      Map Operator Tree:
-          TableScan
-            Reduce Output Operator
-              key expressions: _col0 (type: string), _col1 (type: string)
-              sort order: ++
               Statistics: Num rows: 6 Data size: 727 Basic stats: COMPLETE Column stats: NONE
-              value expressions: _col0 (type: string), _col1 (type: string)
-      Reduce Operator Tree:
-        Extract
-          Statistics: Num rows: 6 Data size: 727 Basic stats: COMPLETE Column stats: NONE
-          File Output Operator
-            compressed: false
-            Statistics: Num rows: 6 Data size: 727 Basic stats: COMPLETE Column stats: NONE
-            table:
-                input format: org.apache.hadoop.mapred.TextInputFormat
-                output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
-                serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+              table:
+                  input format: org.apache.hadoop.mapred.TextInputFormat
+                  output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+                  serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
 
   Stage: Stage-0
     Fetch Operator
@@ -559,12 +508,12 @@ STAGE PLANS:
 PREHOOK: query: SELECT xx.key, xx.value
 FROM
 src1 xx
-LEFT SEMI JOIN 
-(SELECT x.key as key 
+LEFT SEMI JOIN
+(SELECT x.key as key
  FROM src x JOIN src y ON (x.key = y.key)
  WHERE x.key < 200 AND
        y.key > 20) yy
-ON xx.key=yy.key ORDER BY xx.key, xx.value
+ON xx.key=yy.key
 PREHOOK: type: QUERY
 PREHOOK: Input: default@src
 PREHOOK: Input: default@src1
@@ -572,12 +521,12 @@ PREHOOK: Input: default@src1
 POSTHOOK: query: SELECT xx.key, xx.value
 FROM
 src1 xx
-LEFT SEMI JOIN 
-(SELECT x.key as key 
+LEFT SEMI JOIN
+(SELECT x.key as key
  FROM src x JOIN src y ON (x.key = y.key)
  WHERE x.key < 200 AND
        y.key > 20) yy
-ON xx.key=yy.key ORDER BY xx.key, xx.value
+ON xx.key=yy.key
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@src
 POSTHOOK: Input: default@src1
@@ -587,32 +536,32 @@ POSTHOOK: Input: default@src1
 150	val_150
 66	val_66
 98	val_98
+yXzkFzMwxxoH+6e+nKoA8A==
 PREHOOK: query: EXPLAIN
 SELECT xx.key, xx.value
 FROM
 src1 xx
-LEFT SEMI JOIN 
-(SELECT x.key as key 
+LEFT SEMI JOIN
+(SELECT x.key as key
  FROM src x JOIN src y ON (x.key = y.key)
  WHERE x.key < 200 AND
        y.key > 20) yy
-ON xx.key=yy.key ORDER BY xx.key, xx.value
+ON xx.key=yy.key
 PREHOOK: type: QUERY
 POSTHOOK: query: EXPLAIN
 SELECT xx.key, xx.value
 FROM
 src1 xx
-LEFT SEMI JOIN 
-(SELECT x.key as key 
+LEFT SEMI JOIN
+(SELECT x.key as key
  FROM src x JOIN src y ON (x.key = y.key)
  WHERE x.key < 200 AND
        y.key > 20) yy
-ON xx.key=yy.key ORDER BY xx.key, xx.value
+ON xx.key=yy.key
 POSTHOOK: type: QUERY
 STAGE DEPENDENCIES:
   Stage-1 is a root stage
-  Stage-2 depends on stages: Stage-1
-  Stage-0 depends on stages: Stage-2
+  Stage-0 depends on stages: Stage-1
 
 STAGE PLANS:
   Stage: Stage-1
@@ -669,10 +618,11 @@ STAGE PLANS:
                 Statistics: Num rows: 0 Data size: 0 Basic stats: NONE Column stats: NONE
                 File Output Operator
                   compressed: false
+                  Statistics: Num rows: 0 Data size: 0 Basic stats: NONE Column stats: NONE
                   table:
-                      input format: org.apache.hadoop.mapred.SequenceFileInputFormat
-                      output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
-                      serde: org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe
+                      input format: org.apache.hadoop.mapred.TextInputFormat
+                      output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+                      serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
           Join Operator
             condition map:
                  Inner Join 0 to 1
@@ -701,30 +651,11 @@ STAGE PLANS:
                     Statistics: Num rows: 0 Data size: 0 Basic stats: NONE Column stats: NONE
                     File Output Operator
                       compressed: false
+                      Statistics: Num rows: 0 Data size: 0 Basic stats: NONE Column stats: NONE
                       table:
-                          input format: org.apache.hadoop.mapred.SequenceFileInputFormat
-                          output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
-                          serde: org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe
-
-  Stage: Stage-2
-    Map Reduce
-      Map Operator Tree:
-          TableScan
-            Reduce Output Operator
-              key expressions: _col0 (type: string), _col1 (type: string)
-              sort order: ++
-              Statistics: Num rows: 0 Data size: 0 Basic stats: NONE Column stats: NONE
-              value expressions: _col0 (type: string), _col1 (type: string)
-      Reduce Operator Tree:
-        Extract
-          Statistics: Num rows: 0 Data size: 0 Basic stats: NONE Column stats: NONE
-          File Output Operator
-            compressed: false
-            Statistics: Num rows: 0 Data size: 0 Basic stats: NONE Column stats: NONE
-            table:
-                input format: org.apache.hadoop.mapred.TextInputFormat
-                output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
-                serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+                          input format: org.apache.hadoop.mapred.TextInputFormat
+                          output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+                          serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
 
   Stage: Stage-0
     Fetch Operator
@@ -735,12 +666,12 @@ STAGE PLANS:
 PREHOOK: query: SELECT xx.key, xx.value
 FROM
 src1 xx
-LEFT SEMI JOIN 
-(SELECT x.key as key 
+LEFT SEMI JOIN
+(SELECT x.key as key
  FROM src x JOIN src y ON (x.key = y.key)
  WHERE x.key < 200 AND
        y.key > 20) yy
-ON xx.key=yy.key ORDER BY xx.key, xx.value
+ON xx.key=yy.key
 PREHOOK: type: QUERY
 PREHOOK: Input: default@src
 PREHOOK: Input: default@src1
@@ -748,12 +679,12 @@ PREHOOK: Input: default@src1
 POSTHOOK: query: SELECT xx.key, xx.value
 FROM
 src1 xx
-LEFT SEMI JOIN 
-(SELECT x.key as key 
+LEFT SEMI JOIN
+(SELECT x.key as key
  FROM src x JOIN src y ON (x.key = y.key)
  WHERE x.key < 200 AND
        y.key > 20) yy
-ON xx.key=yy.key ORDER BY xx.key, xx.value
+ON xx.key=yy.key
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@src
 POSTHOOK: Input: default@src1
@@ -763,39 +694,39 @@ POSTHOOK: Input: default@src1
 150	val_150
 66	val_66
 98	val_98
+yXzkFzMwxxoH+6e+nKoA8A==
 PREHOOK: query: -- When Correlation Optimizer is turned off, 4 MR jobs are needed.
 -- When Correlation Optimizer is turned on, 2 MR jobs are needed.
--- This test is used to test if we can use shared scan for 
+-- This test is used to test if we can use shared scan for
 -- xx, yy:x, and yy:y.
 EXPLAIN
 SELECT xx.key, xx.value
 FROM
 src xx
-LEFT SEMI JOIN 
-(SELECT x.key as key 
+LEFT SEMI JOIN
+(SELECT x.key as key
  FROM src x JOIN src y ON (x.key = y.key)
  WHERE x.key < 200 AND x.key > 180) yy
-ON xx.key=yy.key ORDER BY xx.key, xx.value
+ON xx.key=yy.key
 PREHOOK: type: QUERY
 POSTHOOK: query: -- When Correlation Optimizer is turned off, 4 MR jobs are needed.
 -- When Correlation Optimizer is turned on, 2 MR jobs are needed.
--- This test is used to test if we can use shared scan for 
+-- This test is used to test if we can use shared scan for
 -- xx, yy:x, and yy:y.
 EXPLAIN
 SELECT xx.key, xx.value
 FROM
 src xx
-LEFT SEMI JOIN 
-(SELECT x.key as key 
+LEFT SEMI JOIN
+(SELECT x.key as key
  FROM src x JOIN src y ON (x.key = y.key)
  WHERE x.key < 200 AND x.key > 180) yy
-ON xx.key=yy.key ORDER BY xx.key, xx.value
+ON xx.key=yy.key
 POSTHOOK: type: QUERY
 STAGE DEPENDENCIES:
   Stage-1 is a root stage
   Stage-2 depends on stages: Stage-1
-  Stage-3 depends on stages: Stage-2
-  Stage-0 depends on stages: Stage-3
+  Stage-0 depends on stages: Stage-2
 
 STAGE PLANS:
   Stage: Stage-1
@@ -882,30 +813,11 @@ STAGE PLANS:
             Statistics: Num rows: 31 Data size: 6393 Basic stats: COMPLETE Column stats: NONE
             File Output Operator
               compressed: false
-              table:
-                  input format: org.apache.hadoop.mapred.SequenceFileInputFormat
-                  output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
-                  serde: org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe
-
-  Stage: Stage-3
-    Map Reduce
-      Map Operator Tree:
-          TableScan
-            Reduce Output Operator
-              key expressions: _col0 (type: string), _col1 (type: string)
-              sort order: ++
               Statistics: Num rows: 31 Data size: 6393 Basic stats: COMPLETE Column stats: NONE
-              value expressions: _col0 (type: string), _col1 (type: string)
-      Reduce Operator Tree:
-        Extract
-          Statistics: Num rows: 31 Data size: 6393 Basic stats: COMPLETE Column stats: NONE
-          File Output Operator
-            compressed: false
-            Statistics: Num rows: 31 Data size: 6393 Basic stats: COMPLETE Column stats: NONE
-            table:
-                input format: org.apache.hadoop.mapred.TextInputFormat
-                output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
-                serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+              table:
+                  input format: org.apache.hadoop.mapred.TextInputFormat
+                  output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+                  serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
 
   Stage: Stage-0
     Fetch Operator
@@ -916,22 +828,22 @@ STAGE PLANS:
 PREHOOK: query: SELECT xx.key, xx.value
 FROM
 src xx
-LEFT SEMI JOIN 
-(SELECT x.key as key 
+LEFT SEMI JOIN
+(SELECT x.key as key
  FROM src x JOIN src y ON (x.key = y.key)
  WHERE x.key < 200 AND x.key > 180) yy
-ON xx.key=yy.key ORDER BY xx.key, xx.value
+ON xx.key=yy.key
 PREHOOK: type: QUERY
 PREHOOK: Input: default@src
 #### A masked pattern was here ####
 POSTHOOK: query: SELECT xx.key, xx.value
 FROM
 src xx
-LEFT SEMI JOIN 
-(SELECT x.key as key 
+LEFT SEMI JOIN
+(SELECT x.key as key
  FROM src x JOIN src y ON (x.key = y.key)
  WHERE x.key < 200 AND x.key > 180) yy
-ON xx.key=yy.key ORDER BY xx.key, xx.value
+ON xx.key=yy.key
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@src
 #### A masked pattern was here ####
@@ -958,30 +870,30 @@ POSTHOOK: Input: default@src
 199	val_199
 199	val_199
 199	val_199
+JoqlU/XtLjyBlZ8xMKANxg==
 PREHOOK: query: EXPLAIN
 SELECT xx.key, xx.value
 FROM
 src xx
-LEFT SEMI JOIN 
-(SELECT x.key as key 
+LEFT SEMI JOIN
+(SELECT x.key as key
  FROM src x JOIN src y ON (x.key = y.key)
  WHERE x.key < 200 AND x.key > 180) yy
-ON xx.key=yy.key ORDER BY xx.key, xx.value
+ON xx.key=yy.key
 PREHOOK: type: QUERY
 POSTHOOK: query: EXPLAIN
 SELECT xx.key, xx.value
 FROM
 src xx
-LEFT SEMI JOIN 
-(SELECT x.key as key 
+LEFT SEMI JOIN
+(SELECT x.key as key
  FROM src x JOIN src y ON (x.key = y.key)
  WHERE x.key < 200 AND x.key > 180) yy
-ON xx.key=yy.key ORDER BY xx.key, xx.value
+ON xx.key=yy.key
 POSTHOOK: type: QUERY
 STAGE DEPENDENCIES:
   Stage-1 is a root stage
-  Stage-2 depends on stages: Stage-1
-  Stage-0 depends on stages: Stage-2
+  Stage-0 depends on stages: Stage-1
 
 STAGE PLANS:
   Stage: Stage-1
@@ -1038,10 +950,11 @@ STAGE PLANS:
                 Statistics: Num rows: 0 Data size: 0 Basic stats: NONE Column stats: NONE
                 File Output Operator
                   compressed: false
+                  Statistics: Num rows: 0 Data size: 0 Basic stats: NONE Column stats: NONE
                   table:
-                      input format: org.apache.hadoop.mapred.SequenceFileInputFormat
-                      output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
-                      serde: org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe
+                      input format: org.apache.hadoop.mapred.TextInputFormat
+                      output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+                      serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
           Join Operator
             condition map:
                  Inner Join 0 to 1
@@ -1070,30 +983,11 @@ STAGE PLANS:
                     Statistics: Num rows: 0 Data size: 0 Basic stats: NONE Column stats: NONE
                     File Output Operator
                       compressed: false
+                      Statistics: Num rows: 0 Data size: 0 Basic stats: NONE Column stats: NONE
                       table:
-                          input format: org.apache.hadoop.mapred.SequenceFileInputFormat
-                          output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
-                          serde: org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe
-
-  Stage: Stage-2
-    Map Reduce
-      Map Operator Tree:
-          TableScan
-            Reduce Output Operator
-              key expressions: _col0 (type: string), _col1 (type: string)
-              sort order: ++
-              Statistics: Num rows: 0 Data size: 0 Basic stats: NONE Column stats: NONE
-              value expressions: _col0 (type: string), _col1 (type: string)
-      Reduce Operator Tree:
-        Extract
-          Statistics: Num rows: 0 Data size: 0 Basic stats: NONE Column stats: NONE
-          File Output Operator
-            compressed: false
-            Statistics: Num rows: 0 Data size: 0 Basic stats: NONE Column stats: NONE
-            table:
-                input format: org.apache.hadoop.mapred.TextInputFormat
-                output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
-                serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+                          input format: org.apache.hadoop.mapred.TextInputFormat
+                          output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+                          serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
 
   Stage: Stage-0
     Fetch Operator
@@ -1104,22 +998,22 @@ STAGE PLANS:
 PREHOOK: query: SELECT xx.key, xx.value
 FROM
 src xx
-LEFT SEMI JOIN 
-(SELECT x.key as key 
+LEFT SEMI JOIN
+(SELECT x.key as key
  FROM src x JOIN src y ON (x.key = y.key)
  WHERE x.key < 200 AND x.key > 180) yy
-ON xx.key=yy.key ORDER BY xx.key, xx.value
+ON xx.key=yy.key
 PREHOOK: type: QUERY
 PREHOOK: Input: default@src
 #### A masked pattern was here ####
 POSTHOOK: query: SELECT xx.key, xx.value
 FROM
 src xx
-LEFT SEMI JOIN 
-(SELECT x.key as key 
+LEFT SEMI JOIN
+(SELECT x.key as key
  FROM src x JOIN src y ON (x.key = y.key)
  WHERE x.key < 200 AND x.key > 180) yy
-ON xx.key=yy.key ORDER BY xx.key, xx.value
+ON xx.key=yy.key
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@src
 #### A masked pattern was here ####
@@ -1146,3 +1040,4 @@ POSTHOOK: Input: default@src
 199	val_199
 199	val_199
 199	val_199
+JoqlU/XtLjyBlZ8xMKANxg==

Modified: hive/trunk/ql/src/test/results/clientpositive/correlationoptimizer15.q.out
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/results/clientpositive/correlationoptimizer15.q.out?rev=1598678&r1=1598677&r2=1598678&view=diff
==============================================================================
--- hive/trunk/ql/src/test/results/clientpositive/correlationoptimizer15.q.out (original)
+++ hive/trunk/ql/src/test/results/clientpositive/correlationoptimizer15.q.out Fri May 30 17:37:05 2014
@@ -1,4 +1,6 @@
-PREHOOK: query: -- When Correlation Optimizer is turned off, 4 MR jobs are needed.
+PREHOOK: query: -- SORT_QUERY_RESULTS
+
+-- When Correlation Optimizer is turned off, 4 MR jobs are needed.
 -- When Correlation Optimizer is turned on, 2 MR jobs are needed.
 -- The first job will evaluate subquery xx and xx join yy.
 EXPLAIN
@@ -8,7 +10,9 @@ FROM
 JOIN src yy
 ON xx.key=yy.key ORDER BY xx.key, xx.cnt, yy.key
 PREHOOK: type: QUERY
-POSTHOOK: query: -- When Correlation Optimizer is turned off, 4 MR jobs are needed.
+POSTHOOK: query: -- SORT_QUERY_RESULTS
+
+-- When Correlation Optimizer is turned off, 4 MR jobs are needed.
 -- When Correlation Optimizer is turned on, 2 MR jobs are needed.
 -- The first job will evaluate subquery xx and xx join yy.
 EXPLAIN
@@ -169,7 +173,7 @@ PREHOOK: query: SELECT xx.key, xx.cnt, y
 FROM
 (SELECT x.key as key, count(1) as cnt FROM src1 x JOIN src1 y ON (x.key = y.key) group by x.key) xx
 JOIN src yy
-ON xx.key=yy.key ORDER BY xx.key, xx.cnt, yy.key
+ON xx.key=yy.key
 PREHOOK: type: QUERY
 PREHOOK: Input: default@src
 PREHOOK: Input: default@src1
@@ -178,7 +182,7 @@ POSTHOOK: query: SELECT xx.key, xx.cnt, 
 FROM
 (SELECT x.key as key, count(1) as cnt FROM src1 x JOIN src1 y ON (x.key = y.key) group by x.key) xx
 JOIN src yy
-ON xx.key=yy.key ORDER BY xx.key, xx.cnt, yy.key
+ON xx.key=yy.key
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@src
 POSTHOOK: Input: default@src1
@@ -225,19 +229,18 @@ SELECT xx.key, xx.cnt, yy.key
 FROM
 (SELECT x.key as key, count(1) as cnt FROM src1 x JOIN src1 y ON (x.key = y.key) group by x.key) xx
 JOIN src yy
-ON xx.key=yy.key ORDER BY xx.key, xx.cnt, yy.key
+ON xx.key=yy.key
 PREHOOK: type: QUERY
 POSTHOOK: query: EXPLAIN
 SELECT xx.key, xx.cnt, yy.key
 FROM
 (SELECT x.key as key, count(1) as cnt FROM src1 x JOIN src1 y ON (x.key = y.key) group by x.key) xx
 JOIN src yy
-ON xx.key=yy.key ORDER BY xx.key, xx.cnt, yy.key
+ON xx.key=yy.key
 POSTHOOK: type: QUERY
 STAGE DEPENDENCIES:
   Stage-1 is a root stage
-  Stage-2 depends on stages: Stage-1
-  Stage-0 depends on stages: Stage-2
+  Stage-0 depends on stages: Stage-1
 
 STAGE PLANS:
   Stage: Stage-1
@@ -312,10 +315,11 @@ STAGE PLANS:
                           Statistics: Num rows: 0 Data size: 0 Basic stats: NONE Column stats: NONE
                           File Output Operator
                             compressed: false
+                            Statistics: Num rows: 0 Data size: 0 Basic stats: NONE Column stats: NONE
                             table:
-                                input format: org.apache.hadoop.mapred.SequenceFileInputFormat
-                                output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
-                                serde: org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe
+                                input format: org.apache.hadoop.mapred.TextInputFormat
+                                output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+                                serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
           Mux Operator
             Statistics: Num rows: 62 Data size: 6244 Basic stats: COMPLETE Column stats: NONE
             Join Operator
@@ -332,30 +336,11 @@ STAGE PLANS:
                 Statistics: Num rows: 0 Data size: 0 Basic stats: NONE Column stats: NONE
                 File Output Operator
                   compressed: false
+                  Statistics: Num rows: 0 Data size: 0 Basic stats: NONE Column stats: NONE
                   table:
-                      input format: org.apache.hadoop.mapred.SequenceFileInputFormat
-                      output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
-                      serde: org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe
-
-  Stage: Stage-2
-    Map Reduce
-      Map Operator Tree:
-          TableScan
-            Reduce Output Operator
-              key expressions: _col0 (type: string), _col1 (type: bigint), _col2 (type: string)
-              sort order: +++
-              Statistics: Num rows: 0 Data size: 0 Basic stats: NONE Column stats: NONE
-              value expressions: _col0 (type: string), _col1 (type: bigint), _col2 (type: string)
-      Reduce Operator Tree:
-        Extract
-          Statistics: Num rows: 0 Data size: 0 Basic stats: NONE Column stats: NONE
-          File Output Operator
-            compressed: false
-            Statistics: Num rows: 0 Data size: 0 Basic stats: NONE Column stats: NONE
-            table:
-                input format: org.apache.hadoop.mapred.TextInputFormat
-                output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
-                serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+                      input format: org.apache.hadoop.mapred.TextInputFormat
+                      output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+                      serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
 
   Stage: Stage-0
     Fetch Operator
@@ -367,7 +352,7 @@ PREHOOK: query: SELECT xx.key, xx.cnt, y
 FROM
 (SELECT x.key as key, count(1) as cnt FROM src1 x JOIN src1 y ON (x.key = y.key) group by x.key) xx
 JOIN src yy
-ON xx.key=yy.key ORDER BY xx.key, xx.cnt, yy.key
+ON xx.key=yy.key
 PREHOOK: type: QUERY
 PREHOOK: Input: default@src
 PREHOOK: Input: default@src1
@@ -376,7 +361,7 @@ POSTHOOK: query: SELECT xx.key, xx.cnt, 
 FROM
 (SELECT x.key as key, count(1) as cnt FROM src1 x JOIN src1 y ON (x.key = y.key) group by x.key) xx
 JOIN src yy
-ON xx.key=yy.key ORDER BY xx.key, xx.cnt, yy.key
+ON xx.key=yy.key
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@src
 POSTHOOK: Input: default@src1



Mime
View raw message