You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by jc...@apache.org on 2015/11/20 23:32:47 UTC

[20/51] [partial] hive git commit: HIVE-12017: Do not disable CBO by default when number of joins in a query is equal or less than 1 (Jesus Camacho Rodriguez, reviewed by Ashutosh Chauhan)

http://git-wip-us.apache.org/repos/asf/hive/blob/7dab21ac/ql/src/test/results/clientpositive/multiMapJoin2.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/multiMapJoin2.q.out b/ql/src/test/results/clientpositive/multiMapJoin2.q.out
index 46b717f..dee81c2 100644
--- a/ql/src/test/results/clientpositive/multiMapJoin2.q.out
+++ b/ql/src/test/results/clientpositive/multiMapJoin2.q.out
@@ -2079,21 +2079,25 @@ STAGE PLANS:
   Stage: Stage-5
     Map Reduce Local Work
       Alias -> Map Local Tables:
-        y 
+        $hdt$_1:y 
           Fetch Operator
             limit: -1
       Alias -> Map Local Operator Tree:
-        y 
+        $hdt$_1:y 
           TableScan
             alias: y
             Statistics: Num rows: 25 Data size: 191 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
               predicate: key is not null (type: boolean)
               Statistics: Num rows: 13 Data size: 99 Basic stats: COMPLETE Column stats: NONE
-              HashTable Sink Operator
-                keys:
-                  0 key (type: string)
-                  1 key (type: string)
+              Select Operator
+                expressions: key (type: string)
+                outputColumnNames: _col0
+                Statistics: Num rows: 13 Data size: 99 Basic stats: COMPLETE Column stats: NONE
+                HashTable Sink Operator
+                  keys:
+                    0 _col0 (type: string)
+                    1 _col0 (type: string)
 
   Stage: Stage-2
     Map Reduce
@@ -2104,22 +2108,26 @@ STAGE PLANS:
             Filter Operator
               predicate: key is not null (type: boolean)
               Statistics: Num rows: 63 Data size: 635 Basic stats: COMPLETE Column stats: NONE
-              Map Join Operator
-                condition map:
-                     Inner Join 0 to 1
-                keys:
-                  0 key (type: string)
-                  1 key (type: string)
-                Statistics: Num rows: 69 Data size: 698 Basic stats: COMPLETE Column stats: NONE
-                Group By Operator
-                  aggregations: count()
-                  mode: hash
-                  outputColumnNames: _col0
-                  Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE
-                  Reduce Output Operator
-                    sort order: 
+              Select Operator
+                expressions: key (type: string)
+                outputColumnNames: _col0
+                Statistics: Num rows: 63 Data size: 635 Basic stats: COMPLETE Column stats: NONE
+                Map Join Operator
+                  condition map:
+                       Inner Join 0 to 1
+                  keys:
+                    0 _col0 (type: string)
+                    1 _col0 (type: string)
+                  Statistics: Num rows: 69 Data size: 698 Basic stats: COMPLETE Column stats: NONE
+                  Group By Operator
+                    aggregations: count()
+                    mode: hash
+                    outputColumnNames: _col0
                     Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE
-                    value expressions: _col0 (type: bigint)
+                    Reduce Output Operator
+                      sort order: 
+                      Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE
+                      value expressions: _col0 (type: bigint)
       Local Work:
         Map Reduce Local Work
       Reduce Operator Tree:

http://git-wip-us.apache.org/repos/asf/hive/blob/7dab21ac/ql/src/test/results/clientpositive/multi_join_union.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/multi_join_union.q.out b/ql/src/test/results/clientpositive/multi_join_union.q.out
index 466f34b..76c837f 100644
--- a/ql/src/test/results/clientpositive/multi_join_union.q.out
+++ b/ql/src/test/results/clientpositive/multi_join_union.q.out
@@ -53,36 +53,40 @@ src12 b ON (a.key = b.key) JOIN
 (SELECT * FROM (SELECT * FROM src13 UNION ALL SELECT * FROM src14)a )c ON c.value = b.value
 POSTHOOK: type: QUERY
 STAGE DEPENDENCIES:
-  Stage-7 is a root stage
-  Stage-5 depends on stages: Stage-7
-  Stage-0 depends on stages: Stage-5
+  Stage-8 is a root stage
+  Stage-6 depends on stages: Stage-8
+  Stage-0 depends on stages: Stage-6
 
 STAGE PLANS:
-  Stage: Stage-7
+  Stage: Stage-8
     Map Reduce Local Work
       Alias -> Map Local Tables:
-        a 
+        $hdt$_0:a 
           Fetch Operator
             limit: -1
-        c-subquery1:a-subquery1:src13 
+        $hdt$_2-subquery1:$hdt$_2-subquery1:src13 
           Fetch Operator
             limit: -1
-        c-subquery2:a-subquery2:src14 
+        $hdt$_2-subquery2:$hdt$_2-subquery2:src14 
           Fetch Operator
             limit: -1
       Alias -> Map Local Operator Tree:
-        a 
+        $hdt$_0:a 
           TableScan
             alias: a
             Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
               predicate: key is not null (type: boolean)
               Statistics: Num rows: 250 Data size: 2656 Basic stats: COMPLETE Column stats: NONE
-              HashTable Sink Operator
-                keys:
-                  0 key (type: string)
-                  1 key (type: string)
-        c-subquery1:a-subquery1:src13 
+              Select Operator
+                expressions: key (type: string), value (type: string)
+                outputColumnNames: _col0, _col1
+                Statistics: Num rows: 250 Data size: 2656 Basic stats: COMPLETE Column stats: NONE
+                HashTable Sink Operator
+                  keys:
+                    0 _col0 (type: string)
+                    1 _col0 (type: string)
+        $hdt$_2-subquery1:$hdt$_2-subquery1:src13 
           TableScan
             alias: src13
             Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
@@ -97,9 +101,9 @@ STAGE PLANS:
                   Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                   HashTable Sink Operator
                     keys:
-                      0 _col6 (type: string)
+                      0 _col3 (type: string)
                       1 _col1 (type: string)
-        c-subquery2:a-subquery2:src14 
+        $hdt$_2-subquery2:$hdt$_2-subquery2:src14 
           TableScan
             alias: src14
             Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
@@ -114,10 +118,10 @@ STAGE PLANS:
                   Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                   HashTable Sink Operator
                     keys:
-                      0 _col6 (type: string)
+                      0 _col3 (type: string)
                       1 _col1 (type: string)
 
-  Stage: Stage-5
+  Stage: Stage-6
     Map Reduce
       Map Operator Tree:
           TableScan
@@ -126,24 +130,24 @@ STAGE PLANS:
             Filter Operator
               predicate: (key is not null and value is not null) (type: boolean)
               Statistics: Num rows: 125 Data size: 1328 Basic stats: COMPLETE Column stats: NONE
-              Map Join Operator
-                condition map:
-                     Inner Join 0 to 1
-                keys:
-                  0 key (type: string)
-                  1 key (type: string)
-                outputColumnNames: _col0, _col1, _col5, _col6
-                Statistics: Num rows: 275 Data size: 2921 Basic stats: COMPLETE Column stats: NONE
+              Select Operator
+                expressions: key (type: string), value (type: string)
+                outputColumnNames: _col0, _col1
+                Statistics: Num rows: 125 Data size: 1328 Basic stats: COMPLETE Column stats: NONE
                 Map Join Operator
                   condition map:
                        Inner Join 0 to 1
                   keys:
-                    0 _col6 (type: string)
-                    1 _col1 (type: string)
-                  outputColumnNames: _col0, _col1, _col5, _col6, _col10, _col11
-                  Statistics: Num rows: 550 Data size: 5843 Basic stats: COMPLETE Column stats: NONE
-                  Select Operator
-                    expressions: _col0 (type: string), _col1 (type: string), _col5 (type: string), _col6 (type: string), _col10 (type: string), _col11 (type: string)
+                    0 _col0 (type: string)
+                    1 _col0 (type: string)
+                  outputColumnNames: _col0, _col1, _col2, _col3
+                  Statistics: Num rows: 275 Data size: 2921 Basic stats: COMPLETE Column stats: NONE
+                  Map Join Operator
+                    condition map:
+                         Inner Join 0 to 1
+                    keys:
+                      0 _col3 (type: string)
+                      1 _col1 (type: string)
                     outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5
                     Statistics: Num rows: 550 Data size: 5843 Basic stats: COMPLETE Column stats: NONE
                     File Output Operator

http://git-wip-us.apache.org/repos/asf/hive/blob/7dab21ac/ql/src/test/results/clientpositive/orc_llap.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/orc_llap.q.out b/ql/src/test/results/clientpositive/orc_llap.q.out
index 79c6281..d0b07a0 100644
--- a/ql/src/test/results/clientpositive/orc_llap.q.out
+++ b/ql/src/test/results/clientpositive/orc_llap.q.out
@@ -550,52 +550,60 @@ STAGE PLANS:
   Stage: Stage-4
     Map Reduce Local Work
       Alias -> Map Local Tables:
-        o1 
+        $hdt$_0:o1 
           Fetch Operator
             limit: -1
       Alias -> Map Local Operator Tree:
-        o1 
+        $hdt$_0:o1 
           TableScan
             alias: o1
-            filterExpr: (csmallint is not null and cbigint is not null) (type: boolean)
+            filterExpr: (cbigint is not null and csmallint is not null) (type: boolean)
             Statistics: Num rows: 122880 Data size: 29079940 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (csmallint is not null and cbigint is not null) (type: boolean)
+              predicate: (cbigint is not null and csmallint is not null) (type: boolean)
               Statistics: Num rows: 30720 Data size: 7269985 Basic stats: COMPLETE Column stats: NONE
-              HashTable Sink Operator
-                keys:
-                  0 csmallint (type: smallint)
-                  1 csmallint (type: smallint)
+              Select Operator
+                expressions: csmallint (type: smallint), cstring1 (type: string)
+                outputColumnNames: _col0, _col2
+                Statistics: Num rows: 30720 Data size: 7269985 Basic stats: COMPLETE Column stats: NONE
+                HashTable Sink Operator
+                  keys:
+                    0 _col0 (type: smallint)
+                    1 _col0 (type: smallint)
 
   Stage: Stage-3
     Map Reduce
       Map Operator Tree:
           TableScan
-            alias: o2
-            filterExpr: (csmallint is not null and cbigint is not null) (type: boolean)
+            alias: o1
+            filterExpr: (cbigint is not null and csmallint is not null) (type: boolean)
             Statistics: Num rows: 122880 Data size: 29079940 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (csmallint is not null and cbigint is not null) (type: boolean)
+              predicate: (cbigint is not null and csmallint is not null) (type: boolean)
               Statistics: Num rows: 30720 Data size: 7269985 Basic stats: COMPLETE Column stats: NONE
-              Map Join Operator
-                condition map:
-                     Inner Join 0 to 1
-                keys:
-                  0 csmallint (type: smallint)
-                  1 csmallint (type: smallint)
-                outputColumnNames: _col6, _col22
-                Statistics: Num rows: 33792 Data size: 7996983 Basic stats: COMPLETE Column stats: NONE
-                Select Operator
-                  expressions: _col6 (type: string), _col22 (type: string)
-                  outputColumnNames: _col0, _col1
+              Select Operator
+                expressions: csmallint (type: smallint), cstring2 (type: string)
+                outputColumnNames: _col0, _col2
+                Statistics: Num rows: 30720 Data size: 7269985 Basic stats: COMPLETE Column stats: NONE
+                Map Join Operator
+                  condition map:
+                       Inner Join 0 to 1
+                  keys:
+                    0 _col0 (type: smallint)
+                    1 _col0 (type: smallint)
+                  outputColumnNames: _col2, _col5
                   Statistics: Num rows: 33792 Data size: 7996983 Basic stats: COMPLETE Column stats: NONE
-                  File Output Operator
-                    compressed: false
+                  Select Operator
+                    expressions: _col2 (type: string), _col5 (type: string)
+                    outputColumnNames: _col0, _col1
                     Statistics: Num rows: 33792 Data size: 7996983 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
+                    File Output Operator
+                      compressed: false
+                      Statistics: Num rows: 33792 Data size: 7996983 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
       Execution mode: vectorized
       LLAP IO: all inputs
       Local Work:
@@ -983,52 +991,60 @@ STAGE PLANS:
   Stage: Stage-4
     Map Reduce Local Work
       Alias -> Map Local Tables:
-        o1 
+        $hdt$_0:o1 
           Fetch Operator
             limit: -1
       Alias -> Map Local Operator Tree:
-        o1 
+        $hdt$_0:o1 
           TableScan
             alias: o1
-            filterExpr: (csmallint is not null and cbigint is not null) (type: boolean)
+            filterExpr: (cbigint is not null and csmallint is not null) (type: boolean)
             Statistics: Num rows: 14226 Data size: 1593339 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (csmallint is not null and cbigint is not null) (type: boolean)
+              predicate: (cbigint is not null and csmallint is not null) (type: boolean)
               Statistics: Num rows: 3557 Data size: 398390 Basic stats: COMPLETE Column stats: NONE
-              HashTable Sink Operator
-                keys:
-                  0 csmallint (type: smallint)
-                  1 csmallint (type: smallint)
+              Select Operator
+                expressions: csmallint (type: smallint), cstring1 (type: string)
+                outputColumnNames: _col0, _col2
+                Statistics: Num rows: 3557 Data size: 398390 Basic stats: COMPLETE Column stats: NONE
+                HashTable Sink Operator
+                  keys:
+                    0 _col0 (type: smallint)
+                    1 _col0 (type: smallint)
 
   Stage: Stage-3
     Map Reduce
       Map Operator Tree:
           TableScan
-            alias: o2
-            filterExpr: (csmallint is not null and cbigint is not null) (type: boolean)
+            alias: o1
+            filterExpr: (cbigint is not null and csmallint is not null) (type: boolean)
             Statistics: Num rows: 14226 Data size: 1593339 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (csmallint is not null and cbigint is not null) (type: boolean)
+              predicate: (cbigint is not null and csmallint is not null) (type: boolean)
               Statistics: Num rows: 3557 Data size: 398390 Basic stats: COMPLETE Column stats: NONE
-              Map Join Operator
-                condition map:
-                     Inner Join 0 to 1
-                keys:
-                  0 csmallint (type: smallint)
-                  1 csmallint (type: smallint)
-                outputColumnNames: _col6, _col22
-                Statistics: Num rows: 3912 Data size: 438229 Basic stats: COMPLETE Column stats: NONE
-                Select Operator
-                  expressions: _col6 (type: string), _col22 (type: string)
-                  outputColumnNames: _col0, _col1
+              Select Operator
+                expressions: csmallint (type: smallint), cstring2 (type: string)
+                outputColumnNames: _col0, _col2
+                Statistics: Num rows: 3557 Data size: 398390 Basic stats: COMPLETE Column stats: NONE
+                Map Join Operator
+                  condition map:
+                       Inner Join 0 to 1
+                  keys:
+                    0 _col0 (type: smallint)
+                    1 _col0 (type: smallint)
+                  outputColumnNames: _col2, _col5
                   Statistics: Num rows: 3912 Data size: 438229 Basic stats: COMPLETE Column stats: NONE
-                  File Output Operator
-                    compressed: false
+                  Select Operator
+                    expressions: _col2 (type: string), _col5 (type: string)
+                    outputColumnNames: _col0, _col1
                     Statistics: Num rows: 3912 Data size: 438229 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
+                    File Output Operator
+                      compressed: false
+                      Statistics: Num rows: 3912 Data size: 438229 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
       Execution mode: vectorized
       LLAP IO: all inputs
       Local Work:

http://git-wip-us.apache.org/repos/asf/hive/blob/7dab21ac/ql/src/test/results/clientpositive/parallel_join1.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/parallel_join1.q.out b/ql/src/test/results/clientpositive/parallel_join1.q.out
index 9ce2646..761c85e 100644
--- a/ql/src/test/results/clientpositive/parallel_join1.q.out
+++ b/ql/src/test/results/clientpositive/parallel_join1.q.out
@@ -34,15 +34,14 @@ STAGE PLANS:
               predicate: key is not null (type: boolean)
               Statistics: Num rows: 250 Data size: 2656 Basic stats: COMPLETE Column stats: NONE
               Select Operator
-                expressions: key (type: string), value (type: string)
-                outputColumnNames: _col0, _col1
+                expressions: key (type: string)
+                outputColumnNames: _col0
                 Statistics: Num rows: 250 Data size: 2656 Basic stats: COMPLETE Column stats: NONE
                 Reduce Output Operator
                   key expressions: _col0 (type: string)
                   sort order: +
                   Map-reduce partition columns: _col0 (type: string)
                   Statistics: Num rows: 250 Data size: 2656 Basic stats: COMPLETE Column stats: NONE
-                  value expressions: _col1 (type: string)
           TableScan
             alias: src1
             Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
@@ -50,14 +49,15 @@ STAGE PLANS:
               predicate: key is not null (type: boolean)
               Statistics: Num rows: 250 Data size: 2656 Basic stats: COMPLETE Column stats: NONE
               Select Operator
-                expressions: key (type: string)
-                outputColumnNames: _col0
+                expressions: key (type: string), value (type: string)
+                outputColumnNames: _col0, _col1
                 Statistics: Num rows: 250 Data size: 2656 Basic stats: COMPLETE Column stats: NONE
                 Reduce Output Operator
                   key expressions: _col0 (type: string)
                   sort order: +
                   Map-reduce partition columns: _col0 (type: string)
                   Statistics: Num rows: 250 Data size: 2656 Basic stats: COMPLETE Column stats: NONE
+                  value expressions: _col1 (type: string)
       Reduce Operator Tree:
         Join Operator
           condition map:
@@ -65,10 +65,10 @@ STAGE PLANS:
           keys:
             0 _col0 (type: string)
             1 _col0 (type: string)
-          outputColumnNames: _col1, _col2
+          outputColumnNames: _col0, _col2
           Statistics: Num rows: 275 Data size: 2921 Basic stats: COMPLETE Column stats: NONE
           Select Operator
-            expressions: UDFToInteger(_col2) (type: int), _col1 (type: string)
+            expressions: UDFToInteger(_col0) (type: int), _col2 (type: string)
             outputColumnNames: _col0, _col1
             Statistics: Num rows: 275 Data size: 2921 Basic stats: COMPLETE Column stats: NONE
             File Output Operator

http://git-wip-us.apache.org/repos/asf/hive/blob/7dab21ac/ql/src/test/results/clientpositive/parquet_join.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/parquet_join.q.out b/ql/src/test/results/clientpositive/parquet_join.q.out
index f880d1d..a9629dc 100644
--- a/ql/src/test/results/clientpositive/parquet_join.q.out
+++ b/ql/src/test/results/clientpositive/parquet_join.q.out
@@ -82,34 +82,42 @@ STAGE PLANS:
             Filter Operator
               predicate: key is not null (type: boolean)
               Statistics: Num rows: 1 Data size: 2 Basic stats: COMPLETE Column stats: NONE
-              Reduce Output Operator
-                key expressions: key (type: int)
-                sort order: +
-                Map-reduce partition columns: key (type: int)
+              Select Operator
+                expressions: key (type: int)
+                outputColumnNames: _col0
                 Statistics: Num rows: 1 Data size: 2 Basic stats: COMPLETE Column stats: NONE
+                Reduce Output Operator
+                  key expressions: _col0 (type: int)
+                  sort order: +
+                  Map-reduce partition columns: _col0 (type: int)
+                  Statistics: Num rows: 1 Data size: 2 Basic stats: COMPLETE Column stats: NONE
           TableScan
             alias: p2
             Statistics: Num rows: 2 Data size: 6 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
               predicate: key is not null (type: boolean)
               Statistics: Num rows: 1 Data size: 3 Basic stats: COMPLETE Column stats: NONE
-              Reduce Output Operator
-                key expressions: key (type: int)
-                sort order: +
-                Map-reduce partition columns: key (type: int)
+              Select Operator
+                expressions: key (type: int), myvalue (type: string)
+                outputColumnNames: _col0, _col1
                 Statistics: Num rows: 1 Data size: 3 Basic stats: COMPLETE Column stats: NONE
-                value expressions: myvalue (type: string)
+                Reduce Output Operator
+                  key expressions: _col0 (type: int)
+                  sort order: +
+                  Map-reduce partition columns: _col0 (type: int)
+                  Statistics: Num rows: 1 Data size: 3 Basic stats: COMPLETE Column stats: NONE
+                  value expressions: _col1 (type: string)
       Reduce Operator Tree:
         Join Operator
           condition map:
                Inner Join 0 to 1
           keys:
-            0 key (type: int)
-            1 key (type: int)
-          outputColumnNames: _col7
+            0 _col0 (type: int)
+            1 _col0 (type: int)
+          outputColumnNames: _col2
           Statistics: Num rows: 1 Data size: 2 Basic stats: COMPLETE Column stats: NONE
           Select Operator
-            expressions: _col7 (type: string)
+            expressions: _col2 (type: string)
             outputColumnNames: _col0
             Statistics: Num rows: 1 Data size: 2 Basic stats: COMPLETE Column stats: NONE
             File Output Operator
@@ -163,21 +171,25 @@ STAGE PLANS:
   Stage: Stage-4
     Map Reduce Local Work
       Alias -> Map Local Tables:
-        p1 
+        $hdt$_0:p1 
           Fetch Operator
             limit: -1
       Alias -> Map Local Operator Tree:
-        p1 
+        $hdt$_0:p1 
           TableScan
             alias: p1
             Statistics: Num rows: 2 Data size: 4 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
               predicate: key is not null (type: boolean)
               Statistics: Num rows: 1 Data size: 2 Basic stats: COMPLETE Column stats: NONE
-              HashTable Sink Operator
-                keys:
-                  0 key (type: int)
-                  1 key (type: int)
+              Select Operator
+                expressions: key (type: int)
+                outputColumnNames: _col0
+                Statistics: Num rows: 1 Data size: 2 Basic stats: COMPLETE Column stats: NONE
+                HashTable Sink Operator
+                  keys:
+                    0 _col0 (type: int)
+                    1 _col0 (type: int)
 
   Stage: Stage-3
     Map Reduce
@@ -188,25 +200,29 @@ STAGE PLANS:
             Filter Operator
               predicate: key is not null (type: boolean)
               Statistics: Num rows: 1 Data size: 3 Basic stats: COMPLETE Column stats: NONE
-              Map Join Operator
-                condition map:
-                     Inner Join 0 to 1
-                keys:
-                  0 key (type: int)
-                  1 key (type: int)
-                outputColumnNames: _col7
-                Statistics: Num rows: 1 Data size: 2 Basic stats: COMPLETE Column stats: NONE
-                Select Operator
-                  expressions: _col7 (type: string)
-                  outputColumnNames: _col0
+              Select Operator
+                expressions: key (type: int), myvalue (type: string)
+                outputColumnNames: _col0, _col1
+                Statistics: Num rows: 1 Data size: 3 Basic stats: COMPLETE Column stats: NONE
+                Map Join Operator
+                  condition map:
+                       Inner Join 0 to 1
+                  keys:
+                    0 _col0 (type: int)
+                    1 _col0 (type: int)
+                  outputColumnNames: _col2
                   Statistics: Num rows: 1 Data size: 2 Basic stats: COMPLETE Column stats: NONE
-                  File Output Operator
-                    compressed: false
+                  Select Operator
+                    expressions: _col2 (type: string)
+                    outputColumnNames: _col0
                     Statistics: Num rows: 1 Data size: 2 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
+                    File Output Operator
+                      compressed: false
+                      Statistics: Num rows: 1 Data size: 2 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
       Local Work:
         Map Reduce Local Work
 
@@ -287,22 +303,26 @@ STAGE PLANS:
             Filter Operator
               predicate: key is not null (type: boolean)
               Statistics: Num rows: 1 Data size: 3 Basic stats: COMPLETE Column stats: NONE
-              Sorted Merge Bucket Map Join Operator
-                condition map:
-                     Inner Join 0 to 1
-                keys:
-                  0 key (type: int)
-                  1 key (type: int)
-                outputColumnNames: _col1, _col7
-                Select Operator
-                  expressions: _col1 (type: string), _col7 (type: string)
-                  outputColumnNames: _col0, _col1
-                  File Output Operator
-                    compressed: false
-                    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
+              Select Operator
+                expressions: key (type: int), value2 (type: string)
+                outputColumnNames: _col0, _col1
+                Statistics: Num rows: 1 Data size: 3 Basic stats: COMPLETE Column stats: NONE
+                Sorted Merge Bucket Map Join Operator
+                  condition map:
+                       Inner Join 0 to 1
+                  keys:
+                    0 _col0 (type: int)
+                    1 _col0 (type: int)
+                  outputColumnNames: _col1, _col3
+                  Select Operator
+                    expressions: _col1 (type: string), _col3 (type: string)
+                    outputColumnNames: _col0, _col1
+                    File Output Operator
+                      compressed: false
+                      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

http://git-wip-us.apache.org/repos/asf/hive/blob/7dab21ac/ql/src/test/results/clientpositive/pcr.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/pcr.q.out b/ql/src/test/results/clientpositive/pcr.q.out
index 7ba9f87..82dc31e 100644
--- a/ql/src/test/results/clientpositive/pcr.q.out
+++ b/ql/src/test/results/clientpositive/pcr.q.out
@@ -2712,30 +2712,38 @@ STAGE PLANS:
               isSamplingPred: false
               predicate: key is not null (type: boolean)
               Statistics: Num rows: 10 Data size: 80 Basic stats: COMPLETE Column stats: NONE
-              Reduce Output Operator
-                key expressions: key (type: int)
-                sort order: +
-                Map-reduce partition columns: key (type: int)
+              Select Operator
+                expressions: key (type: int), value (type: string)
+                outputColumnNames: _col0, _col1
                 Statistics: Num rows: 10 Data size: 80 Basic stats: COMPLETE Column stats: NONE
-                tag: 0
-                value expressions: value (type: string)
-                auto parallelism: false
+                Reduce Output Operator
+                  key expressions: _col0 (type: int)
+                  sort order: +
+                  Map-reduce partition columns: _col0 (type: int)
+                  Statistics: Num rows: 10 Data size: 80 Basic stats: COMPLETE Column stats: NONE
+                  tag: 0
+                  value expressions: _col1 (type: string)
+                  auto parallelism: false
           TableScan
-            alias: t2
+            alias: t1
             Statistics: Num rows: 20 Data size: 160 Basic stats: COMPLETE Column stats: NONE
             GatherStats: false
             Filter Operator
               isSamplingPred: false
               predicate: key is not null (type: boolean)
               Statistics: Num rows: 10 Data size: 80 Basic stats: COMPLETE Column stats: NONE
-              Reduce Output Operator
-                key expressions: key (type: int)
-                sort order: +
-                Map-reduce partition columns: key (type: int)
+              Select Operator
+                expressions: key (type: int), value (type: string)
+                outputColumnNames: _col0, _col1
                 Statistics: Num rows: 10 Data size: 80 Basic stats: COMPLETE Column stats: NONE
-                tag: 1
-                value expressions: value (type: string)
-                auto parallelism: false
+                Reduce Output Operator
+                  key expressions: _col0 (type: int)
+                  sort order: +
+                  Map-reduce partition columns: _col0 (type: int)
+                  Statistics: Num rows: 10 Data size: 80 Basic stats: COMPLETE Column stats: NONE
+                  tag: 1
+                  value expressions: _col1 (type: string)
+                  auto parallelism: false
       Path -> Alias:
 #### A masked pattern was here ####
       Path -> Partition:
@@ -2785,38 +2793,34 @@ STAGE PLANS:
               name: default.pcr_t1
             name: default.pcr_t1
       Truncated Path -> Alias:
-        /pcr_t1/ds=2000-04-08 [t1, t2]
+        /pcr_t1/ds=2000-04-08 [$hdt$_0:t1, $hdt$_1:t1]
       Needs Tagging: true
       Reduce Operator Tree:
         Join Operator
           condition map:
                Inner Join 0 to 1
           keys:
-            0 key (type: int)
-            1 key (type: int)
-          outputColumnNames: _col0, _col1, _col6, _col7
+            0 _col0 (type: int)
+            1 _col0 (type: int)
+          outputColumnNames: _col0, _col1, _col3, _col4
           Statistics: Num rows: 11 Data size: 88 Basic stats: COMPLETE Column stats: NONE
-          Select Operator
-            expressions: _col0 (type: int), _col1 (type: string), _col6 (type: int), _col7 (type: string)
-            outputColumnNames: _col0, _col1, _col3, _col4
-            Statistics: Num rows: 11 Data size: 88 Basic stats: COMPLETE Column stats: NONE
-            File Output Operator
-              compressed: false
-              GlobalTableId: 0
+          File Output Operator
+            compressed: false
+            GlobalTableId: 0
 #### A masked pattern was here ####
-              NumFilesPerFileSink: 1
-              table:
-                  input format: org.apache.hadoop.mapred.SequenceFileInputFormat
-                  output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
-                  properties:
-                    columns _col0,_col1,_col3,_col4
-                    columns.types int,string,int,string
-                    escape.delim \
-                    serialization.lib org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe
-                  serde: org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe
-              TotalFiles: 1
-              GatherStats: false
-              MultiFileSpray: false
+            NumFilesPerFileSink: 1
+            table:
+                input format: org.apache.hadoop.mapred.SequenceFileInputFormat
+                output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
+                properties:
+                  columns _col0,_col1,_col3,_col4
+                  columns.types int,string,int,string
+                  escape.delim \
+                  serialization.lib org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe
+                serde: org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe
+            TotalFiles: 1
+            GatherStats: false
+            MultiFileSpray: false
 
   Stage: Stage-2
     Map Reduce
@@ -3010,30 +3014,38 @@ STAGE PLANS:
               isSamplingPred: false
               predicate: key is not null (type: boolean)
               Statistics: Num rows: 10 Data size: 80 Basic stats: COMPLETE Column stats: NONE
-              Reduce Output Operator
-                key expressions: key (type: int)
-                sort order: +
-                Map-reduce partition columns: key (type: int)
+              Select Operator
+                expressions: key (type: int), value (type: string)
+                outputColumnNames: _col0, _col1
                 Statistics: Num rows: 10 Data size: 80 Basic stats: COMPLETE Column stats: NONE
-                tag: 0
-                value expressions: value (type: string)
-                auto parallelism: false
+                Reduce Output Operator
+                  key expressions: _col0 (type: int)
+                  sort order: +
+                  Map-reduce partition columns: _col0 (type: int)
+                  Statistics: Num rows: 10 Data size: 80 Basic stats: COMPLETE Column stats: NONE
+                  tag: 0
+                  value expressions: _col1 (type: string)
+                  auto parallelism: false
           TableScan
-            alias: t2
+            alias: t1
             Statistics: Num rows: 20 Data size: 160 Basic stats: COMPLETE Column stats: NONE
             GatherStats: false
             Filter Operator
               isSamplingPred: false
               predicate: key is not null (type: boolean)
               Statistics: Num rows: 10 Data size: 80 Basic stats: COMPLETE Column stats: NONE
-              Reduce Output Operator
-                key expressions: key (type: int)
-                sort order: +
-                Map-reduce partition columns: key (type: int)
+              Select Operator
+                expressions: key (type: int), value (type: string)
+                outputColumnNames: _col0, _col1
                 Statistics: Num rows: 10 Data size: 80 Basic stats: COMPLETE Column stats: NONE
-                tag: 1
-                value expressions: value (type: string)
-                auto parallelism: false
+                Reduce Output Operator
+                  key expressions: _col0 (type: int)
+                  sort order: +
+                  Map-reduce partition columns: _col0 (type: int)
+                  Statistics: Num rows: 10 Data size: 80 Basic stats: COMPLETE Column stats: NONE
+                  tag: 1
+                  value expressions: _col1 (type: string)
+                  auto parallelism: false
       Path -> Alias:
 #### A masked pattern was here ####
       Path -> Partition:
@@ -3128,39 +3140,35 @@ STAGE PLANS:
               name: default.pcr_t1
             name: default.pcr_t1
       Truncated Path -> Alias:
-        /pcr_t1/ds=2000-04-08 [t1]
-        /pcr_t1/ds=2000-04-09 [t2]
+        /pcr_t1/ds=2000-04-08 [$hdt$_0:t1]
+        /pcr_t1/ds=2000-04-09 [$hdt$_1:t1]
       Needs Tagging: true
       Reduce Operator Tree:
         Join Operator
           condition map:
                Inner Join 0 to 1
           keys:
-            0 key (type: int)
-            1 key (type: int)
-          outputColumnNames: _col0, _col1, _col6, _col7
+            0 _col0 (type: int)
+            1 _col0 (type: int)
+          outputColumnNames: _col0, _col1, _col3, _col4
           Statistics: Num rows: 11 Data size: 88 Basic stats: COMPLETE Column stats: NONE
-          Select Operator
-            expressions: _col0 (type: int), _col1 (type: string), _col6 (type: int), _col7 (type: string)
-            outputColumnNames: _col0, _col1, _col3, _col4
-            Statistics: Num rows: 11 Data size: 88 Basic stats: COMPLETE Column stats: NONE
-            File Output Operator
-              compressed: false
-              GlobalTableId: 0
+          File Output Operator
+            compressed: false
+            GlobalTableId: 0
 #### A masked pattern was here ####
-              NumFilesPerFileSink: 1
-              table:
-                  input format: org.apache.hadoop.mapred.SequenceFileInputFormat
-                  output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
-                  properties:
-                    columns _col0,_col1,_col3,_col4
-                    columns.types int,string,int,string
-                    escape.delim \
-                    serialization.lib org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe
-                  serde: org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe
-              TotalFiles: 1
-              GatherStats: false
-              MultiFileSpray: false
+            NumFilesPerFileSink: 1
+            table:
+                input format: org.apache.hadoop.mapred.SequenceFileInputFormat
+                output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
+                properties:
+                  columns _col0,_col1,_col3,_col4
+                  columns.types int,string,int,string
+                  escape.delim \
+                  serialization.lib org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe
+                serde: org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe
+            TotalFiles: 1
+            GatherStats: false
+            MultiFileSpray: false
 
   Stage: Stage-2
     Map Reduce

http://git-wip-us.apache.org/repos/asf/hive/blob/7dab21ac/ql/src/test/results/clientpositive/pointlookup2.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/pointlookup2.q.out b/ql/src/test/results/clientpositive/pointlookup2.q.out
index d677327..b6270b3 100644
--- a/ql/src/test/results/clientpositive/pointlookup2.q.out
+++ b/ql/src/test/results/clientpositive/pointlookup2.q.out
@@ -388,30 +388,38 @@ STAGE PLANS:
               isSamplingPred: false
               predicate: key is not null (type: boolean)
               Statistics: Num rows: 10 Data size: 80 Basic stats: COMPLETE Column stats: NONE
-              Reduce Output Operator
-                key expressions: key (type: int)
-                sort order: +
-                Map-reduce partition columns: key (type: int)
+              Select Operator
+                expressions: key (type: int), value (type: string)
+                outputColumnNames: _col0, _col1
                 Statistics: Num rows: 10 Data size: 80 Basic stats: COMPLETE Column stats: NONE
-                tag: 0
-                value expressions: value (type: string)
-                auto parallelism: false
+                Reduce Output Operator
+                  key expressions: _col0 (type: int)
+                  sort order: +
+                  Map-reduce partition columns: _col0 (type: int)
+                  Statistics: Num rows: 10 Data size: 80 Basic stats: COMPLETE Column stats: NONE
+                  tag: 0
+                  value expressions: _col1 (type: string)
+                  auto parallelism: false
           TableScan
-            alias: t2
+            alias: t1
             Statistics: Num rows: 20 Data size: 160 Basic stats: COMPLETE Column stats: NONE
             GatherStats: false
             Filter Operator
               isSamplingPred: false
               predicate: key is not null (type: boolean)
               Statistics: Num rows: 10 Data size: 80 Basic stats: COMPLETE Column stats: NONE
-              Reduce Output Operator
-                key expressions: key (type: int)
-                sort order: +
-                Map-reduce partition columns: key (type: int)
+              Select Operator
+                expressions: key (type: int), value (type: string)
+                outputColumnNames: _col0, _col1
                 Statistics: Num rows: 10 Data size: 80 Basic stats: COMPLETE Column stats: NONE
-                tag: 1
-                value expressions: value (type: string)
-                auto parallelism: false
+                Reduce Output Operator
+                  key expressions: _col0 (type: int)
+                  sort order: +
+                  Map-reduce partition columns: _col0 (type: int)
+                  Statistics: Num rows: 10 Data size: 80 Basic stats: COMPLETE Column stats: NONE
+                  tag: 1
+                  value expressions: _col1 (type: string)
+                  auto parallelism: false
       Path -> Alias:
 #### A masked pattern was here ####
       Path -> Partition:
@@ -461,38 +469,34 @@ STAGE PLANS:
               name: default.pcr_t1
             name: default.pcr_t1
       Truncated Path -> Alias:
-        /pcr_t1/ds=2000-04-08 [t1, t2]
+        /pcr_t1/ds=2000-04-08 [$hdt$_0:t1, $hdt$_1:t1]
       Needs Tagging: true
       Reduce Operator Tree:
         Join Operator
           condition map:
                Inner Join 0 to 1
           keys:
-            0 key (type: int)
-            1 key (type: int)
-          outputColumnNames: _col0, _col1, _col6, _col7
+            0 _col0 (type: int)
+            1 _col0 (type: int)
+          outputColumnNames: _col0, _col1, _col3, _col4
           Statistics: Num rows: 11 Data size: 88 Basic stats: COMPLETE Column stats: NONE
-          Select Operator
-            expressions: _col0 (type: int), _col1 (type: string), _col6 (type: int), _col7 (type: string)
-            outputColumnNames: _col0, _col1, _col3, _col4
-            Statistics: Num rows: 11 Data size: 88 Basic stats: COMPLETE Column stats: NONE
-            File Output Operator
-              compressed: false
-              GlobalTableId: 0
+          File Output Operator
+            compressed: false
+            GlobalTableId: 0
 #### A masked pattern was here ####
-              NumFilesPerFileSink: 1
-              table:
-                  input format: org.apache.hadoop.mapred.SequenceFileInputFormat
-                  output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
-                  properties:
-                    columns _col0,_col1,_col3,_col4
-                    columns.types int,string,int,string
-                    escape.delim \
-                    serialization.lib org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe
-                  serde: org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe
-              TotalFiles: 1
-              GatherStats: false
-              MultiFileSpray: false
+            NumFilesPerFileSink: 1
+            table:
+                input format: org.apache.hadoop.mapred.SequenceFileInputFormat
+                output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
+                properties:
+                  columns _col0,_col1,_col3,_col4
+                  columns.types int,string,int,string
+                  escape.delim \
+                  serialization.lib org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe
+                serde: org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe
+            TotalFiles: 1
+            GatherStats: false
+            MultiFileSpray: false
 
   Stage: Stage-2
     Map Reduce
@@ -646,30 +650,38 @@ STAGE PLANS:
               isSamplingPred: false
               predicate: key is not null (type: boolean)
               Statistics: Num rows: 10 Data size: 80 Basic stats: COMPLETE Column stats: NONE
-              Reduce Output Operator
-                key expressions: key (type: int)
-                sort order: +
-                Map-reduce partition columns: key (type: int)
+              Select Operator
+                expressions: key (type: int), value (type: string)
+                outputColumnNames: _col0, _col1
                 Statistics: Num rows: 10 Data size: 80 Basic stats: COMPLETE Column stats: NONE
-                tag: 0
-                value expressions: value (type: string)
-                auto parallelism: false
+                Reduce Output Operator
+                  key expressions: _col0 (type: int)
+                  sort order: +
+                  Map-reduce partition columns: _col0 (type: int)
+                  Statistics: Num rows: 10 Data size: 80 Basic stats: COMPLETE Column stats: NONE
+                  tag: 0
+                  value expressions: _col1 (type: string)
+                  auto parallelism: false
           TableScan
-            alias: t2
+            alias: t1
             Statistics: Num rows: 20 Data size: 160 Basic stats: COMPLETE Column stats: NONE
             GatherStats: false
             Filter Operator
               isSamplingPred: false
               predicate: key is not null (type: boolean)
               Statistics: Num rows: 10 Data size: 80 Basic stats: COMPLETE Column stats: NONE
-              Reduce Output Operator
-                key expressions: key (type: int)
-                sort order: +
-                Map-reduce partition columns: key (type: int)
+              Select Operator
+                expressions: key (type: int), value (type: string)
+                outputColumnNames: _col0, _col1
                 Statistics: Num rows: 10 Data size: 80 Basic stats: COMPLETE Column stats: NONE
-                tag: 1
-                value expressions: value (type: string)
-                auto parallelism: false
+                Reduce Output Operator
+                  key expressions: _col0 (type: int)
+                  sort order: +
+                  Map-reduce partition columns: _col0 (type: int)
+                  Statistics: Num rows: 10 Data size: 80 Basic stats: COMPLETE Column stats: NONE
+                  tag: 1
+                  value expressions: _col1 (type: string)
+                  auto parallelism: false
       Path -> Alias:
 #### A masked pattern was here ####
       Path -> Partition:
@@ -764,39 +776,35 @@ STAGE PLANS:
               name: default.pcr_t1
             name: default.pcr_t1
       Truncated Path -> Alias:
-        /pcr_t1/ds=2000-04-08 [t1]
-        /pcr_t1/ds=2000-04-09 [t2]
+        /pcr_t1/ds=2000-04-08 [$hdt$_0:t1]
+        /pcr_t1/ds=2000-04-09 [$hdt$_1:t1]
       Needs Tagging: true
       Reduce Operator Tree:
         Join Operator
           condition map:
                Inner Join 0 to 1
           keys:
-            0 key (type: int)
-            1 key (type: int)
-          outputColumnNames: _col0, _col1, _col6, _col7
+            0 _col0 (type: int)
+            1 _col0 (type: int)
+          outputColumnNames: _col0, _col1, _col3, _col4
           Statistics: Num rows: 11 Data size: 88 Basic stats: COMPLETE Column stats: NONE
-          Select Operator
-            expressions: _col0 (type: int), _col1 (type: string), _col6 (type: int), _col7 (type: string)
-            outputColumnNames: _col0, _col1, _col3, _col4
-            Statistics: Num rows: 11 Data size: 88 Basic stats: COMPLETE Column stats: NONE
-            File Output Operator
-              compressed: false
-              GlobalTableId: 0
+          File Output Operator
+            compressed: false
+            GlobalTableId: 0
 #### A masked pattern was here ####
-              NumFilesPerFileSink: 1
-              table:
-                  input format: org.apache.hadoop.mapred.SequenceFileInputFormat
-                  output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
-                  properties:
-                    columns _col0,_col1,_col3,_col4
-                    columns.types int,string,int,string
-                    escape.delim \
-                    serialization.lib org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe
-                  serde: org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe
-              TotalFiles: 1
-              GatherStats: false
-              MultiFileSpray: false
+            NumFilesPerFileSink: 1
+            table:
+                input format: org.apache.hadoop.mapred.SequenceFileInputFormat
+                output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
+                properties:
+                  columns _col0,_col1,_col3,_col4
+                  columns.types int,string,int,string
+                  escape.delim \
+                  serialization.lib org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe
+                serde: org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe
+            TotalFiles: 1
+            GatherStats: false
+            MultiFileSpray: false
 
   Stage: Stage-2
     Map Reduce
@@ -870,7 +878,7 @@ STAGE PLANS:
       Processor Tree:
         ListSink
 
-Warning: Shuffle Join JOIN[4][tables = [t1, t2]] in Stage 'Stage-1:MAPRED' is a cross product
+Warning: Shuffle Join JOIN[9][tables = [$hdt$_0, $hdt$_1]] in Stage 'Stage-1:MAPRED' is a cross product
 PREHOOK: query: explain extended
 select *
 from pcr_t1 t1 join pcr_t2 t2
@@ -962,22 +970,38 @@ STAGE PLANS:
             alias: t1
             Statistics: Num rows: 40 Data size: 320 Basic stats: COMPLETE Column stats: NONE
             GatherStats: false
-            Reduce Output Operator
-              sort order: 
-              Statistics: Num rows: 40 Data size: 320 Basic stats: COMPLETE Column stats: NONE
-              tag: 0
-              value expressions: key (type: int), value (type: string), ds (type: string)
-              auto parallelism: false
+            Filter Operator
+              isSamplingPred: false
+              predicate: (ds) IN ('2000-04-08', '2000-04-09') (type: boolean)
+              Statistics: Num rows: 20 Data size: 160 Basic stats: COMPLETE Column stats: NONE
+              Select Operator
+                expressions: key (type: int), value (type: string), ds (type: string)
+                outputColumnNames: _col0, _col1, _col2
+                Statistics: Num rows: 20 Data size: 160 Basic stats: COMPLETE Column stats: NONE
+                Reduce Output Operator
+                  sort order: 
+                  Statistics: Num rows: 20 Data size: 160 Basic stats: COMPLETE Column stats: NONE
+                  tag: 0
+                  value expressions: _col0 (type: int), _col1 (type: string), _col2 (type: string)
+                  auto parallelism: false
           TableScan
             alias: t2
             Statistics: Num rows: 1 Data size: 18 Basic stats: COMPLETE Column stats: NONE
             GatherStats: false
-            Reduce Output Operator
-              sort order: 
+            Filter Operator
+              isSamplingPred: false
+              predicate: (key) IN (1, 2) (type: boolean)
               Statistics: Num rows: 1 Data size: 18 Basic stats: COMPLETE Column stats: NONE
-              tag: 1
-              value expressions: ds (type: string), key (type: int), value (type: string)
-              auto parallelism: false
+              Select Operator
+                expressions: ds (type: string), key (type: int), value (type: string)
+                outputColumnNames: _col0, _col1, _col2
+                Statistics: Num rows: 1 Data size: 18 Basic stats: COMPLETE Column stats: NONE
+                Reduce Output Operator
+                  sort order: 
+                  Statistics: Num rows: 1 Data size: 18 Basic stats: COMPLETE Column stats: NONE
+                  tag: 1
+                  value expressions: _col0 (type: string), _col1 (type: int), _col2 (type: string)
+                  auto parallelism: false
       Path -> Alias:
 #### A masked pattern was here ####
       Path -> Partition:
@@ -1116,9 +1140,9 @@ STAGE PLANS:
               name: default.pcr_t2
             name: default.pcr_t2
       Truncated Path -> Alias:
-        /pcr_t1/ds=2000-04-08 [t1]
-        /pcr_t1/ds=2000-04-09 [t1]
-        /pcr_t2 [t2]
+        /pcr_t1/ds=2000-04-08 [$hdt$_0:t1]
+        /pcr_t1/ds=2000-04-09 [$hdt$_0:t1]
+        /pcr_t2 [$hdt$_1:t2]
       Needs Tagging: true
       Reduce Operator Tree:
         Join Operator
@@ -1127,33 +1151,29 @@ STAGE PLANS:
           keys:
             0 
             1 
-          outputColumnNames: _col0, _col1, _col2, _col6, _col7, _col8
-          Statistics: Num rows: 44 Data size: 352 Basic stats: COMPLETE Column stats: NONE
+          outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5
+          Statistics: Num rows: 22 Data size: 176 Basic stats: COMPLETE Column stats: NONE
           Filter Operator
             isSamplingPred: false
-            predicate: (struct(_col7,_col2)) IN (const struct(1,'2000-04-08'), const struct(2,'2000-04-09')) (type: boolean)
-            Statistics: Num rows: 22 Data size: 176 Basic stats: COMPLETE Column stats: NONE
-            Select Operator
-              expressions: _col0 (type: int), _col1 (type: string), _col2 (type: string), _col6 (type: string), _col7 (type: int), _col8 (type: string)
-              outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5
-              Statistics: Num rows: 22 Data size: 176 Basic stats: COMPLETE Column stats: NONE
-              File Output Operator
-                compressed: false
-                GlobalTableId: 0
-#### A masked pattern was here ####
-                NumFilesPerFileSink: 1
-                table:
-                    input format: org.apache.hadoop.mapred.SequenceFileInputFormat
-                    output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
-                    properties:
-                      columns _col0,_col1,_col2,_col3,_col4,_col5
-                      columns.types int,string,string,string,int,string
-                      escape.delim \
-                      serialization.lib org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe
-                    serde: org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe
-                TotalFiles: 1
-                GatherStats: false
-                MultiFileSpray: false
+            predicate: (struct(_col4,_col2)) IN (const struct(1,'2000-04-08'), const struct(2,'2000-04-09')) (type: boolean)
+            Statistics: Num rows: 11 Data size: 88 Basic stats: COMPLETE Column stats: NONE
+            File Output Operator
+              compressed: false
+              GlobalTableId: 0
+#### A masked pattern was here ####
+              NumFilesPerFileSink: 1
+              table:
+                  input format: org.apache.hadoop.mapred.SequenceFileInputFormat
+                  output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
+                  properties:
+                    columns _col0,_col1,_col2,_col3,_col4,_col5
+                    columns.types int,string,string,string,int,string
+                    escape.delim \
+                    serialization.lib org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe
+                  serde: org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe
+              TotalFiles: 1
+              GatherStats: false
+              MultiFileSpray: false
 
   Stage: Stage-2
     Map Reduce
@@ -1163,7 +1183,7 @@ STAGE PLANS:
             Reduce Output Operator
               key expressions: _col4 (type: int), _col5 (type: string), _col2 (type: string)
               sort order: +++
-              Statistics: Num rows: 22 Data size: 176 Basic stats: COMPLETE Column stats: NONE
+              Statistics: Num rows: 11 Data size: 88 Basic stats: COMPLETE Column stats: NONE
               tag: -1
               value expressions: _col0 (type: int), _col1 (type: string), _col3 (type: string)
               auto parallelism: false
@@ -1197,13 +1217,13 @@ STAGE PLANS:
         Select Operator
           expressions: VALUE._col0 (type: int), VALUE._col1 (type: string), KEY.reducesinkkey2 (type: string), VALUE._col2 (type: string), KEY.reducesinkkey0 (type: int), KEY.reducesinkkey1 (type: string)
           outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5
-          Statistics: Num rows: 22 Data size: 176 Basic stats: COMPLETE Column stats: NONE
+          Statistics: Num rows: 11 Data size: 88 Basic stats: COMPLETE Column stats: NONE
           File Output Operator
             compressed: false
             GlobalTableId: 0
 #### A masked pattern was here ####
             NumFilesPerFileSink: 1
-            Statistics: Num rows: 22 Data size: 176 Basic stats: COMPLETE Column stats: NONE
+            Statistics: Num rows: 11 Data size: 88 Basic stats: COMPLETE Column stats: NONE
 #### A masked pattern was here ####
             table:
                 input format: org.apache.hadoop.mapred.TextInputFormat
@@ -1227,7 +1247,7 @@ STAGE PLANS:
       Processor Tree:
         ListSink
 
-Warning: Shuffle Join JOIN[4][tables = [t1, t2]] in Stage 'Stage-1:MAPRED' is a cross product
+Warning: Shuffle Join JOIN[9][tables = [$hdt$_0, $hdt$_1]] in Stage 'Stage-1:MAPRED' is a cross product
 PREHOOK: query: explain extended
 select *
 from pcr_t1 t1 join pcr_t2 t2
@@ -1319,22 +1339,38 @@ STAGE PLANS:
             alias: t1
             Statistics: Num rows: 60 Data size: 480 Basic stats: COMPLETE Column stats: NONE
             GatherStats: false
-            Reduce Output Operator
-              sort order: 
-              Statistics: Num rows: 60 Data size: 480 Basic stats: COMPLETE Column stats: NONE
-              tag: 0
-              value expressions: key (type: int), value (type: string), ds (type: string)
-              auto parallelism: false
+            Filter Operator
+              isSamplingPred: false
+              predicate: (key) IN (1, 2) (type: boolean)
+              Statistics: Num rows: 30 Data size: 240 Basic stats: COMPLETE Column stats: NONE
+              Select Operator
+                expressions: key (type: int), value (type: string), ds (type: string)
+                outputColumnNames: _col0, _col1, _col2
+                Statistics: Num rows: 30 Data size: 240 Basic stats: COMPLETE Column stats: NONE
+                Reduce Output Operator
+                  sort order: 
+                  Statistics: Num rows: 30 Data size: 240 Basic stats: COMPLETE Column stats: NONE
+                  tag: 0
+                  value expressions: _col0 (type: int), _col1 (type: string), _col2 (type: string)
+                  auto parallelism: false
           TableScan
             alias: t2
             Statistics: Num rows: 1 Data size: 18 Basic stats: COMPLETE Column stats: NONE
             GatherStats: false
-            Reduce Output Operator
-              sort order: 
+            Filter Operator
+              isSamplingPred: false
+              predicate: (ds) IN ('2000-04-08', '2000-04-09') (type: boolean)
               Statistics: Num rows: 1 Data size: 18 Basic stats: COMPLETE Column stats: NONE
-              tag: 1
-              value expressions: ds (type: string), key (type: int), value (type: string)
-              auto parallelism: false
+              Select Operator
+                expressions: ds (type: string), key (type: int), value (type: string)
+                outputColumnNames: _col0, _col1, _col2
+                Statistics: Num rows: 1 Data size: 18 Basic stats: COMPLETE Column stats: NONE
+                Reduce Output Operator
+                  sort order: 
+                  Statistics: Num rows: 1 Data size: 18 Basic stats: COMPLETE Column stats: NONE
+                  tag: 1
+                  value expressions: _col0 (type: string), _col1 (type: int), _col2 (type: string)
+                  auto parallelism: false
       Path -> Alias:
 #### A masked pattern was here ####
       Path -> Partition:
@@ -1518,10 +1554,10 @@ STAGE PLANS:
               name: default.pcr_t2
             name: default.pcr_t2
       Truncated Path -> Alias:
-        /pcr_t1/ds=2000-04-08 [t1]
-        /pcr_t1/ds=2000-04-09 [t1]
-        /pcr_t1/ds=2000-04-10 [t1]
-        /pcr_t2 [t2]
+        /pcr_t1/ds=2000-04-08 [$hdt$_0:t1]
+        /pcr_t1/ds=2000-04-09 [$hdt$_0:t1]
+        /pcr_t1/ds=2000-04-10 [$hdt$_0:t1]
+        /pcr_t2 [$hdt$_1:t2]
       Needs Tagging: true
       Reduce Operator Tree:
         Join Operator
@@ -1530,33 +1566,29 @@ STAGE PLANS:
           keys:
             0 
             1 
-          outputColumnNames: _col0, _col1, _col2, _col6, _col7, _col8
-          Statistics: Num rows: 66 Data size: 528 Basic stats: COMPLETE Column stats: NONE
+          outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5
+          Statistics: Num rows: 33 Data size: 264 Basic stats: COMPLETE Column stats: NONE
           Filter Operator
             isSamplingPred: false
-            predicate: (struct(_col0,_col6)) IN (const struct(1,'2000-04-08'), const struct(2,'2000-04-09')) (type: boolean)
-            Statistics: Num rows: 33 Data size: 264 Basic stats: COMPLETE Column stats: NONE
-            Select Operator
-              expressions: _col0 (type: int), _col1 (type: string), _col2 (type: string), _col6 (type: string), _col7 (type: int), _col8 (type: string)
-              outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5
-              Statistics: Num rows: 33 Data size: 264 Basic stats: COMPLETE Column stats: NONE
-              File Output Operator
-                compressed: false
-                GlobalTableId: 0
-#### A masked pattern was here ####
-                NumFilesPerFileSink: 1
-                table:
-                    input format: org.apache.hadoop.mapred.SequenceFileInputFormat
-                    output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
-                    properties:
-                      columns _col0,_col1,_col2,_col3,_col4,_col5
-                      columns.types int,string,string,string,int,string
-                      escape.delim \
-                      serialization.lib org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe
-                    serde: org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe
-                TotalFiles: 1
-                GatherStats: false
-                MultiFileSpray: false
+            predicate: (struct(_col0,_col3)) IN (const struct(1,'2000-04-08'), const struct(2,'2000-04-09')) (type: boolean)
+            Statistics: Num rows: 16 Data size: 128 Basic stats: COMPLETE Column stats: NONE
+            File Output Operator
+              compressed: false
+              GlobalTableId: 0
+#### A masked pattern was here ####
+              NumFilesPerFileSink: 1
+              table:
+                  input format: org.apache.hadoop.mapred.SequenceFileInputFormat
+                  output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
+                  properties:
+                    columns _col0,_col1,_col2,_col3,_col4,_col5
+                    columns.types int,string,string,string,int,string
+                    escape.delim \
+                    serialization.lib org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe
+                  serde: org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe
+              TotalFiles: 1
+              GatherStats: false
+              MultiFileSpray: false
 
   Stage: Stage-2
     Map Reduce
@@ -1566,7 +1598,7 @@ STAGE PLANS:
             Reduce Output Operator
               key expressions: _col0 (type: int), _col1 (type: string), _col3 (type: string)
               sort order: +++
-              Statistics: Num rows: 33 Data size: 264 Basic stats: COMPLETE Column stats: NONE
+              Statistics: Num rows: 16 Data size: 128 Basic stats: COMPLETE Column stats: NONE
               tag: -1
               value expressions: _col2 (type: string), _col4 (type: int), _col5 (type: string)
               auto parallelism: false
@@ -1600,13 +1632,13 @@ STAGE PLANS:
         Select Operator
           expressions: KEY.reducesinkkey0 (type: int), KEY.reducesinkkey1 (type: string), VALUE._col0 (type: string), KEY.reducesinkkey2 (type: string), VALUE._col1 (type: int), VALUE._col2 (type: string)
           outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5
-          Statistics: Num rows: 33 Data size: 264 Basic stats: COMPLETE Column stats: NONE
+          Statistics: Num rows: 16 Data size: 128 Basic stats: COMPLETE Column stats: NONE
           File Output Operator
             compressed: false
             GlobalTableId: 0
 #### A masked pattern was here ####
             NumFilesPerFileSink: 1
-            Statistics: Num rows: 33 Data size: 264 Basic stats: COMPLETE Column stats: NONE
+            Statistics: Num rows: 16 Data size: 128 Basic stats: COMPLETE Column stats: NONE
 #### A masked pattern was here ####
             table:
                 input format: org.apache.hadoop.mapred.TextInputFormat

http://git-wip-us.apache.org/repos/asf/hive/blob/7dab21ac/ql/src/test/results/clientpositive/pointlookup3.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/pointlookup3.q.out b/ql/src/test/results/clientpositive/pointlookup3.q.out
index 4cb3cba..a37e079 100644
--- a/ql/src/test/results/clientpositive/pointlookup3.q.out
+++ b/ql/src/test/results/clientpositive/pointlookup3.q.out
@@ -543,30 +543,38 @@ STAGE PLANS:
               isSamplingPred: false
               predicate: key is not null (type: boolean)
               Statistics: Num rows: 10 Data size: 80 Basic stats: COMPLETE Column stats: NONE
-              Reduce Output Operator
-                key expressions: key (type: int)
-                sort order: +
-                Map-reduce partition columns: key (type: int)
+              Select Operator
+                expressions: key (type: int), value (type: string), ds2 (type: string)
+                outputColumnNames: _col0, _col1, _col3
                 Statistics: Num rows: 10 Data size: 80 Basic stats: COMPLETE Column stats: NONE
-                tag: 0
-                value expressions: value (type: string), ds2 (type: string)
-                auto parallelism: false
+                Reduce Output Operator
+                  key expressions: _col0 (type: int)
+                  sort order: +
+                  Map-reduce partition columns: _col0 (type: int)
+                  Statistics: Num rows: 10 Data size: 80 Basic stats: COMPLETE Column stats: NONE
+                  tag: 0
+                  value expressions: _col1 (type: string), _col3 (type: string)
+                  auto parallelism: false
           TableScan
-            alias: t2
+            alias: t1
             Statistics: Num rows: 20 Data size: 160 Basic stats: COMPLETE Column stats: NONE
             GatherStats: false
             Filter Operator
               isSamplingPred: false
               predicate: key is not null (type: boolean)
               Statistics: Num rows: 10 Data size: 80 Basic stats: COMPLETE Column stats: NONE
-              Reduce Output Operator
-                key expressions: key (type: int)
-                sort order: +
-                Map-reduce partition columns: key (type: int)
+              Select Operator
+                expressions: key (type: int), value (type: string), ds1 (type: string)
+                outputColumnNames: _col0, _col1, _col2
                 Statistics: Num rows: 10 Data size: 80 Basic stats: COMPLETE Column stats: NONE
-                tag: 1
-                value expressions: value (type: string), ds1 (type: string)
-                auto parallelism: false
+                Reduce Output Operator
+                  key expressions: _col0 (type: int)
+                  sort order: +
+                  Map-reduce partition columns: _col0 (type: int)
+                  Statistics: Num rows: 10 Data size: 80 Basic stats: COMPLETE Column stats: NONE
+                  tag: 1
+                  value expressions: _col1 (type: string), _col2 (type: string)
+                  auto parallelism: false
       Path -> Alias:
 #### A masked pattern was here ####
       Path -> Partition:
@@ -617,38 +625,34 @@ STAGE PLANS:
               name: default.pcr_t1
             name: default.pcr_t1
       Truncated Path -> Alias:
-        /pcr_t1/ds1=2000-04-08/ds2=2001-04-08 [t1, t2]
+        /pcr_t1/ds1=2000-04-08/ds2=2001-04-08 [$hdt$_0:t1, $hdt$_1:t1]
       Needs Tagging: true
       Reduce Operator Tree:
         Join Operator
           condition map:
                Inner Join 0 to 1
           keys:
-            0 key (type: int)
-            1 key (type: int)
-          outputColumnNames: _col0, _col1, _col3, _col7, _col8, _col9
+            0 _col0 (type: int)
+            1 _col0 (type: int)
+          outputColumnNames: _col0, _col1, _col3, _col4, _col5, _col6
           Statistics: Num rows: 11 Data size: 88 Basic stats: COMPLETE Column stats: NONE
-          Select Operator
-            expressions: _col0 (type: int), _col1 (type: string), _col3 (type: string), _col7 (type: int), _col8 (type: string), _col9 (type: string)
-            outputColumnNames: _col0, _col1, _col3, _col4, _col5, _col6
-            Statistics: Num rows: 11 Data size: 88 Basic stats: COMPLETE Column stats: NONE
-            File Output Operator
-              compressed: false
-              GlobalTableId: 0
+          File Output Operator
+            compressed: false
+            GlobalTableId: 0
 #### A masked pattern was here ####
-              NumFilesPerFileSink: 1
-              table:
-                  input format: org.apache.hadoop.mapred.SequenceFileInputFormat
-                  output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
-                  properties:
-                    columns _col0,_col1,_col3,_col4,_col5,_col6
-                    columns.types int,string,string,int,string,string
-                    escape.delim \
-                    serialization.lib org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe
-                  serde: org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe
-              TotalFiles: 1
-              GatherStats: false
-              MultiFileSpray: false
+            NumFilesPerFileSink: 1
+            table:
+                input format: org.apache.hadoop.mapred.SequenceFileInputFormat
+                output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
+                properties:
+                  columns _col0,_col1,_col3,_col4,_col5,_col6
+                  columns.types int,string,string,int,string,string
+                  escape.delim \
+                  serialization.lib org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe
+                serde: org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe
+            TotalFiles: 1
+            GatherStats: false
+            MultiFileSpray: false
 
   Stage: Stage-2
     Map Reduce
@@ -802,30 +806,38 @@ STAGE PLANS:
               isSamplingPred: false
               predicate: key is not null (type: boolean)
               Statistics: Num rows: 10 Data size: 80 Basic stats: COMPLETE Column stats: NONE
-              Reduce Output Operator
-                key expressions: key (type: int)
-                sort order: +
-                Map-reduce partition columns: key (type: int)
+              Select Operator
+                expressions: key (type: int), value (type: string), ds2 (type: string)
+                outputColumnNames: _col0, _col1, _col3
                 Statistics: Num rows: 10 Data size: 80 Basic stats: COMPLETE Column stats: NONE
-                tag: 0
-                value expressions: value (type: string), ds2 (type: string)
-                auto parallelism: false
+                Reduce Output Operator
+                  key expressions: _col0 (type: int)
+                  sort order: +
+                  Map-reduce partition columns: _col0 (type: int)
+                  Statistics: Num rows: 10 Data size: 80 Basic stats: COMPLETE Column stats: NONE
+                  tag: 0
+                  value expressions: _col1 (type: string), _col3 (type: string)
+                  auto parallelism: false
           TableScan
-            alias: t2
+            alias: t1
             Statistics: Num rows: 20 Data size: 160 Basic stats: COMPLETE Column stats: NONE
             GatherStats: false
             Filter Operator
               isSamplingPred: false
               predicate: key is not null (type: boolean)
               Statistics: Num rows: 10 Data size: 80 Basic stats: COMPLETE Column stats: NONE
-              Reduce Output Operator
-                key expressions: key (type: int)
-                sort order: +
-                Map-reduce partition columns: key (type: int)
+              Select Operator
+                expressions: key (type: int), value (type: string), ds2 (type: string)
+                outputColumnNames: _col0, _col1, _col3
                 Statistics: Num rows: 10 Data size: 80 Basic stats: COMPLETE Column stats: NONE
-                tag: 1
-                value expressions: value (type: string), ds2 (type: string)
-                auto parallelism: false
+                Reduce Output Operator
+                  key expressions: _col0 (type: int)
+                  sort order: +
+                  Map-reduce partition columns: _col0 (type: int)
+                  Statistics: Num rows: 10 Data size: 80 Basic stats: COMPLETE Column stats: NONE
+                  tag: 1
+                  value expressions: _col1 (type: string), _col3 (type: string)
+                  auto parallelism: false
       Path -> Alias:
 #### A masked pattern was here ####
       Path -> Partition:
@@ -922,39 +934,35 @@ STAGE PLANS:
               name: default.pcr_t1
             name: default.pcr_t1
       Truncated Path -> Alias:
-        /pcr_t1/ds1=2000-04-08/ds2=2001-04-08 [t1]
-        /pcr_t1/ds1=2000-04-09/ds2=2001-04-09 [t2]
+        /pcr_t1/ds1=2000-04-08/ds2=2001-04-08 [$hdt$_0:t1]
+        /pcr_t1/ds1=2000-04-09/ds2=2001-04-09 [$hdt$_1:t1]
       Needs Tagging: true
       Reduce Operator Tree:
         Join Operator
           condition map:
                Inner Join 0 to 1
           keys:
-            0 key (type: int)
-            1 key (type: int)
-          outputColumnNames: _col0, _col1, _col3, _col7, _col8, _col10
+            0 _col0 (type: int)
+            1 _col0 (type: int)
+          outputColumnNames: _col0, _col1, _col3, _col4, _col5, _col7
           Statistics: Num rows: 11 Data size: 88 Basic stats: COMPLETE Column stats: NONE
-          Select Operator
-            expressions: _col0 (type: int), _col1 (type: string), _col3 (type: string), _col7 (type: int), _col8 (type: string), _col10 (type: string)
-            outputColumnNames: _col0, _col1, _col3, _col4, _col5, _col7
-            Statistics: Num rows: 11 Data size: 88 Basic stats: COMPLETE Column stats: NONE
-            File Output Operator
-              compressed: false
-              GlobalTableId: 0
+          File Output Operator
+            compressed: false
+            GlobalTableId: 0
 #### A masked pattern was here ####
-              NumFilesPerFileSink: 1
-              table:
-                  input format: org.apache.hadoop.mapred.SequenceFileInputFormat
-                  output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
-                  properties:
-                    columns _col0,_col1,_col3,_col4,_col5,_col7
-                    columns.types int,string,string,int,string,string
-                    escape.delim \
-                    serialization.lib org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe
-                  serde: org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe
-              TotalFiles: 1
-              GatherStats: false
-              MultiFileSpray: false
+            NumFilesPerFileSink: 1
+            table:
+                input format: org.apache.hadoop.mapred.SequenceFileInputFormat
+                output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
+                properties:
+                  columns _col0,_col1,_col3,_col4,_col5,_col7
+                  columns.types int,string,string,int,string,string
+                  escape.delim \
+                  serialization.lib org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe
+                serde: org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe
+            TotalFiles: 1
+            GatherStats: false
+            MultiFileSpray: false
 
   Stage: Stage-2
     Map Reduce
@@ -1028,7 +1036,7 @@ STAGE PLANS:
       Processor Tree:
         ListSink
 
-Warning: Shuffle Join JOIN[4][tables = [t1, t2]] in Stage 'Stage-1:MAPRED' is a cross product
+Warning: Shuffle Join JOIN[9][tables = [$hdt$_0, $hdt$_1]] in Stage 'Stage-1:MAPRED' is a cross product
 PREHOOK: query: explain extended
 select *
 from pcr_t1 t1 join pcr_t1 t2
@@ -1120,22 +1128,38 @@ STAGE PLANS:
             alias: t1
             Statistics: Num rows: 40 Data size: 320 Basic stats: COMPLETE Column stats: NONE
             GatherStats: false
-            Reduce Output Operator
-              sort order: 
-              Statistics: Num rows: 40 Data size: 320 Basic stats: COMPLETE Column stats: NONE
-              tag: 0
-              value expressions: key (type: int), value (type: string), ds1 (type: string), ds2 (type: string)
-              auto parallelism: false
+            Filter Operator
+              isSamplingPred: false
+              predicate: (ds1) IN ('2000-04-08', '2000-04-09') (type: boolean)
+              Statistics: Num rows: 20 Data size: 160 Basic stats: COMPLETE Column stats: NONE
+              Select Operator
+                expressions: key (type: int), value (type: string), ds1 (type: string), ds2 (type: string)
+                outputColumnNames: _col0, _col1, _col2, _col3
+                Statistics: Num rows: 20 Data size: 160 Basic stats: COMPLETE Column stats: NONE
+                Reduce Output Operator
+                  sort order: 
+                  Statistics: Num rows: 20 Data size: 160 Basic stats: COMPLETE Column stats: NONE
+                  tag: 0
+                  value expressions: _col0 (type: int), _col1 (type: string), _col2 (type: string), _col3 (type: string)
+                  auto parallelism: false
           TableScan
-            alias: t2
+            alias: t1
             Statistics: Num rows: 60 Data size: 480 Basic stats: COMPLETE Column stats: NONE
             GatherStats: false
-            Reduce Output Operator
-              sort order: 
-              Statistics: Num rows: 60 Data size: 480 Basic stats: COMPLETE Column stats: NONE
-              tag: 1
-              value expressions: key (type: int), value (type: string), ds1 (type: string), ds2 (type: string)
-              auto parallelism: false
+            Filter Operator
+              isSamplingPred: false
+              predicate: (key) IN (1, 2) (type: boolean)
+              Statistics: Num rows: 30 Data size: 240 Basic stats: COMPLETE Column stats: NONE
+              Select Operator
+                expressions: key (type: int), value (type: string), ds1 (type: string), ds2 (type: string)
+                outputColumnNames: _col0, _col1, _col2, _col3
+                Statistics: Num rows: 30 Data size: 240 Basic stats: COMPLETE Column stats: NONE
+                Reduce Output Operator
+                  sort order: 
+                  Statistics: Num rows: 30 Data size: 240 Basic stats: COMPLETE Column stats: NONE
+                  tag: 1
+                  value expressions: _col0 (type: int), _col1 (type: string), _col2 (type: string), _col3 (type: string)
+                  auto parallelism: false
       Path -> Alias:
 #### A masked pattern was here ####
       Path -> Partition:
@@ -1278,9 +1302,9 @@ STAGE PLANS:
               name: default.pcr_t1
             name: default.pcr_t1
       Truncated Path -> Alias:
-        /pcr_t1/ds1=2000-04-08/ds2=2001-04-08 [t1, t2]
-        /pcr_t1/ds1=2000-04-09/ds2=2001-04-09 [t1, t2]
-        /pcr_t1/ds1=2000-04-10/ds2=2001-04-10 [t2]
+        /pcr_t1/ds1=2000-04-08/ds2=2001-04-08 [$hdt$_0:t1, $hdt$_1:t1]
+        /pcr_t1/ds1=2000-04-09/ds2=2001-04-09 [$hdt$_0:t1, $hdt$_1:t1]
+        /pcr_t1/ds1=2000-04-10/ds2=2001-04-10 [$hdt$_1:t1]
       Needs Tagging: true
       Reduce Operator Tree:
         Join Operator
@@ -1289,33 +1313,29 @@ STAGE PLANS:
           keys:
             0 
             1 
-          outputColumnNames: _col0, _col1, _col2, _col3, _col7, _col8, _col9, _col10
-          Statistics: Num rows: 66 Data size: 528 Basic stats: COMPLETE Column stats: NONE
+          outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7
+          Statistics: Num rows: 33 Data size: 264 Basic stats: COMPLETE Column stats: NONE
           Filter Operator
             isSamplingPred: false
-            predicate: (struct(_col7,_col2)) IN (const struct(1,'2000-04-08'), const struct(2,'2000-04-09')) (type: boolean)
-            Statistics: Num rows: 33 Data size: 264 Basic stats: COMPLETE Column stats: NONE
-            Select Operator
-              expressions: _col0 (type: int), _col1 (type: string), _col2 (type: string), _col3 (type: string), _col7 (type: int), _col8 (type: string), _col9 (type: string), _col10 (type: string)
-              outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7
-              Statistics: Num rows: 33 Data size: 264 Basic stats: COMPLETE Column stats: NONE
-              File Output Operator
-                compressed: false
-                GlobalTableId: 0
-#### A masked pattern was here ####
-                NumFilesPerFileSink: 1
-                table:
-                    input format: org.apache.hadoop.mapred.SequenceFileInputFormat
-                    output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
-                    properties:
-                      columns _col0,_col1,_col2,_col3,_col4,_col5,_col6,_col7
-                      columns.types int,string,string,string,int,string,string,string
-                      escape.delim \
-                      serialization.lib org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe
-                    serde: org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe
-                TotalFiles: 1
-                GatherStats: false
-                MultiFileSpray: false
+            predicate: (struct(_col4,_col2)) IN (const struct(1,'2000-04-08'), const struct(2,'2000-04-09')) (type: boolean)
+            Statistics: Num rows: 16 Data size: 128 Basic stats: COMPLETE Column stats: NONE
+            File Output Operator
+              compressed: false
+              GlobalTableId: 0
+#### A masked pattern was here ####
+              NumFilesPerFileSink: 1
+              table:
+                  input format: org.apache.hadoop.mapred.SequenceFileInputFormat
+                  output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
+                  properties:
+                    columns _col0,_col1,_col2,_col3,_col4,_col5,_col6,_col7
+                    columns.types int,string,string,string,int,string,string,string
+                    escape.delim \
+                    serialization.lib org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe
+                  serde: org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe
+              TotalFiles: 1
+              GatherStats: false
+              MultiFileSpray: false
 
   Stage: Stage-2
     Map Reduce
@@ -1325,7 +1345,7 @@ STAGE PLANS:
             Reduce Output Operator
               key expressions: _col4 (type: int), _col5 (type: string), _col2 (type: string)
               sort order: +++
-              Statistics: Num rows: 33 Data size: 264 Basic stats: COMPLETE Column stats: NONE
+              Statistics: Num rows: 16 Data size: 128 Basic stats: COMPLETE Column stats: NONE
               tag: -1
               value expressions: _col0 (type: int), _col1 (type: string), _col3 (type: string), _col6 (type: string), _col7 (type: string)
               auto parallelism: false
@@ -1359,13 +1379,13 @@ STAGE PLANS:
         Select Operator
           expressions: VALUE._col0 (type: int), VALUE._col1 (type: string), KEY.reducesinkkey2 (type: string), VALUE._col2 (type: string), KEY.reducesinkkey0 (type: int), KEY.reducesinkkey1 (type: string), VALUE._col3 (type: string), VALUE._col4 (type: string)
           outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7
-          Statistics: Num rows: 33 Data size: 264 Basic stats: COMPLETE Column stats: NONE
+          Statistics: Num rows: 16 Data size: 128 Basic stats: COMPLETE Column stats: NONE
           File Output Operator
             compressed: false
             GlobalTableId: 0
 #### A masked pattern was here ####
             NumFilesPerFileSink: 1
-            Statistics: Num rows: 33 Data size: 264 Basic stats: COMPLETE Column stats: NONE
+            Statistics: Num rows: 16 Data size: 128 Basic stats: COMPLETE Column stats: NONE
 #### A masked pattern was here ####
             table:
                 input format: org.apache.hadoop.mapred.TextInputFormat