http://git-wip-us.apache.org/repos/asf/hive/blob/8f7c5788/ql/src/test/results/clientpositive/explain_rearrange.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/explain_rearrange.q.out 
b/ql/src/test/results/clientpositive/explain_rearrange.q.out
index 2e5f9e4..7d9434b 100644
--- a/ql/src/test/results/clientpositive/explain_rearrange.q.out
+++ b/ql/src/test/results/clientpositive/explain_rearrange.q.out
@@ -135,7 +135,7 @@ STAGE PLANS:
                 1 _col0 (type: int)
               outputColumnNames: _col0, _col1, _col3
               Select Operator
-                expressions: _col0 (type: int), _col1 (type: bigint), _col3 
(type: bigint)
+                expressions: _col0 (type: int), _col3 (type: bigint), _col1 
(type: bigint)
                 outputColumnNames: _col0, _col1, _col2
                 File Output Operator
                   compressed: false
@@ -190,7 +190,7 @@ STAGE PLANS:
                 1 _col0 (type: int)
               outputColumnNames: _col0, _col1, _col3
               Select Operator
-                expressions: _col0 (type: int), _col1 (type: bigint), _col3 
(type: bigint)
+                expressions: _col0 (type: int), _col3 (type: bigint), _col1 
(type: bigint)
                 outputColumnNames: _col0, _col1, _col2
                 File Output Operator
                   compressed: false
@@ -225,7 +225,7 @@ STAGE PLANS:
             1 _col0 (type: int)
           outputColumnNames: _col0, _col1, _col3
           Select Operator
-            expressions: _col0 (type: int), _col1 (type: bigint), _col3 (type: 
bigint)
+            expressions: _col0 (type: int), _col3 (type: bigint), _col1 (type: 
bigint)
             outputColumnNames: _col0, _col1, _col2
             File Output Operator
               compressed: false
@@ -404,7 +404,7 @@ STAGE PLANS:
                 1 _col0 (type: int)
               outputColumnNames: _col0, _col1, _col3
               Select Operator
-                expressions: _col0 (type: int), _col1 (type: bigint), _col3 
(type: bigint)
+                expressions: _col0 (type: int), _col3 (type: bigint), _col1 
(type: bigint)
                 outputColumnNames: _col0, _col1, _col2
                 File Output Operator
                   compressed: false
@@ -459,7 +459,7 @@ STAGE PLANS:
                 1 _col0 (type: int)
               outputColumnNames: _col0, _col1, _col3
               Select Operator
-                expressions: _col0 (type: int), _col1 (type: bigint), _col3 
(type: bigint)
+                expressions: _col0 (type: int), _col3 (type: bigint), _col1 
(type: bigint)
                 outputColumnNames: _col0, _col1, _col2
                 File Output Operator
                   compressed: false
@@ -494,7 +494,7 @@ STAGE PLANS:
             1 _col0 (type: int)
           outputColumnNames: _col0, _col1, _col3
           Select Operator
-            expressions: _col0 (type: int), _col1 (type: bigint), _col3 (type: 
bigint)
+            expressions: _col0 (type: int), _col3 (type: bigint), _col1 (type: 
bigint)
             outputColumnNames: _col0, _col1, _col2
             File Output Operator
               compressed: false
@@ -716,7 +716,7 @@ STAGE PLANS:
                 1 _col0 (type: int)
               outputColumnNames: _col0, _col1, _col3
               Select Operator
-                expressions: _col0 (type: int), _col1 (type: bigint), _col3 
(type: bigint)
+                expressions: _col0 (type: int), _col3 (type: bigint), _col1 
(type: bigint)
                 outputColumnNames: _col0, _col1, _col2
                 File Output Operator
                   compressed: false
@@ -753,7 +753,7 @@ STAGE PLANS:
                 1 _col0 (type: int)
               outputColumnNames: _col0, _col1, _col3
               Select Operator
-                expressions: _col0 (type: int), _col1 (type: bigint), _col3 
(type: bigint)
+                expressions: _col0 (type: int), _col3 (type: bigint), _col1 
(type: bigint)
                 outputColumnNames: _col0, _col1, _col2
                 File Output Operator
                   compressed: false
@@ -788,7 +788,7 @@ STAGE PLANS:
             1 _col0 (type: int)
           outputColumnNames: _col0, _col1, _col3
           Select Operator
-            expressions: _col0 (type: int), _col1 (type: bigint), _col3 (type: 
bigint)
+            expressions: _col0 (type: int), _col3 (type: bigint), _col1 (type: 
bigint)
             outputColumnNames: _col0, _col1, _col2
             File Output Operator
               compressed: false
@@ -1011,7 +1011,7 @@ STAGE PLANS:
             1 _col0 (type: int)
           outputColumnNames: _col0, _col1, _col3
           Select Operator
-            expressions: _col0 (type: int), _col1 (type: bigint), _col3 (type: 
bigint)
+            expressions: _col0 (type: int), _col3 (type: bigint), _col1 (type: 
bigint)
             outputColumnNames: _col0, _col1, _col2
             File Output Operator
               compressed: false
@@ -1032,7 +1032,7 @@ STAGE PLANS:
                 1 _col0 (type: int)
               outputColumnNames: _col0, _col1, _col3
               Select Operator
-                expressions: _col0 (type: int), _col1 (type: bigint), _col3 
(type: bigint)
+                expressions: _col0 (type: int), _col3 (type: bigint), _col1 
(type: bigint)
                 outputColumnNames: _col0, _col1, _col2
                 File Output Operator
                   compressed: false
@@ -1055,7 +1055,7 @@ STAGE PLANS:
                 1 _col0 (type: int)
               outputColumnNames: _col0, _col1, _col3
               Select Operator
-                expressions: _col0 (type: int), _col1 (type: bigint), _col3 
(type: bigint)
+                expressions: _col0 (type: int), _col3 (type: bigint), _col1 
(type: bigint)
                 outputColumnNames: _col0, _col1, _col2
                 File Output Operator
                   compressed: false

http://git-wip-us.apache.org/repos/asf/hive/blob/8f7c5788/ql/src/test/results/clientpositive/join19.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/join19.q.out 
b/ql/src/test/results/clientpositive/join19.q.out
index dd167ec..e83c776 100644
--- a/ql/src/test/results/clientpositive/join19.q.out
+++ b/ql/src/test/results/clientpositive/join19.q.out
@@ -120,8 +120,10 @@ ON (t66.subject=t55.object)
 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-2 depends on stages: Stage-1, Stage-5
+  Stage-3 depends on stages: Stage-2, Stage-7
+  Stage-5 is a root stage
+  Stage-7 is a root stage
   Stage-0 depends on stages: Stage-3
 
 STAGE PLANS:
@@ -129,22 +131,23 @@ STAGE PLANS:
     Map Reduce
       Map Operator Tree:
           TableScan
-            alias: t1
+            alias: t5
             Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column 
stats: NONE
             Filter Operator
-              predicate: ((predicate = 
'http://sofa.semanticweb.org/sofa/v1.0/system#__INSTANCEOF_REL') and (object = 
'http://ontos/OntosMiner/Common.English/ontology#Citation') and subject is not 
null) (type: boolean)
+              predicate: ((predicate = 
'http://www.ontosearch.com/2007/12/ontosofa-ns#_to') and subject is not null 
and object is not null) (type: boolean)
               Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column 
stats: NONE
               Select Operator
-                expressions: subject (type: string)
-                outputColumnNames: _col0
+                expressions: subject (type: string), object (type: string)
+                outputColumnNames: _col0, _col1
                 Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL 
Column stats: NONE
                 Reduce Output Operator
-                  key expressions: _col0 (type: string)
+                  key expressions: _col1 (type: string)
                   sort order: +
-                  Map-reduce partition columns: _col0 (type: string)
+                  Map-reduce partition columns: _col1 (type: string)
                   Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL 
Column stats: NONE
+                  value expressions: _col0 (type: string)
           TableScan
-            alias: t2
+            alias: t6
             Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column 
stats: NONE
             Filter Operator
               predicate: ((predicate = 
'http://sofa.semanticweb.org/sofa/v1.0/system#__LABEL_REL') and subject is not 
null) (type: boolean)
@@ -159,33 +162,48 @@ STAGE PLANS:
                   Map-reduce partition columns: _col0 (type: string)
                   Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL 
Column stats: NONE
                   value expressions: _col1 (type: string)
+      Reduce Operator Tree:
+        Join Operator
+          condition map:
+               Inner Join 0 to 1
+          keys:
+            0 _col1 (type: string)
+            1 _col0 (type: string)
+          outputColumnNames: _col0, _col1, _col3
+          Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL 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
-            alias: t3
-            Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column 
stats: NONE
-            Filter Operator
-              predicate: ((predicate = 
'http://www.ontosearch.com/2007/12/ontosofa-ns#_from') and object is not null 
and subject is not null) (type: boolean)
+            Reduce Output Operator
+              key expressions: _col0 (type: string)
+              sort order: +
+              Map-reduce partition columns: _col0 (type: string)
               Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column 
stats: NONE
-              Select Operator
-                expressions: subject (type: string), object (type: string)
-                outputColumnNames: _col0, _col1
-                Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL 
Column stats: NONE
-                Reduce Output Operator
-                  key expressions: _col1 (type: string)
-                  sort order: +
-                  Map-reduce partition columns: _col1 (type: string)
-                  Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL 
Column stats: NONE
-                  value expressions: _col0 (type: string)
+              value expressions: _col1 (type: string), _col3 (type: string)
+          TableScan
+            Reduce Output Operator
+              key expressions: _col2 (type: string)
+              sort order: +
+              Map-reduce partition columns: _col2 (type: string)
+              Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column 
stats: NONE
+              value expressions: _col0 (type: string), _col1 (type: string)
       Reduce Operator Tree:
         Join Operator
           condition map:
                Inner Join 0 to 1
-               Inner Join 0 to 2
           keys:
             0 _col0 (type: string)
-            1 _col0 (type: string)
-            2 _col1 (type: string)
-          outputColumnNames: _col0, _col2, _col3
-          Statistics: Num rows: 2 Data size: 0 Basic stats: PARTIAL Column 
stats: NONE
+            1 _col2 (type: string)
+          outputColumnNames: _col1, _col3, _col4, _col5
+          Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column 
stats: NONE
           File Output Operator
             compressed: false
             table:
@@ -193,58 +211,87 @@ STAGE PLANS:
                 output format: 
org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
                 serde: org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe
 
-  Stage: Stage-2
+  Stage: Stage-3
     Map Reduce
       Map Operator Tree:
           TableScan
             Reduce Output Operator
-              key expressions: _col3 (type: string)
+              key expressions: _col5 (type: string)
               sort order: +
-              Map-reduce partition columns: _col3 (type: string)
-              Statistics: Num rows: 2 Data size: 0 Basic stats: PARTIAL Column 
stats: NONE
-              value expressions: _col0 (type: string), _col2 (type: string)
+              Map-reduce partition columns: _col5 (type: string)
+              Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column 
stats: NONE
+              value expressions: _col1 (type: string), _col3 (type: string), 
_col4 (type: string)
           TableScan
-            alias: t4
+            Reduce Output Operator
+              key expressions: _col2 (type: string)
+              sort order: +
+              Map-reduce partition columns: _col2 (type: string)
+              Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column 
stats: NONE
+              value expressions: _col1 (type: string)
+      Reduce Operator Tree:
+        Join Operator
+          condition map:
+               Inner Join 0 to 1
+          keys:
+            0 _col5 (type: string)
+            1 _col2 (type: string)
+          outputColumnNames: _col1, _col3, _col4, _col8, _col9
+          Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column 
stats: NONE
+          Select Operator
+            expressions: _col9 (type: string), _col8 (type: string), _col4 
(type: string), _col1 (type: string), _col3 (type: string)
+            outputColumnNames: _col0, _col1, _col2, _col3, _col4
+            Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column 
stats: NONE
+            File Output Operator
+              compressed: false
+              Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL 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.lazy.LazySimpleSerDe
+
+  Stage: Stage-5
+    Map Reduce
+      Map Operator Tree:
+          TableScan
+            alias: t3
             Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column 
stats: NONE
             Filter Operator
-              predicate: ((predicate = 
'http://sofa.semanticweb.org/sofa/v1.0/system#__INSTANCEOF_REL') and (object = 
'http://ontos/OntosMiner/Common.English/ontology#Author') and subject is not 
null) (type: boolean)
+              predicate: ((predicate = 
'http://www.ontosearch.com/2007/12/ontosofa-ns#_from') and object is not null 
and subject is not null) (type: boolean)
               Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column 
stats: NONE
               Select Operator
-                expressions: subject (type: string)
-                outputColumnNames: _col0
+                expressions: subject (type: string), object (type: string)
+                outputColumnNames: _col0, _col1
                 Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL 
Column stats: NONE
                 Reduce Output Operator
                   key expressions: _col0 (type: string)
                   sort order: +
                   Map-reduce partition columns: _col0 (type: string)
                   Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL 
Column stats: NONE
+                  value expressions: _col1 (type: string)
           TableScan
-            alias: t5
+            alias: t4
             Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column 
stats: NONE
             Filter Operator
-              predicate: ((predicate = 
'http://www.ontosearch.com/2007/12/ontosofa-ns#_to') and subject is not null 
and object is not null) (type: boolean)
+              predicate: ((predicate = 
'http://sofa.semanticweb.org/sofa/v1.0/system#__INSTANCEOF_REL') and (object = 
'http://ontos/OntosMiner/Common.English/ontology#Author') and subject is not 
null) (type: boolean)
               Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column 
stats: NONE
               Select Operator
-                expressions: subject (type: string), object (type: string)
-                outputColumnNames: _col0, _col1
+                expressions: subject (type: string)
+                outputColumnNames: _col0
                 Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL 
Column stats: NONE
                 Reduce Output Operator
                   key expressions: _col0 (type: string)
                   sort order: +
                   Map-reduce partition columns: _col0 (type: string)
                   Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL 
Column stats: NONE
-                  value expressions: _col1 (type: string)
       Reduce Operator Tree:
         Join Operator
           condition map:
                Inner Join 0 to 1
-               Inner Join 1 to 2
           keys:
-            0 _col3 (type: string)
+            0 _col0 (type: string)
             1 _col0 (type: string)
-            2 _col0 (type: string)
-          outputColumnNames: _col0, _col2, _col3, _col7
-          Statistics: Num rows: 4 Data size: 0 Basic stats: PARTIAL Column 
stats: NONE
+          outputColumnNames: _col0, _col1, _col2
+          Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column 
stats: NONE
           File Output Operator
             compressed: false
             table:
@@ -252,18 +299,11 @@ STAGE PLANS:
                 output format: 
org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
                 serde: org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe
 
-  Stage: Stage-3
+  Stage: Stage-7
     Map Reduce
       Map Operator Tree:
           TableScan
-            Reduce Output Operator
-              key expressions: _col7 (type: string)
-              sort order: +
-              Map-reduce partition columns: _col7 (type: string)
-              Statistics: Num rows: 4 Data size: 0 Basic stats: PARTIAL Column 
stats: NONE
-              value expressions: _col0 (type: string), _col2 (type: string), 
_col3 (type: string)
-          TableScan
-            alias: t6
+            alias: t2
             Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column 
stats: NONE
             Filter Operator
               predicate: ((predicate = 
'http://sofa.semanticweb.org/sofa/v1.0/system#__LABEL_REL') and subject is not 
null) (type: boolean)
@@ -278,26 +318,36 @@ STAGE PLANS:
                   Map-reduce partition columns: _col0 (type: string)
                   Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL 
Column stats: NONE
                   value expressions: _col1 (type: string)
+          TableScan
+            alias: t1
+            Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column 
stats: NONE
+            Filter Operator
+              predicate: ((predicate = 
'http://sofa.semanticweb.org/sofa/v1.0/system#__INSTANCEOF_REL') and (object = 
'http://ontos/OntosMiner/Common.English/ontology#Citation') and subject is not 
null) (type: boolean)
+              Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column 
stats: NONE
+              Select Operator
+                expressions: subject (type: string)
+                outputColumnNames: _col0
+                Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL 
Column stats: NONE
+                Reduce Output Operator
+                  key expressions: _col0 (type: string)
+                  sort order: +
+                  Map-reduce partition columns: _col0 (type: string)
+                  Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL 
Column stats: NONE
       Reduce Operator Tree:
         Join Operator
           condition map:
                Inner Join 0 to 1
           keys:
-            0 _col7 (type: string)
+            0 _col0 (type: string)
             1 _col0 (type: string)
-          outputColumnNames: _col0, _col2, _col3, _col7, _col9
-          Statistics: Num rows: 4 Data size: 0 Basic stats: PARTIAL Column 
stats: NONE
-          Select Operator
-            expressions: _col0 (type: string), _col2 (type: string), _col3 
(type: string), _col7 (type: string), _col9 (type: string)
-            outputColumnNames: _col0, _col1, _col2, _col3, _col4
-            Statistics: Num rows: 4 Data size: 0 Basic stats: PARTIAL Column 
stats: NONE
-            File Output Operator
-              compressed: false
-              Statistics: Num rows: 4 Data size: 0 Basic stats: PARTIAL 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.lazy.LazySimpleSerDe
+          outputColumnNames: _col1, _col2
+          Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL 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-0
     Fetch Operator

http://git-wip-us.apache.org/repos/asf/hive/blob/8f7c5788/ql/src/test/results/clientpositive/join42.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/join42.q.out 
b/ql/src/test/results/clientpositive/join42.q.out
index 0cd31c6..11851a9 100644
--- a/ql/src/test/results/clientpositive/join42.q.out
+++ b/ql/src/test/results/clientpositive/join42.q.out
@@ -86,7 +86,7 @@ POSTHOOK: Output: default@acct
 POSTHOOK: Lineage: acct.acc_n EXPRESSION 
[(values__tmp__table__2)values__tmp__table__2.FieldSchema(name:tmp_values_col2, 
type:string, comment:), ]
 POSTHOOK: Lineage: acct.aid EXPRESSION 
[(values__tmp__table__2)values__tmp__table__2.FieldSchema(name:tmp_values_col1, 
type:string, comment:), ]
 POSTHOOK: Lineage: acct.brn EXPRESSION 
[(values__tmp__table__2)values__tmp__table__2.FieldSchema(name:tmp_values_col3, 
type:string, comment:), ]
-Warning: Shuffle Join JOIN[21][tables = [$hdt$_0, $hdt$_1, $hdt$_2]] in Stage 
'Stage-1:MAPRED' is a cross product
+Warning: Shuffle Join JOIN[28][tables = [$hdt$_0, $hdt$_1, $hdt$_2]] in Stage 
'Stage-1:MAPRED' is a cross product
 PREHOOK: query: explain select
   acct.ACC_N,
   acct.brn
@@ -115,15 +115,30 @@ WHERE
 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-2 depends on stages: Stage-1, Stage-6
+  Stage-5 is a root stage
+  Stage-6 depends on stages: Stage-5
+  Stage-0 depends on stages: Stage-2
 
 STAGE PLANS:
   Stage: Stage-1
     Map Reduce
       Map Operator Tree:
           TableScan
+            alias: acct
+            Statistics: Num rows: 3 Data size: 31 Basic stats: COMPLETE Column 
stats: NONE
+            Filter Operator
+              predicate: (aid is not null and brn is not null) (type: boolean)
+              Statistics: Num rows: 3 Data size: 31 Basic stats: COMPLETE 
Column stats: NONE
+              Select Operator
+                expressions: aid (type: int), acc_n (type: int), brn (type: 
int)
+                outputColumnNames: _col0, _col1, _col2
+                Statistics: Num rows: 3 Data size: 31 Basic stats: COMPLETE 
Column stats: NONE
+                Reduce Output Operator
+                  sort order: 
+                  Statistics: Num rows: 3 Data size: 31 Basic stats: COMPLETE 
Column stats: NONE
+                  value expressions: _col0 (type: int), _col1 (type: int), 
_col2 (type: int)
+          TableScan
             alias: l
             Statistics: Num rows: 1 Data size: 4 Basic stats: COMPLETE Column 
stats: NONE
             Filter Operator
@@ -135,20 +150,6 @@ STAGE PLANS:
                   sort order: 
                   Statistics: Num rows: 1 Data size: 4 Basic stats: COMPLETE 
Column stats: NONE
           TableScan
-            alias: la
-            Statistics: Num rows: 1 Data size: 14 Basic stats: COMPLETE Column 
stats: NONE
-            Filter Operator
-              predicate: ((4436 = loan_id) and aid is not null and pi_id is 
not null) (type: boolean)
-              Statistics: Num rows: 1 Data size: 14 Basic stats: COMPLETE 
Column stats: NONE
-              Select Operator
-                expressions: aid (type: int), pi_id (type: int)
-                outputColumnNames: _col1, _col2
-                Statistics: Num rows: 1 Data size: 14 Basic stats: COMPLETE 
Column stats: NONE
-                Reduce Output Operator
-                  sort order: 
-                  Statistics: Num rows: 1 Data size: 14 Basic stats: COMPLETE 
Column stats: NONE
-                  value expressions: _col1 (type: int), _col2 (type: int)
-          TableScan
             alias: fr
             Statistics: Num rows: 1 Data size: 4 Basic stats: COMPLETE Column 
stats: NONE
             Filter Operator
@@ -168,8 +169,8 @@ STAGE PLANS:
             0 
             1 
             2 
-          outputColumnNames: _col2, _col3
-          Statistics: Num rows: 1 Data size: 23 Basic stats: COMPLETE Column 
stats: NONE
+          outputColumnNames: _col0, _col1, _col2
+          Statistics: Num rows: 3 Data size: 58 Basic stats: COMPLETE Column 
stats: NONE
           File Output Operator
             compressed: false
             table:
@@ -182,11 +183,57 @@ STAGE PLANS:
       Map Operator Tree:
           TableScan
             Reduce Output Operator
-              key expressions: _col2 (type: int)
+              key expressions: _col0 (type: int)
               sort order: +
-              Map-reduce partition columns: _col2 (type: int)
-              Statistics: Num rows: 1 Data size: 23 Basic stats: COMPLETE 
Column stats: NONE
-              value expressions: _col3 (type: int)
+              Map-reduce partition columns: _col0 (type: int)
+              Statistics: Num rows: 3 Data size: 58 Basic stats: COMPLETE 
Column stats: NONE
+              value expressions: _col1 (type: int), _col2 (type: int)
+          TableScan
+            Reduce Output Operator
+              key expressions: _col3 (type: int)
+              sort order: +
+              Map-reduce partition columns: _col3 (type: int)
+              Statistics: Num rows: 1 Data size: 16 Basic stats: COMPLETE 
Column stats: NONE
+      Reduce Operator Tree:
+        Join Operator
+          condition map:
+               Inner Join 0 to 1
+          keys:
+            0 _col0 (type: int)
+            1 _col3 (type: int)
+          outputColumnNames: _col1, _col2
+          Statistics: Num rows: 3 Data size: 63 Basic stats: COMPLETE Column 
stats: NONE
+          Select Operator
+            expressions: _col1 (type: int), _col2 (type: int)
+            outputColumnNames: _col0, _col1
+            Statistics: Num rows: 3 Data size: 63 Basic stats: COMPLETE Column 
stats: NONE
+            File Output Operator
+              compressed: false
+              Statistics: Num rows: 3 Data size: 63 Basic stats: COMPLETE 
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.lazy.LazySimpleSerDe
+
+  Stage: Stage-5
+    Map Reduce
+      Map Operator Tree:
+          TableScan
+            alias: la
+            Statistics: Num rows: 1 Data size: 14 Basic stats: COMPLETE Column 
stats: NONE
+            Filter Operator
+              predicate: ((4436 = loan_id) and aid is not null and pi_id is 
not null) (type: boolean)
+              Statistics: Num rows: 1 Data size: 14 Basic stats: COMPLETE 
Column stats: NONE
+              Select Operator
+                expressions: aid (type: int), pi_id (type: int)
+                outputColumnNames: _col1, _col2
+                Statistics: Num rows: 1 Data size: 14 Basic stats: COMPLETE 
Column stats: NONE
+                Reduce Output Operator
+                  key expressions: _col1 (type: int)
+                  sort order: +
+                  Map-reduce partition columns: _col1 (type: int)
+                  Statistics: Num rows: 1 Data size: 14 Basic stats: COMPLETE 
Column stats: NONE
+                  value expressions: _col2 (type: int)
           TableScan
             alias: a
             Statistics: Num rows: 1 Data size: 4 Basic stats: COMPLETE Column 
stats: NONE
@@ -202,33 +249,15 @@ STAGE PLANS:
                   sort order: +
                   Map-reduce partition columns: _col0 (type: int)
                   Statistics: Num rows: 1 Data size: 4 Basic stats: COMPLETE 
Column stats: NONE
-          TableScan
-            alias: acct
-            Statistics: Num rows: 3 Data size: 31 Basic stats: COMPLETE Column 
stats: NONE
-            Filter Operator
-              predicate: (aid is not null and brn is not null) (type: boolean)
-              Statistics: Num rows: 3 Data size: 31 Basic stats: COMPLETE 
Column stats: NONE
-              Select Operator
-                expressions: aid (type: int), acc_n (type: int), brn (type: 
int)
-                outputColumnNames: _col0, _col1, _col2
-                Statistics: Num rows: 3 Data size: 31 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: 3 Data size: 31 Basic stats: COMPLETE 
Column stats: NONE
-                  value expressions: _col1 (type: int), _col2 (type: int)
       Reduce Operator Tree:
         Join Operator
           condition map:
                Inner Join 0 to 1
-               Inner Join 1 to 2
           keys:
-            0 _col2 (type: int)
+            0 _col1 (type: int)
             1 _col0 (type: int)
-            2 _col0 (type: int)
-          outputColumnNames: _col3, _col7, _col8
-          Statistics: Num rows: 6 Data size: 68 Basic stats: COMPLETE Column 
stats: NONE
+          outputColumnNames: _col2, _col3
+          Statistics: Num rows: 1 Data size: 15 Basic stats: COMPLETE Column 
stats: NONE
           File Output Operator
             compressed: false
             table:
@@ -236,16 +265,16 @@ STAGE PLANS:
                 output format: 
org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
                 serde: org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe
 
-  Stage: Stage-3
+  Stage: Stage-6
     Map Reduce
       Map Operator Tree:
           TableScan
             Reduce Output Operator
-              key expressions: _col3 (type: int)
+              key expressions: _col2 (type: int)
               sort order: +
-              Map-reduce partition columns: _col3 (type: int)
-              Statistics: Num rows: 6 Data size: 68 Basic stats: COMPLETE 
Column stats: NONE
-              value expressions: _col7 (type: int), _col8 (type: int)
+              Map-reduce partition columns: _col2 (type: int)
+              Statistics: Num rows: 1 Data size: 15 Basic stats: COMPLETE 
Column stats: NONE
+              value expressions: _col3 (type: int)
           TableScan
             alias: pi
             Statistics: Num rows: 1 Data size: 4 Basic stats: COMPLETE Column 
stats: NONE
@@ -266,21 +295,16 @@ STAGE PLANS:
           condition map:
                Inner Join 0 to 1
           keys:
-            0 _col3 (type: int)
+            0 _col2 (type: int)
             1 _col0 (type: int)
-          outputColumnNames: _col7, _col8
-          Statistics: Num rows: 6 Data size: 74 Basic stats: COMPLETE Column 
stats: NONE
-          Select Operator
-            expressions: _col7 (type: int), _col8 (type: int)
-            outputColumnNames: _col0, _col1
-            Statistics: Num rows: 6 Data size: 74 Basic stats: COMPLETE Column 
stats: NONE
-            File Output Operator
-              compressed: false
-              Statistics: Num rows: 6 Data size: 74 Basic stats: COMPLETE 
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.lazy.LazySimpleSerDe
+          outputColumnNames: _col3
+          Statistics: Num rows: 1 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-0
     Fetch Operator
@@ -288,7 +312,7 @@ STAGE PLANS:
       Processor Tree:
         ListSink
 
-Warning: Shuffle Join JOIN[21][tables = [$hdt$_0, $hdt$_1, $hdt$_2]] in Stage 
'Stage-1:MAPRED' is a cross product
+Warning: Shuffle Join JOIN[28][tables = [$hdt$_0, $hdt$_1, $hdt$_2]] in Stage 
'Stage-1:MAPRED' is a cross product
 PREHOOK: query: select
   acct.ACC_N,
   acct.brn

http://git-wip-us.apache.org/repos/asf/hive/blob/8f7c5788/ql/src/test/results/clientpositive/join43.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/join43.q.out 
b/ql/src/test/results/clientpositive/join43.q.out
index 24168ca..fac8a8c 100644
--- a/ql/src/test/results/clientpositive/join43.q.out
+++ b/ql/src/test/results/clientpositive/join43.q.out
@@ -209,46 +209,46 @@ from (
 ) list
 POSTHOOK: type: QUERY
 STAGE DEPENDENCIES:
-  Stage-1 is a root stage
-  Stage-2 depends on stages: Stage-1
+  Stage-2 is a root stage
   Stage-3 depends on stages: Stage-2
-  Stage-0 depends on stages: Stage-3
+  Stage-1 depends on stages: Stage-3
+  Stage-0 depends on stages: Stage-1
 
 STAGE PLANS:
-  Stage: Stage-1
+  Stage: Stage-2
     Map Reduce
       Map Operator Tree:
           TableScan
-            alias: purchase_history
-            Statistics: Num rows: 4 Data size: 57 Basic stats: COMPLETE Column 
stats: NONE
+            alias: cart_history
+            Statistics: Num rows: 6 Data size: 36 Basic stats: COMPLETE Column 
stats: NONE
             Filter Operator
               predicate: s is not null (type: boolean)
-              Statistics: Num rows: 4 Data size: 57 Basic stats: COMPLETE 
Column stats: NONE
+              Statistics: Num rows: 6 Data size: 36 Basic stats: COMPLETE 
Column stats: NONE
               Select Operator
                 expressions: s (type: string), time (type: int)
                 outputColumnNames: _col0, _col1
-                Statistics: Num rows: 4 Data size: 57 Basic stats: COMPLETE 
Column stats: NONE
+                Statistics: Num rows: 6 Data size: 36 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: 4 Data size: 57 Basic stats: COMPLETE 
Column stats: NONE
+                  Statistics: Num rows: 6 Data size: 36 Basic stats: COMPLETE 
Column stats: NONE
                   value expressions: _col1 (type: int)
           TableScan
-            alias: cart_history
-            Statistics: Num rows: 6 Data size: 36 Basic stats: COMPLETE Column 
stats: NONE
+            alias: purchase_history
+            Statistics: Num rows: 4 Data size: 57 Basic stats: COMPLETE Column 
stats: NONE
             Filter Operator
               predicate: s is not null (type: boolean)
-              Statistics: Num rows: 6 Data size: 36 Basic stats: COMPLETE 
Column stats: NONE
+              Statistics: Num rows: 4 Data size: 57 Basic stats: COMPLETE 
Column stats: NONE
               Select Operator
                 expressions: s (type: string), time (type: int)
                 outputColumnNames: _col0, _col1
-                Statistics: Num rows: 6 Data size: 36 Basic stats: COMPLETE 
Column stats: NONE
+                Statistics: Num rows: 4 Data size: 57 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: 6 Data size: 36 Basic stats: COMPLETE 
Column stats: NONE
+                  Statistics: Num rows: 4 Data size: 57 Basic stats: COMPLETE 
Column stats: NONE
                   value expressions: _col1 (type: int)
       Reduce Operator Tree:
         Join Operator
@@ -257,14 +257,14 @@ STAGE PLANS:
           keys:
             0 _col0 (type: string)
             1 _col0 (type: string)
-          outputColumnNames: _col0, _col1, _col3
+          outputColumnNames: _col1, _col2, _col3
           Statistics: Num rows: 6 Data size: 39 Basic stats: COMPLETE Column 
stats: NONE
           Filter Operator
-            predicate: (_col1 > _col3) (type: boolean)
+            predicate: (_col3 > _col1) (type: boolean)
             Statistics: Num rows: 2 Data size: 13 Basic stats: COMPLETE Column 
stats: NONE
             Group By Operator
-              aggregations: max(_col3)
-              keys: _col0 (type: string), _col1 (type: int)
+              aggregations: max(_col1)
+              keys: _col2 (type: string), _col3 (type: int)
               mode: hash
               outputColumnNames: _col0, _col1, _col2
               Statistics: Num rows: 2 Data size: 13 Basic stats: COMPLETE 
Column stats: NONE
@@ -275,7 +275,7 @@ STAGE PLANS:
                     output format: 
org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
                     serde: 
org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe
 
-  Stage: Stage-2
+  Stage: Stage-3
     Map Reduce
       Map Operator Tree:
           TableScan
@@ -306,16 +306,10 @@ STAGE PLANS:
                     output format: 
org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
                     serde: 
org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe
 
-  Stage: Stage-3
+  Stage: Stage-1
     Map Reduce
       Map Operator Tree:
           TableScan
-            Reduce Output Operator
-              key expressions: _col0 (type: string), _col2 (type: int)
-              sort order: ++
-              Map-reduce partition columns: _col0 (type: string), _col2 (type: 
int)
-              Statistics: Num rows: 1 Data size: 6 Basic stats: COMPLETE 
Column stats: NONE
-          TableScan
             alias: events
             Statistics: Num rows: 6 Data size: 79 Basic stats: COMPLETE Column 
stats: NONE
             Filter Operator
@@ -330,22 +324,32 @@ STAGE PLANS:
                   sort order: ++
                   Map-reduce partition columns: _col0 (type: string), _col1 
(type: int)
                   Statistics: Num rows: 6 Data size: 79 Basic stats: COMPLETE 
Column stats: NONE
+          TableScan
+            Reduce Output Operator
+              key expressions: _col0 (type: string), _col2 (type: int)
+              sort order: ++
+              Map-reduce partition columns: _col0 (type: string), _col2 (type: 
int)
+              Statistics: Num rows: 1 Data size: 6 Basic stats: COMPLETE 
Column stats: NONE
       Reduce Operator Tree:
         Join Operator
           condition map:
                Inner Join 0 to 1
           keys:
-            0 _col0 (type: string), _col2 (type: int)
-            1 _col0 (type: string), _col1 (type: int)
-          outputColumnNames: _col0
+            0 _col0 (type: string), _col1 (type: int)
+            1 _col0 (type: string), _col2 (type: int)
+          outputColumnNames: _col2
           Statistics: Num rows: 6 Data size: 86 Basic stats: COMPLETE Column 
stats: NONE
-          File Output Operator
-            compressed: false
+          Select Operator
+            expressions: _col2 (type: string)
+            outputColumnNames: _col0
             Statistics: Num rows: 6 Data size: 86 Basic stats: COMPLETE 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.lazy.LazySimpleSerDe
+            File Output Operator
+              compressed: false
+              Statistics: Num rows: 6 Data size: 86 Basic stats: COMPLETE 
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.lazy.LazySimpleSerDe
 
   Stage: Stage-0
     Fetch Operator
@@ -427,46 +431,46 @@ from (
 ) list
 POSTHOOK: type: QUERY
 STAGE DEPENDENCIES:
-  Stage-1 is a root stage
-  Stage-2 depends on stages: Stage-1
+  Stage-2 is a root stage
   Stage-3 depends on stages: Stage-2
-  Stage-0 depends on stages: Stage-3
+  Stage-1 depends on stages: Stage-3
+  Stage-0 depends on stages: Stage-1
 
 STAGE PLANS:
-  Stage: Stage-1
+  Stage: Stage-2
     Map Reduce
       Map Operator Tree:
           TableScan
-            alias: purchase_history
-            Statistics: Num rows: 4 Data size: 57 Basic stats: COMPLETE Column 
stats: NONE
+            alias: cart_history
+            Statistics: Num rows: 6 Data size: 36 Basic stats: COMPLETE Column 
stats: NONE
             Filter Operator
               predicate: s is not null (type: boolean)
-              Statistics: Num rows: 4 Data size: 57 Basic stats: COMPLETE 
Column stats: NONE
+              Statistics: Num rows: 6 Data size: 36 Basic stats: COMPLETE 
Column stats: NONE
               Select Operator
                 expressions: s (type: string), time (type: int)
                 outputColumnNames: _col0, _col1
-                Statistics: Num rows: 4 Data size: 57 Basic stats: COMPLETE 
Column stats: NONE
+                Statistics: Num rows: 6 Data size: 36 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: 4 Data size: 57 Basic stats: COMPLETE 
Column stats: NONE
+                  Statistics: Num rows: 6 Data size: 36 Basic stats: COMPLETE 
Column stats: NONE
                   value expressions: _col1 (type: int)
           TableScan
-            alias: cart_history
-            Statistics: Num rows: 6 Data size: 36 Basic stats: COMPLETE Column 
stats: NONE
+            alias: purchase_history
+            Statistics: Num rows: 4 Data size: 57 Basic stats: COMPLETE Column 
stats: NONE
             Filter Operator
               predicate: s is not null (type: boolean)
-              Statistics: Num rows: 6 Data size: 36 Basic stats: COMPLETE 
Column stats: NONE
+              Statistics: Num rows: 4 Data size: 57 Basic stats: COMPLETE 
Column stats: NONE
               Select Operator
                 expressions: s (type: string), time (type: int)
                 outputColumnNames: _col0, _col1
-                Statistics: Num rows: 6 Data size: 36 Basic stats: COMPLETE 
Column stats: NONE
+                Statistics: Num rows: 4 Data size: 57 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: 6 Data size: 36 Basic stats: COMPLETE 
Column stats: NONE
+                  Statistics: Num rows: 4 Data size: 57 Basic stats: COMPLETE 
Column stats: NONE
                   value expressions: _col1 (type: int)
       Reduce Operator Tree:
         Join Operator
@@ -475,14 +479,14 @@ STAGE PLANS:
           keys:
             0 _col0 (type: string)
             1 _col0 (type: string)
-          outputColumnNames: _col0, _col1, _col3
+          outputColumnNames: _col1, _col2, _col3
           Statistics: Num rows: 6 Data size: 39 Basic stats: COMPLETE Column 
stats: NONE
           Filter Operator
-            predicate: (_col1 > _col3) (type: boolean)
+            predicate: (_col3 > _col1) (type: boolean)
             Statistics: Num rows: 2 Data size: 13 Basic stats: COMPLETE Column 
stats: NONE
             Group By Operator
-              aggregations: max(_col3)
-              keys: _col0 (type: string), _col1 (type: int)
+              aggregations: max(_col1)
+              keys: _col2 (type: string), _col3 (type: int)
               mode: hash
               outputColumnNames: _col0, _col1, _col2
               Statistics: Num rows: 2 Data size: 13 Basic stats: COMPLETE 
Column stats: NONE
@@ -493,7 +497,7 @@ STAGE PLANS:
                     output format: 
org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
                     serde: 
org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe
 
-  Stage: Stage-2
+  Stage: Stage-3
     Map Reduce
       Map Operator Tree:
           TableScan
@@ -520,17 +524,10 @@ STAGE PLANS:
                   output format: 
org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
                   serde: 
org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe
 
-  Stage: Stage-3
+  Stage: Stage-1
     Map Reduce
       Map Operator Tree:
           TableScan
-            Reduce Output Operator
-              key expressions: _col0 (type: string), _col2 (type: int)
-              sort order: ++
-              Map-reduce partition columns: _col0 (type: string), _col2 (type: 
int)
-              Statistics: Num rows: 1 Data size: 6 Basic stats: COMPLETE 
Column stats: NONE
-              value expressions: _col1 (type: int)
-          TableScan
             alias: events
             Statistics: Num rows: 6 Data size: 79 Basic stats: COMPLETE Column 
stats: NONE
             Filter Operator
@@ -546,17 +543,24 @@ STAGE PLANS:
                   Map-reduce partition columns: _col0 (type: string), _col3 
(type: int)
                   Statistics: Num rows: 6 Data size: 79 Basic stats: COMPLETE 
Column stats: NONE
                   value expressions: _col1 (type: string), _col2 (type: int)
+          TableScan
+            Reduce Output Operator
+              key expressions: _col0 (type: string), _col2 (type: int)
+              sort order: ++
+              Map-reduce partition columns: _col0 (type: string), _col2 (type: 
int)
+              Statistics: Num rows: 1 Data size: 6 Basic stats: COMPLETE 
Column stats: NONE
+              value expressions: _col1 (type: int)
       Reduce Operator Tree:
         Join Operator
           condition map:
                Inner Join 0 to 1
           keys:
-            0 _col0 (type: string), _col2 (type: int)
-            1 _col0 (type: string), _col3 (type: int)
-          outputColumnNames: _col0, _col1, _col2, _col4, _col5
+            0 _col0 (type: string), _col3 (type: int)
+            1 _col0 (type: string), _col2 (type: int)
+          outputColumnNames: _col1, _col2, _col4, _col5, _col6
           Statistics: Num rows: 6 Data size: 86 Basic stats: COMPLETE Column 
stats: NONE
           Select Operator
-            expressions: _col0 (type: string), _col1 (type: int), _col2 (type: 
int), _col4 (type: string), _col5 (type: int)
+            expressions: _col4 (type: string), _col5 (type: int), _col6 (type: 
int), _col1 (type: string), _col2 (type: int)
             outputColumnNames: _col0, _col1, _col2, _col3, _col4
             Statistics: Num rows: 6 Data size: 86 Basic stats: COMPLETE Column 
stats: NONE
             File Output Operator

http://git-wip-us.apache.org/repos/asf/hive/blob/8f7c5788/ql/src/test/results/clientpositive/join_cond_pushdown_unqual1.q.out
----------------------------------------------------------------------
diff --git 
a/ql/src/test/results/clientpositive/join_cond_pushdown_unqual1.q.out 
b/ql/src/test/results/clientpositive/join_cond_pushdown_unqual1.q.out
index f77c75c..74f45e5 100644
--- a/ql/src/test/results/clientpositive/join_cond_pushdown_unqual1.q.out
+++ b/ql/src/test/results/clientpositive/join_cond_pushdown_unqual1.q.out
@@ -69,22 +69,6 @@ STAGE PLANS:
     Map Reduce
       Map Operator Tree:
           TableScan
-            alias: p1
-            Statistics: Num rows: 26 Data size: 3147 Basic stats: COMPLETE 
Column stats: NONE
-            Filter Operator
-              predicate: p_name is not null (type: boolean)
-              Statistics: Num rows: 26 Data size: 3147 Basic stats: COMPLETE 
Column stats: NONE
-              Select Operator
-                expressions: p_partkey (type: int), p_name (type: string), 
p_mfgr (type: string), p_brand (type: string), p_type (type: string), p_size 
(type: int), p_container (type: string), p_retailprice (type: double), 
p_comment (type: string)
-                outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, 
_col6, _col7, _col8
-                Statistics: Num rows: 26 Data size: 3147 Basic stats: COMPLETE 
Column stats: NONE
-                Reduce Output Operator
-                  key expressions: _col1 (type: string)
-                  sort order: +
-                  Map-reduce partition columns: _col1 (type: string)
-                  Statistics: Num rows: 26 Data size: 3147 Basic stats: 
COMPLETE Column stats: NONE
-                  value expressions: _col0 (type: int), _col2 (type: string), 
_col3 (type: string), _col4 (type: string), _col5 (type: int), _col6 (type: 
string), _col7 (type: double), _col8 (type: string)
-          TableScan
             alias: p2
             Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column 
stats: NONE
             Filter Operator
@@ -116,24 +100,44 @@ STAGE PLANS:
                   Map-reduce partition columns: _col1 (type: string)
                   Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL 
Column stats: NONE
                   value expressions: _col0 (type: int), _col2 (type: string), 
_col3 (type: string), _col4 (type: string), _col5 (type: int), _col6 (type: 
string), _col7 (type: double), _col8 (type: string)
+          TableScan
+            alias: p1
+            Statistics: Num rows: 26 Data size: 3147 Basic stats: COMPLETE 
Column stats: NONE
+            Filter Operator
+              predicate: p_name is not null (type: boolean)
+              Statistics: Num rows: 26 Data size: 3147 Basic stats: COMPLETE 
Column stats: NONE
+              Select Operator
+                expressions: p_partkey (type: int), p_name (type: string), 
p_mfgr (type: string), p_brand (type: string), p_type (type: string), p_size 
(type: int), p_container (type: string), p_retailprice (type: double), 
p_comment (type: string)
+                outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, 
_col6, _col7, _col8
+                Statistics: Num rows: 26 Data size: 3147 Basic stats: COMPLETE 
Column stats: NONE
+                Reduce Output Operator
+                  key expressions: _col1 (type: string)
+                  sort order: +
+                  Map-reduce partition columns: _col1 (type: string)
+                  Statistics: Num rows: 26 Data size: 3147 Basic stats: 
COMPLETE Column stats: NONE
+                  value expressions: _col0 (type: int), _col2 (type: string), 
_col3 (type: string), _col4 (type: string), _col5 (type: int), _col6 (type: 
string), _col7 (type: double), _col8 (type: string)
       Reduce Operator Tree:
         Join Operator
           condition map:
                Inner Join 0 to 1
-               Inner Join 1 to 2
+               Inner Join 0 to 2
           keys:
             0 _col1 (type: string)
             1 _col1 (type: string)
             2 _col1 (type: string)
           outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, 
_col7, _col8, _col9, _col10, _col11, _col12, _col13, _col14, _col15, _col16, 
_col17, _col18, _col19, _col20, _col21, _col22, _col23, _col24, _col25, _col26
           Statistics: Num rows: 57 Data size: 6923 Basic stats: COMPLETE 
Column stats: NONE
-          File Output Operator
-            compressed: false
+          Select Operator
+            expressions: _col18 (type: int), _col19 (type: string), _col20 
(type: string), _col21 (type: string), _col22 (type: string), _col23 (type: 
int), _col24 (type: string), _col25 (type: double), _col26 (type: string), 
_col0 (type: int), _col1 (type: string), _col2 (type: string), _col3 (type: 
string), _col4 (type: string), _col5 (type: int), _col6 (type: string), _col7 
(type: double), _col8 (type: string), _col9 (type: int), _col10 (type: string), 
_col11 (type: string), _col12 (type: string), _col13 (type: string), _col14 
(type: int), _col15 (type: string), _col16 (type: double), _col17 (type: string)
+            outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, 
_col6, _col7, _col8, _col9, _col10, _col11, _col12, _col13, _col14, _col15, 
_col16, _col17, _col18, _col19, _col20, _col21, _col22, _col23, _col24, _col25, 
_col26
             Statistics: Num rows: 57 Data size: 6923 Basic stats: COMPLETE 
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.lazy.LazySimpleSerDe
+            File Output Operator
+              compressed: false
+              Statistics: Num rows: 57 Data size: 6923 Basic stats: COMPLETE 
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.lazy.LazySimpleSerDe
 
   Stage: Stage-0
     Fetch Operator
@@ -156,22 +160,6 @@ STAGE PLANS:
     Map Reduce
       Map Operator Tree:
           TableScan
-            alias: p1
-            Statistics: Num rows: 26 Data size: 3147 Basic stats: COMPLETE 
Column stats: NONE
-            Filter Operator
-              predicate: p_name is not null (type: boolean)
-              Statistics: Num rows: 26 Data size: 3147 Basic stats: COMPLETE 
Column stats: NONE
-              Select Operator
-                expressions: p_partkey (type: int), p_name (type: string), 
p_mfgr (type: string), p_brand (type: string), p_type (type: string), p_size 
(type: int), p_container (type: string), p_retailprice (type: double), 
p_comment (type: string)
-                outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, 
_col6, _col7, _col8
-                Statistics: Num rows: 26 Data size: 3147 Basic stats: COMPLETE 
Column stats: NONE
-                Reduce Output Operator
-                  key expressions: _col1 (type: string)
-                  sort order: +
-                  Map-reduce partition columns: _col1 (type: string)
-                  Statistics: Num rows: 26 Data size: 3147 Basic stats: 
COMPLETE Column stats: NONE
-                  value expressions: _col0 (type: int), _col2 (type: string), 
_col3 (type: string), _col4 (type: string), _col5 (type: int), _col6 (type: 
string), _col7 (type: double), _col8 (type: string)
-          TableScan
             alias: p2
             Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column 
stats: NONE
             Filter Operator
@@ -203,24 +191,44 @@ STAGE PLANS:
                   Map-reduce partition columns: _col1 (type: string)
                   Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL 
Column stats: NONE
                   value expressions: _col0 (type: int), _col2 (type: string), 
_col3 (type: string), _col4 (type: string), _col5 (type: int), _col6 (type: 
string), _col7 (type: double), _col8 (type: string)
+          TableScan
+            alias: p1
+            Statistics: Num rows: 26 Data size: 3147 Basic stats: COMPLETE 
Column stats: NONE
+            Filter Operator
+              predicate: p_name is not null (type: boolean)
+              Statistics: Num rows: 26 Data size: 3147 Basic stats: COMPLETE 
Column stats: NONE
+              Select Operator
+                expressions: p_partkey (type: int), p_name (type: string), 
p_mfgr (type: string), p_brand (type: string), p_type (type: string), p_size 
(type: int), p_container (type: string), p_retailprice (type: double), 
p_comment (type: string)
+                outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, 
_col6, _col7, _col8
+                Statistics: Num rows: 26 Data size: 3147 Basic stats: COMPLETE 
Column stats: NONE
+                Reduce Output Operator
+                  key expressions: _col1 (type: string)
+                  sort order: +
+                  Map-reduce partition columns: _col1 (type: string)
+                  Statistics: Num rows: 26 Data size: 3147 Basic stats: 
COMPLETE Column stats: NONE
+                  value expressions: _col0 (type: int), _col2 (type: string), 
_col3 (type: string), _col4 (type: string), _col5 (type: int), _col6 (type: 
string), _col7 (type: double), _col8 (type: string)
       Reduce Operator Tree:
         Join Operator
           condition map:
                Inner Join 0 to 1
-               Inner Join 1 to 2
+               Inner Join 0 to 2
           keys:
             0 _col1 (type: string)
             1 _col1 (type: string)
             2 _col1 (type: string)
           outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, 
_col7, _col8, _col9, _col10, _col11, _col12, _col13, _col14, _col15, _col16, 
_col17, _col18, _col19, _col20, _col21, _col22, _col23, _col24, _col25, _col26
           Statistics: Num rows: 57 Data size: 6923 Basic stats: COMPLETE 
Column stats: NONE
-          File Output Operator
-            compressed: false
+          Select Operator
+            expressions: _col18 (type: int), _col19 (type: string), _col20 
(type: string), _col21 (type: string), _col22 (type: string), _col23 (type: 
int), _col24 (type: string), _col25 (type: double), _col26 (type: string), 
_col0 (type: int), _col1 (type: string), _col2 (type: string), _col3 (type: 
string), _col4 (type: string), _col5 (type: int), _col6 (type: string), _col7 
(type: double), _col8 (type: string), _col9 (type: int), _col10 (type: string), 
_col11 (type: string), _col12 (type: string), _col13 (type: string), _col14 
(type: int), _col15 (type: string), _col16 (type: double), _col17 (type: string)
+            outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, 
_col6, _col7, _col8, _col9, _col10, _col11, _col12, _col13, _col14, _col15, 
_col16, _col17, _col18, _col19, _col20, _col21, _col22, _col23, _col24, _col25, 
_col26
             Statistics: Num rows: 57 Data size: 6923 Basic stats: COMPLETE 
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.lazy.LazySimpleSerDe
+            File Output Operator
+              compressed: false
+              Statistics: Num rows: 57 Data size: 6923 Basic stats: COMPLETE 
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.lazy.LazySimpleSerDe
 
   Stage: Stage-0
     Fetch Operator
@@ -228,7 +236,7 @@ STAGE PLANS:
       Processor Tree:
         ListSink
 
-Warning: Shuffle Join JOIN[10][tables = [$hdt$_0, $hdt$_1]] in Stage 
'Stage-1:MAPRED' is a cross product
+Warning: Shuffle Join JOIN[13][tables = [$hdt$_1, $hdt$_2, $hdt$_0]] in Stage 
'Stage-2:MAPRED' is a cross product
 PREHOOK: query: explain select *
 from part p1 join part2 p2 join part3 p3 on p2_partkey + p_partkey = 
p1.p_partkey and p3_name = p2_name
 PREHOOK: type: QUERY
@@ -245,17 +253,6 @@ STAGE PLANS:
     Map Reduce
       Map Operator Tree:
           TableScan
-            alias: p1
-            Statistics: Num rows: 26 Data size: 3147 Basic stats: COMPLETE 
Column stats: NONE
-            Select Operator
-              expressions: p_partkey (type: int), p_name (type: string), 
p_mfgr (type: string), p_brand (type: string), p_type (type: string), p_size 
(type: int), p_container (type: string), p_retailprice (type: double), 
p_comment (type: string)
-              outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, 
_col6, _col7, _col8
-              Statistics: Num rows: 26 Data size: 3147 Basic stats: COMPLETE 
Column stats: NONE
-              Reduce Output Operator
-                sort order: 
-                Statistics: Num rows: 26 Data size: 3147 Basic stats: COMPLETE 
Column stats: NONE
-                value expressions: _col0 (type: int), _col1 (type: string), 
_col2 (type: string), _col3 (type: string), _col4 (type: string), _col5 (type: 
int), _col6 (type: string), _col7 (type: double), _col8 (type: string)
-          TableScan
             alias: p2
             Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column 
stats: NONE
             Filter Operator
@@ -266,38 +263,11 @@ STAGE PLANS:
                 outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, 
_col6, _col7, _col8
                 Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL 
Column stats: NONE
                 Reduce Output Operator
-                  sort order: 
+                  key expressions: _col1 (type: string)
+                  sort order: +
+                  Map-reduce partition columns: _col1 (type: string)
                   Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL 
Column stats: NONE
-                  value expressions: _col0 (type: int), _col1 (type: string), 
_col2 (type: string), _col3 (type: string), _col4 (type: string), _col5 (type: 
int), _col6 (type: string), _col7 (type: double), _col8 (type: string)
-      Reduce Operator Tree:
-        Join Operator
-          condition map:
-               Inner Join 0 to 1
-          keys:
-            0 
-            1 
-          outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, 
_col7, _col8, _col9, _col10, _col11, _col12, _col13, _col14, _col15, _col16, 
_col17
-          Statistics: Num rows: 26 Data size: 3173 Basic stats: COMPLETE 
Column stats: NONE
-          Filter Operator
-            predicate: ((_col9 + _col0) = _col0) (type: boolean)
-            Statistics: Num rows: 13 Data size: 1586 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: _col10 (type: string)
-              sort order: +
-              Map-reduce partition columns: _col10 (type: string)
-              Statistics: Num rows: 13 Data size: 1586 Basic stats: COMPLETE 
Column stats: NONE
-              value expressions: _col0 (type: int), _col1 (type: string), 
_col2 (type: string), _col3 (type: string), _col4 (type: string), _col5 (type: 
int), _col6 (type: string), _col7 (type: double), _col8 (type: string), _col9 
(type: int), _col11 (type: string), _col12 (type: string), _col13 (type: 
string), _col14 (type: int), _col15 (type: string), _col16 (type: double), 
_col17 (type: string)
+                  value expressions: _col0 (type: int), _col2 (type: string), 
_col3 (type: string), _col4 (type: string), _col5 (type: int), _col6 (type: 
string), _col7 (type: double), _col8 (type: string)
           TableScan
             alias: p3
             Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column 
stats: NONE
@@ -319,17 +289,59 @@ STAGE PLANS:
           condition map:
                Inner Join 0 to 1
           keys:
-            0 _col10 (type: string)
+            0 _col1 (type: string)
             1 _col1 (type: string)
-          outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, 
_col7, _col8, _col9, _col10, _col11, _col12, _col13, _col14, _col15, _col16, 
_col17, _col18, _col19, _col20, _col21, _col22, _col23, _col24, _col25, _col26
-          Statistics: Num rows: 14 Data size: 1744 Basic stats: COMPLETE 
Column stats: NONE
+          outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, 
_col7, _col8, _col9, _col10, _col11, _col12, _col13, _col14, _col15, _col16, 
_col17
+          Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column 
stats: NONE
           File Output Operator
             compressed: false
-            Statistics: Num rows: 14 Data size: 1744 Basic stats: COMPLETE 
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.lazy.LazySimpleSerDe
+                serde: org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe
+
+  Stage: Stage-2
+    Map Reduce
+      Map Operator Tree:
+          TableScan
+            Reduce Output Operator
+              sort order: 
+              Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column 
stats: NONE
+              value expressions: _col0 (type: int), _col1 (type: string), 
_col2 (type: string), _col3 (type: string), _col4 (type: string), _col5 (type: 
int), _col6 (type: string), _col7 (type: double), _col8 (type: string), _col9 
(type: int), _col10 (type: string), _col11 (type: string), _col12 (type: 
string), _col13 (type: string), _col14 (type: int), _col15 (type: string), 
_col16 (type: double), _col17 (type: string)
+          TableScan
+            alias: p1
+            Statistics: Num rows: 26 Data size: 3147 Basic stats: COMPLETE 
Column stats: NONE
+            Select Operator
+              expressions: p_partkey (type: int), p_name (type: string), 
p_mfgr (type: string), p_brand (type: string), p_type (type: string), p_size 
(type: int), p_container (type: string), p_retailprice (type: double), 
p_comment (type: string)
+              outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, 
_col6, _col7, _col8
+              Statistics: Num rows: 26 Data size: 3147 Basic stats: COMPLETE 
Column stats: NONE
+              Reduce Output Operator
+                sort order: 
+                Statistics: Num rows: 26 Data size: 3147 Basic stats: COMPLETE 
Column stats: NONE
+                value expressions: _col0 (type: int), _col1 (type: string), 
_col2 (type: string), _col3 (type: string), _col4 (type: string), _col5 (type: 
int), _col6 (type: string), _col7 (type: double), _col8 (type: string)
+      Reduce Operator Tree:
+        Join Operator
+          condition map:
+               Inner Join 0 to 1
+          keys:
+            0 
+            1 
+          outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, 
_col7, _col8, _col9, _col10, _col11, _col12, _col13, _col14, _col15, _col16, 
_col17, _col18, _col19, _col20, _col21, _col22, _col23, _col24, _col25, _col26
+          Statistics: Num rows: 26 Data size: 3173 Basic stats: COMPLETE 
Column stats: NONE
+          Filter Operator
+            predicate: ((_col0 + _col18) = _col18) (type: boolean)
+            Statistics: Num rows: 13 Data size: 1586 Basic stats: COMPLETE 
Column stats: NONE
+            Select Operator
+              expressions: _col18 (type: int), _col19 (type: string), _col20 
(type: string), _col21 (type: string), _col22 (type: string), _col23 (type: 
int), _col24 (type: string), _col25 (type: double), _col26 (type: string), 
_col0 (type: int), _col1 (type: string), _col2 (type: string), _col3 (type: 
string), _col4 (type: string), _col5 (type: int), _col6 (type: string), _col7 
(type: double), _col8 (type: string), _col9 (type: int), _col10 (type: string), 
_col11 (type: string), _col12 (type: string), _col13 (type: string), _col14 
(type: int), _col15 (type: string), _col16 (type: double), _col17 (type: string)
+              outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, 
_col6, _col7, _col8, _col9, _col10, _col11, _col12, _col13, _col14, _col15, 
_col16, _col17, _col18, _col19, _col20, _col21, _col22, _col23, _col24, _col25, 
_col26
+              Statistics: Num rows: 13 Data size: 1586 Basic stats: COMPLETE 
Column stats: NONE
+              File Output Operator
+                compressed: false
+                Statistics: Num rows: 13 Data size: 1586 Basic stats: COMPLETE 
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.lazy.LazySimpleSerDe
 
   Stage: Stage-0
     Fetch Operator
@@ -337,7 +349,7 @@ STAGE PLANS:
       Processor Tree:
         ListSink
 
-Warning: Shuffle Join JOIN[10][tables = [$hdt$_0, $hdt$_1]] in Stage 
'Stage-1:MAPRED' is a cross product
+Warning: Shuffle Join JOIN[13][tables = [$hdt$_1, $hdt$_2, $hdt$_0]] in Stage 
'Stage-2:MAPRED' is a cross product
 PREHOOK: query: explain select *
 from part p1 join part2 p2 join part3 p3 on p2_partkey = 1 and p3_name = 
p2_name
 PREHOOK: type: QUERY
@@ -354,16 +366,21 @@ STAGE PLANS:
     Map Reduce
       Map Operator Tree:
           TableScan
-            alias: p1
-            Statistics: Num rows: 26 Data size: 3147 Basic stats: COMPLETE 
Column stats: NONE
-            Select Operator
-              expressions: p_partkey (type: int), p_name (type: string), 
p_mfgr (type: string), p_brand (type: string), p_type (type: string), p_size 
(type: int), p_container (type: string), p_retailprice (type: double), 
p_comment (type: string)
-              outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, 
_col6, _col7, _col8
-              Statistics: Num rows: 26 Data size: 3147 Basic stats: COMPLETE 
Column stats: NONE
-              Reduce Output Operator
-                sort order: 
-                Statistics: Num rows: 26 Data size: 3147 Basic stats: COMPLETE 
Column stats: NONE
-                value expressions: _col0 (type: int), _col1 (type: string), 
_col2 (type: string), _col3 (type: string), _col4 (type: string), _col5 (type: 
int), _col6 (type: string), _col7 (type: double), _col8 (type: string)
+            alias: p3
+            Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column 
stats: NONE
+            Filter Operator
+              predicate: p3_name is not null (type: boolean)
+              Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column 
stats: NONE
+              Select Operator
+                expressions: p3_partkey (type: int), p3_name (type: string), 
p3_mfgr (type: string), p3_brand (type: string), p3_type (type: string), 
p3_size (type: int), p3_container (type: string), p3_retailprice (type: 
double), p3_comment (type: string)
+                outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, 
_col6, _col7, _col8
+                Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL 
Column stats: NONE
+                Reduce Output Operator
+                  key expressions: _col1 (type: string)
+                  sort order: +
+                  Map-reduce partition columns: _col1 (type: string)
+                  Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL 
Column stats: NONE
+                  value expressions: _col0 (type: int), _col2 (type: string), 
_col3 (type: string), _col4 (type: string), _col5 (type: int), _col6 (type: 
string), _col7 (type: double), _col8 (type: string)
           TableScan
             alias: p2
             Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column 
stats: NONE
@@ -375,18 +392,20 @@ STAGE PLANS:
                 outputColumnNames: _col1, _col2, _col3, _col4, _col5, _col6, 
_col7, _col8
                 Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL 
Column stats: NONE
                 Reduce Output Operator
-                  sort order: 
+                  key expressions: _col1 (type: string)
+                  sort order: +
+                  Map-reduce partition columns: _col1 (type: string)
                   Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL 
Column stats: NONE
-                  value expressions: _col1 (type: string), _col2 (type: 
string), _col3 (type: string), _col4 (type: string), _col5 (type: int), _col6 
(type: string), _col7 (type: double), _col8 (type: string)
+                  value expressions: _col2 (type: string), _col3 (type: 
string), _col4 (type: string), _col5 (type: int), _col6 (type: string), _col7 
(type: double), _col8 (type: string)
       Reduce Operator Tree:
         Join Operator
           condition map:
                Inner Join 0 to 1
           keys:
-            0 
-            1 
+            0 _col1 (type: string)
+            1 _col1 (type: string)
           outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, 
_col7, _col8, _col10, _col11, _col12, _col13, _col14, _col15, _col16, _col17
-          Statistics: Num rows: 26 Data size: 3173 Basic stats: COMPLETE 
Column stats: NONE
+          Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column 
stats: NONE
           File Output Operator
             compressed: false
             table:
@@ -399,43 +418,36 @@ STAGE PLANS:
       Map Operator Tree:
           TableScan
             Reduce Output Operator
-              key expressions: _col10 (type: string)
-              sort order: +
-              Map-reduce partition columns: _col10 (type: string)
-              Statistics: Num rows: 26 Data size: 3173 Basic stats: COMPLETE 
Column stats: NONE
-              value expressions: _col0 (type: int), _col1 (type: string), 
_col2 (type: string), _col3 (type: string), _col4 (type: string), _col5 (type: 
int), _col6 (type: string), _col7 (type: double), _col8 (type: string), _col11 
(type: string), _col12 (type: string), _col13 (type: string), _col14 (type: 
int), _col15 (type: string), _col16 (type: double), _col17 (type: string)
-          TableScan
-            alias: p3
-            Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column 
stats: NONE
-            Filter Operator
-              predicate: p3_name is not null (type: boolean)
+              sort order: 
               Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column 
stats: NONE
-              Select Operator
-                expressions: p3_partkey (type: int), p3_name (type: string), 
p3_mfgr (type: string), p3_brand (type: string), p3_type (type: string), 
p3_size (type: int), p3_container (type: string), p3_retailprice (type: 
double), p3_comment (type: string)
-                outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, 
_col6, _col7, _col8
-                Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL 
Column stats: NONE
-                Reduce Output Operator
-                  key expressions: _col1 (type: string)
-                  sort order: +
-                  Map-reduce partition columns: _col1 (type: string)
-                  Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL 
Column stats: NONE
-                  value expressions: _col0 (type: int), _col2 (type: string), 
_col3 (type: string), _col4 (type: string), _col5 (type: int), _col6 (type: 
string), _col7 (type: double), _col8 (type: string)
+              value expressions: _col0 (type: int), _col1 (type: string), 
_col2 (type: string), _col3 (type: string), _col4 (type: string), _col5 (type: 
int), _col6 (type: string), _col7 (type: double), _col8 (type: string), _col10 
(type: string), _col11 (type: string), _col12 (type: string), _col13 (type: 
string), _col14 (type: int), _col15 (type: string), _col16 (type: double), 
_col17 (type: string)
+          TableScan
+            alias: p1
+            Statistics: Num rows: 26 Data size: 3147 Basic stats: COMPLETE 
Column stats: NONE
+            Select Operator
+              expressions: p_partkey (type: int), p_name (type: string), 
p_mfgr (type: string), p_brand (type: string), p_type (type: string), p_size 
(type: int), p_container (type: string), p_retailprice (type: double), 
p_comment (type: string)
+              outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, 
_col6, _col7, _col8
+              Statistics: Num rows: 26 Data size: 3147 Basic stats: COMPLETE 
Column stats: NONE
+              Reduce Output Operator
+                sort order: 
+                Statistics: Num rows: 26 Data size: 3147 Basic stats: COMPLETE 
Column stats: NONE
+                value expressions: _col0 (type: int), _col1 (type: string), 
_col2 (type: string), _col3 (type: string), _col4 (type: string), _col5 (type: 
int), _col6 (type: string), _col7 (type: double), _col8 (type: string)
       Reduce Operator Tree:
         Join Operator
           condition map:
                Inner Join 0 to 1
           keys:
-            0 _col10 (type: string)
-            1 _col1 (type: string)
+            0 
+            1 
           outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, 
_col7, _col8, _col10, _col11, _col12, _col13, _col14, _col15, _col16, _col17, 
_col18, _col19, _col20, _col21, _col22, _col23, _col24, _col25, _col26
-          Statistics: Num rows: 28 Data size: 3490 Basic stats: COMPLETE 
Column stats: NONE
+          Statistics: Num rows: 26 Data size: 3173 Basic stats: COMPLETE 
Column stats: NONE
           Select Operator
-            expressions: _col0 (type: int), _col1 (type: string), _col2 (type: 
string), _col3 (type: string), _col4 (type: string), _col5 (type: int), _col6 
(type: string), _col7 (type: double), _col8 (type: string), 1 (type: int), 
_col10 (type: string), _col11 (type: string), _col12 (type: string), _col13 
(type: string), _col14 (type: int), _col15 (type: string), _col16 (type: 
double), _col17 (type: string), _col18 (type: int), _col19 (type: string), 
_col20 (type: string), _col21 (type: string), _col22 (type: string), _col23 
(type: int), _col24 (type: string), _col25 (type: double), _col26 (type: string)
+            expressions: _col18 (type: int), _col19 (type: string), _col20 
(type: string), _col21 (type: string), _col22 (type: string), _col23 (type: 
int), _col24 (type: string), _col25 (type: double), _col26 (type: string), 1 
(type: int), _col10 (type: string), _col11 (type: string), _col12 (type: 
string), _col13 (type: string), _col14 (type: int), _col15 (type: string), 
_col16 (type: double), _col17 (type: string), _col0 (type: int), _col1 (type: 
string), _col2 (type: string), _col3 (type: string), _col4 (type: string), 
_col5 (type: int), _col6 (type: string), _col7 (type: double), _col8 (type: 
string)
             outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, 
_col6, _col7, _col8, _col9, _col10, _col11, _col12, _col13, _col14, _col15, 
_col16, _col17, _col18, _col19, _col20, _col21, _col22, _col23, _col24, _col25, 
_col26
-            Statistics: Num rows: 28 Data size: 3490 Basic stats: COMPLETE 
Column stats: NONE
+            Statistics: Num rows: 26 Data size: 3173 Basic stats: COMPLETE 
Column stats: NONE
             File Output Operator
               compressed: false
-              Statistics: Num rows: 28 Data size: 3490 Basic stats: COMPLETE 
Column stats: NONE
+              Statistics: Num rows: 26 Data size: 3173 Basic stats: COMPLETE 
Column stats: NONE
               table:
                   input format: 
org.apache.hadoop.mapred.SequenceFileInputFormat
                   output format: 
org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat

Reply via email to