hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jcama...@apache.org
Subject [3/9] hive git commit: HIVE-13982: Extensions to RS dedup: execute with different column order and sorting direction if possible (Jesus Camacho Rodriguez, reviewed by Ashutosh Chauhan)
Date Sun, 26 Jun 2016 02:16:44 GMT
http://git-wip-us.apache.org/repos/asf/hive/blob/a70c82fd/ql/src/test/results/clientpositive/tez/explainuser_2.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/tez/explainuser_2.q.out b/ql/src/test/results/clientpositive/tez/explainuser_2.q.out
index 5530660..26f96b1 100644
--- a/ql/src/test/results/clientpositive/tez/explainuser_2.q.out
+++ b/ql/src/test/results/clientpositive/tez/explainuser_2.q.out
@@ -308,123 +308,121 @@ Stage-0
             Output:["_col0","_col1","_col2","_col3","_col4","_col5"]
           <-Reducer 4 [SIMPLE_EDGE]
             SHUFFLE [RS_52]
-              Select Operator [SEL_51] (rows=805 width=10)
-                Output:["_col0","_col1","_col2","_col3","_col4","_col5"]
-                Group By Operator [GBY_50] (rows=805 width=10)
-                  Output:["_col0","_col1","_col2","_col3","_col4","_col5"],aggregations:["count(VALUE._col0)","count(VALUE._col1)","count(VALUE._col2)"],keys:KEY._col0, KEY._col1, KEY._col2
-                <-Reducer 3 [SIMPLE_EDGE]
-                  SHUFFLE [RS_49]
-                    PartitionCols:_col0, _col1, _col2
-                    Group By Operator [GBY_48] (rows=1610 width=10)
-                      Output:["_col0","_col1","_col2","_col3","_col4","_col5"],aggregations:["count(_col13)","count(_col21)","count(_col3)"],keys:_col2, _col12, _col20
-                      Select Operator [SEL_47] (rows=1610 width=10)
-                        Output:["_col2","_col12","_col20","_col13","_col21","_col3"]
-                        Merge Join Operator [MERGEJOIN_97] (rows=1610 width=10)
-                          Conds:RS_44._col1, _col3=RS_45._col15, _col17(Inner),Output:["_col2","_col3","_col12","_col13","_col20","_col21"]
-                        <-Reducer 11 [SIMPLE_EDGE]
-                          SHUFFLE [RS_45]
-                            PartitionCols:_col15, _col17
-                            Select Operator [SEL_40] (rows=1464 width=10)
-                              Output:["_col14","_col15","_col17","_col6","_col7"]
-                              Merge Join Operator [MERGEJOIN_96] (rows=1464 width=10)
-                                Conds:RS_37._col4, _col6=RS_38._col2, _col4(Inner),Output:["_col2","_col3","_col14","_col15","_col17"]
-                              <-Reducer 10 [SIMPLE_EDGE]
-                                SHUFFLE [RS_37]
-                                  PartitionCols:_col4, _col6
-                                  Merge Join Operator [MERGEJOIN_94] (rows=1331 width=10)
-                                    Conds:RS_34._col3=RS_35._col1(Inner),Output:["_col2","_col3","_col4","_col6"]
-                                  <-Map 14 [SIMPLE_EDGE]
-                                    SHUFFLE [RS_35]
-                                      PartitionCols:_col1
-                                      Select Operator [SEL_17] (rows=12 width=7)
-                                        Output:["_col1"]
-                                        Filter Operator [FIL_88] (rows=12 width=7)
-                                          predicate:((key = 'src1key') and value is not null)
-                                          TableScan [TS_15] (rows=25 width=7)
-                                            default@src1,src1,Tbl:COMPLETE,Col:NONE,Output:["key","value"]
-                                  <-Reducer 9 [SIMPLE_EDGE]
-                                    SHUFFLE [RS_34]
-                                      PartitionCols:_col3
-                                      Merge Join Operator [MERGEJOIN_93] (rows=1210 width=10)
-                                        Conds:RS_31._col2=RS_32._col0(Inner),Output:["_col2","_col3","_col4","_col6"]
-                                      <-Map 13 [SIMPLE_EDGE]
-                                        SHUFFLE [RS_32]
-                                          PartitionCols:_col0
-                                          Select Operator [SEL_14] (rows=250 width=10)
-                                            Output:["_col0"]
-                                            Filter Operator [FIL_87] (rows=250 width=10)
-                                              predicate:((value = 'd1value') and key is not null)
-                                              TableScan [TS_12] (rows=500 width=10)
-                                                default@src,d1,Tbl:COMPLETE,Col:NONE,Output:["key","value"]
-                                      <-Reducer 8 [SIMPLE_EDGE]
-                                        SHUFFLE [RS_31]
-                                          PartitionCols:_col2
-                                          Merge Join Operator [MERGEJOIN_92] (rows=1100 width=10)
-                                            Conds:RS_28._col1=RS_29._col3(Inner),Output:["_col2","_col3","_col4","_col6"]
-                                          <-Map 12 [SIMPLE_EDGE]
-                                            SHUFFLE [RS_29]
-                                              PartitionCols:_col3
-                                              Select Operator [SEL_11] (rows=42 width=34)
-                                                Output:["_col0","_col1","_col2","_col3","_col4"]
-                                                Filter Operator [FIL_86] (rows=42 width=34)
-                                                  predicate:((v3 = 'ssv3') and k2 is not null and k3 is not null and k1 is not null and v1 is not null and v2 is not null)
-                                                  TableScan [TS_9] (rows=85 width=34)
-                                                    default@ss,ss,Tbl:COMPLETE,Col:NONE,Output:["k1","v1","k2","v2","k3","v3"]
-                                          <-Map 7 [SIMPLE_EDGE]
-                                            SHUFFLE [RS_28]
-                                              PartitionCols:_col1
-                                              Select Operator [SEL_8] (rows=1000 width=10)
-                                                Output:["_col1"]
-                                                Filter Operator [FIL_85] (rows=1000 width=10)
-                                                  predicate:((key = 'srcpartkey') and value is not null)
-                                                  TableScan [TS_6] (rows=2000 width=10)
-                                                    default@srcpart,srcpart,Tbl:COMPLETE,Col:NONE,Output:["key","value"]
-                              <-Reducer 16 [SIMPLE_EDGE]
-                                SHUFFLE [RS_38]
-                                  PartitionCols:_col2, _col4
-                                  Merge Join Operator [MERGEJOIN_95] (rows=275 width=10)
-                                    Conds:RS_24._col0=RS_25._col0(Inner),Output:["_col2","_col3","_col4","_col5"]
-                                  <-Map 15 [SIMPLE_EDGE]
-                                    SHUFFLE [RS_24]
-                                      PartitionCols:_col0
-                                      Select Operator [SEL_20] (rows=42 width=34)
-                                        Output:["_col0","_col2","_col3","_col4","_col5"]
-                                        Filter Operator [FIL_89] (rows=42 width=34)
-                                          predicate:((v1 = 'srv1') and k2 is not null and k3 is not null and v2 is not null and v3 is not null and k1 is not null)
-                                          TableScan [TS_18] (rows=85 width=34)
-                                            default@sr,sr,Tbl:COMPLETE,Col:NONE,Output:["k1","v1","k2","v2","k3","v3"]
-                                  <-Map 17 [SIMPLE_EDGE]
-                                    SHUFFLE [RS_25]
-                                      PartitionCols:_col0
-                                      Select Operator [SEL_23] (rows=250 width=10)
-                                        Output:["_col0"]
-                                        Filter Operator [FIL_90] (rows=250 width=10)
-                                          predicate:((value) IN ('2000Q1', '2000Q2', '2000Q3') and key is not null)
-                                          TableScan [TS_21] (rows=500 width=10)
-                                            default@src,d1,Tbl:COMPLETE,Col:NONE,Output:["key","value"]
-                        <-Reducer 2 [SIMPLE_EDGE]
-                          SHUFFLE [RS_44]
-                            PartitionCols:_col1, _col3
-                            Merge Join Operator [MERGEJOIN_91] (rows=275 width=10)
-                              Conds:RS_41._col0=RS_42._col0(Inner),Output:["_col1","_col2","_col3"]
-                            <-Map 1 [SIMPLE_EDGE]
-                              SHUFFLE [RS_41]
-                                PartitionCols:_col0
-                                Select Operator [SEL_2] (rows=170 width=34)
-                                  Output:["_col0","_col1","_col2","_col3"]
-                                  Filter Operator [FIL_83] (rows=170 width=34)
-                                    predicate:(v2 is not null and v3 is not null and k1 is not null)
-                                    TableScan [TS_0] (rows=170 width=34)
-                                      default@cs,cs,Tbl:COMPLETE,Col:NONE,Output:["k1","v2","k3","v3"]
-                            <-Map 6 [SIMPLE_EDGE]
-                              SHUFFLE [RS_42]
-                                PartitionCols:_col0
-                                Select Operator [SEL_5] (rows=250 width=10)
-                                  Output:["_col0"]
-                                  Filter Operator [FIL_84] (rows=250 width=10)
-                                    predicate:((value) IN ('2000Q1', '2000Q2', '2000Q3') and key is not null)
-                                    TableScan [TS_3] (rows=500 width=10)
-                                      default@src,d1,Tbl:COMPLETE,Col:NONE,Output:["key","value"]
+              Group By Operator [GBY_50] (rows=805 width=10)
+                Output:["_col0","_col1","_col2","_col3","_col4","_col5"],aggregations:["count(VALUE._col0)","count(VALUE._col1)","count(VALUE._col2)"],keys:KEY._col0, KEY._col1, KEY._col2
+              <-Reducer 3 [SIMPLE_EDGE]
+                SHUFFLE [RS_49]
+                  PartitionCols:_col0, _col1, _col2
+                  Group By Operator [GBY_48] (rows=1610 width=10)
+                    Output:["_col0","_col1","_col2","_col3","_col4","_col5"],aggregations:["count(_col13)","count(_col21)","count(_col3)"],keys:_col12, _col20, _col2
+                    Select Operator [SEL_47] (rows=1610 width=10)
+                      Output:["_col12","_col20","_col2","_col13","_col21","_col3"]
+                      Merge Join Operator [MERGEJOIN_97] (rows=1610 width=10)
+                        Conds:RS_44._col1, _col3=RS_45._col15, _col17(Inner),Output:["_col2","_col3","_col12","_col13","_col20","_col21"]
+                      <-Reducer 11 [SIMPLE_EDGE]
+                        SHUFFLE [RS_45]
+                          PartitionCols:_col15, _col17
+                          Select Operator [SEL_40] (rows=1464 width=10)
+                            Output:["_col14","_col15","_col17","_col6","_col7"]
+                            Merge Join Operator [MERGEJOIN_96] (rows=1464 width=10)
+                              Conds:RS_37._col6, _col4=RS_38._col4, _col2(Inner),Output:["_col2","_col3","_col14","_col15","_col17"]
+                            <-Reducer 10 [SIMPLE_EDGE]
+                              SHUFFLE [RS_37]
+                                PartitionCols:_col6, _col4
+                                Merge Join Operator [MERGEJOIN_94] (rows=1331 width=10)
+                                  Conds:RS_34._col3=RS_35._col1(Inner),Output:["_col2","_col3","_col4","_col6"]
+                                <-Map 14 [SIMPLE_EDGE]
+                                  SHUFFLE [RS_35]
+                                    PartitionCols:_col1
+                                    Select Operator [SEL_17] (rows=12 width=7)
+                                      Output:["_col1"]
+                                      Filter Operator [FIL_88] (rows=12 width=7)
+                                        predicate:((key = 'src1key') and value is not null)
+                                        TableScan [TS_15] (rows=25 width=7)
+                                          default@src1,src1,Tbl:COMPLETE,Col:NONE,Output:["key","value"]
+                                <-Reducer 9 [SIMPLE_EDGE]
+                                  SHUFFLE [RS_34]
+                                    PartitionCols:_col3
+                                    Merge Join Operator [MERGEJOIN_93] (rows=1210 width=10)
+                                      Conds:RS_31._col2=RS_32._col0(Inner),Output:["_col2","_col3","_col4","_col6"]
+                                    <-Map 13 [SIMPLE_EDGE]
+                                      SHUFFLE [RS_32]
+                                        PartitionCols:_col0
+                                        Select Operator [SEL_14] (rows=250 width=10)
+                                          Output:["_col0"]
+                                          Filter Operator [FIL_87] (rows=250 width=10)
+                                            predicate:((value = 'd1value') and key is not null)
+                                            TableScan [TS_12] (rows=500 width=10)
+                                              default@src,d1,Tbl:COMPLETE,Col:NONE,Output:["key","value"]
+                                    <-Reducer 8 [SIMPLE_EDGE]
+                                      SHUFFLE [RS_31]
+                                        PartitionCols:_col2
+                                        Merge Join Operator [MERGEJOIN_92] (rows=1100 width=10)
+                                          Conds:RS_28._col1=RS_29._col3(Inner),Output:["_col2","_col3","_col4","_col6"]
+                                        <-Map 12 [SIMPLE_EDGE]
+                                          SHUFFLE [RS_29]
+                                            PartitionCols:_col3
+                                            Select Operator [SEL_11] (rows=42 width=34)
+                                              Output:["_col0","_col1","_col2","_col3","_col4"]
+                                              Filter Operator [FIL_86] (rows=42 width=34)
+                                                predicate:((v3 = 'ssv3') and k2 is not null and k3 is not null and k1 is not null and v1 is not null and v2 is not null)
+                                                TableScan [TS_9] (rows=85 width=34)
+                                                  default@ss,ss,Tbl:COMPLETE,Col:NONE,Output:["k1","v1","k2","v2","k3","v3"]
+                                        <-Map 7 [SIMPLE_EDGE]
+                                          SHUFFLE [RS_28]
+                                            PartitionCols:_col1
+                                            Select Operator [SEL_8] (rows=1000 width=10)
+                                              Output:["_col1"]
+                                              Filter Operator [FIL_85] (rows=1000 width=10)
+                                                predicate:((key = 'srcpartkey') and value is not null)
+                                                TableScan [TS_6] (rows=2000 width=10)
+                                                  default@srcpart,srcpart,Tbl:COMPLETE,Col:NONE,Output:["key","value"]
+                            <-Reducer 16 [SIMPLE_EDGE]
+                              SHUFFLE [RS_38]
+                                PartitionCols:_col4, _col2
+                                Merge Join Operator [MERGEJOIN_95] (rows=275 width=10)
+                                  Conds:RS_24._col0=RS_25._col0(Inner),Output:["_col2","_col3","_col4","_col5"]
+                                <-Map 15 [SIMPLE_EDGE]
+                                  SHUFFLE [RS_24]
+                                    PartitionCols:_col0
+                                    Select Operator [SEL_20] (rows=42 width=34)
+                                      Output:["_col0","_col2","_col3","_col4","_col5"]
+                                      Filter Operator [FIL_89] (rows=42 width=34)
+                                        predicate:((v1 = 'srv1') and k2 is not null and k3 is not null and v2 is not null and v3 is not null and k1 is not null)
+                                        TableScan [TS_18] (rows=85 width=34)
+                                          default@sr,sr,Tbl:COMPLETE,Col:NONE,Output:["k1","v1","k2","v2","k3","v3"]
+                                <-Map 17 [SIMPLE_EDGE]
+                                  SHUFFLE [RS_25]
+                                    PartitionCols:_col0
+                                    Select Operator [SEL_23] (rows=250 width=10)
+                                      Output:["_col0"]
+                                      Filter Operator [FIL_90] (rows=250 width=10)
+                                        predicate:((value) IN ('2000Q1', '2000Q2', '2000Q3') and key is not null)
+                                        TableScan [TS_21] (rows=500 width=10)
+                                          default@src,d1,Tbl:COMPLETE,Col:NONE,Output:["key","value"]
+                      <-Reducer 2 [SIMPLE_EDGE]
+                        SHUFFLE [RS_44]
+                          PartitionCols:_col1, _col3
+                          Merge Join Operator [MERGEJOIN_91] (rows=275 width=10)
+                            Conds:RS_41._col0=RS_42._col0(Inner),Output:["_col1","_col2","_col3"]
+                          <-Map 1 [SIMPLE_EDGE]
+                            SHUFFLE [RS_41]
+                              PartitionCols:_col0
+                              Select Operator [SEL_2] (rows=170 width=34)
+                                Output:["_col0","_col1","_col2","_col3"]
+                                Filter Operator [FIL_83] (rows=170 width=34)
+                                  predicate:(v2 is not null and v3 is not null and k1 is not null)
+                                  TableScan [TS_0] (rows=170 width=34)
+                                    default@cs,cs,Tbl:COMPLETE,Col:NONE,Output:["k1","v2","k3","v3"]
+                          <-Map 6 [SIMPLE_EDGE]
+                            SHUFFLE [RS_42]
+                              PartitionCols:_col0
+                              Select Operator [SEL_5] (rows=250 width=10)
+                                Output:["_col0"]
+                                Filter Operator [FIL_84] (rows=250 width=10)
+                                  predicate:((value) IN ('2000Q1', '2000Q2', '2000Q3') and key is not null)
+                                  TableScan [TS_3] (rows=500 width=10)
+                                    default@src,d1,Tbl:COMPLETE,Col:NONE,Output:["key","value"]
 
 PREHOOK: query: explain
 SELECT x.key, z.value, y.value
@@ -512,7 +510,7 @@ Stage-0
                                 Reduce Output Operator [RS_36]
                                   PartitionCols:_col0, _col1
                                   Group By Operator [GBY_35] (rows=525 width=10)
-                                    Output:["_col0","_col1"],keys:_col0, _col1
+                                    Output:["_col0","_col1"],keys:_col1, _col0
                                     Select Operator [SEL_28] (rows=25 width=7)
                                       Output:["_col0","_col1"]
                                       Filter Operator [FIL_78] (rows=25 width=7)
@@ -523,7 +521,7 @@ Stage-0
                                 Reduce Output Operator [RS_36]
                                   PartitionCols:_col0, _col1
                                   Group By Operator [GBY_35] (rows=525 width=10)
-                                    Output:["_col0","_col1"],keys:_col0, _col1
+                                    Output:["_col0","_col1"],keys:_col1, _col0
                                     Select Operator [SEL_31] (rows=500 width=10)
                                       Output:["_col0","_col1"]
                                       Filter Operator [FIL_79] (rows=500 width=10)
@@ -574,7 +572,7 @@ Stage-0
                                 Reduce Output Operator [RS_10]
                                   PartitionCols:_col0, _col1
                                   Group By Operator [GBY_9] (rows=525 width=10)
-                                    Output:["_col0","_col1"],keys:_col0, _col1
+                                    Output:["_col0","_col1"],keys:_col1, _col0
                                     Select Operator [SEL_2] (rows=25 width=7)
                                       Output:["_col0","_col1"]
                                       Filter Operator [FIL_74] (rows=25 width=7)
@@ -585,7 +583,7 @@ Stage-0
                                 Reduce Output Operator [RS_10]
                                   PartitionCols:_col0, _col1
                                   Group By Operator [GBY_9] (rows=525 width=10)
-                                    Output:["_col0","_col1"],keys:_col0, _col1
+                                    Output:["_col0","_col1"],keys:_col1, _col0
                                     Select Operator [SEL_5] (rows=500 width=10)
                                       Output:["_col0","_col1"]
                                       Filter Operator [FIL_75] (rows=500 width=10)
@@ -699,7 +697,7 @@ Stage-0
                                 Reduce Output Operator [RS_99]
                                   PartitionCols:_col0, _col1
                                   Group By Operator [GBY_98] (rows=881 width=10)
-                                    Output:["_col0","_col1"],keys:_col0, _col1
+                                    Output:["_col0","_col1"],keys:_col1, _col0
                                     Select Operator [SEL_94] (rows=500 width=10)
                                       Output:["_col0","_col1"]
                                       Filter Operator [FIL_162] (rows=500 width=10)
@@ -710,51 +708,55 @@ Stage-0
                                 Reduce Output Operator [RS_99]
                                   PartitionCols:_col0, _col1
                                   Group By Operator [GBY_98] (rows=881 width=10)
-                                    Output:["_col0","_col1"],keys:_col0, _col1
-                                    Group By Operator [GBY_90] (rows=381 width=10)
-                                      Output:["_col0","_col1"],keys:KEY._col0, KEY._col1
-                                    <-Union 27 [SIMPLE_EDGE]
-                                      <-Map 34 [CONTAINS]
-                                        Reduce Output Operator [RS_89]
-                                          PartitionCols:_col0, _col1
-                                          Group By Operator [GBY_88] (rows=762 width=10)
-                                            Output:["_col0","_col1"],keys:_col0, _col1
-                                            Select Operator [SEL_84] (rows=500 width=10)
-                                              Output:["_col0","_col1"]
-                                              Filter Operator [FIL_161] (rows=500 width=10)
-                                                predicate:value is not null
-                                                TableScan [TS_82] (rows=500 width=10)
-                                                  Output:["key","value"]
-                                      <-Reducer 26 [CONTAINS]
-                                        Reduce Output Operator [RS_89]
-                                          PartitionCols:_col0, _col1
-                                          Group By Operator [GBY_88] (rows=762 width=10)
-                                            Output:["_col0","_col1"],keys:_col0, _col1
-                                            Group By Operator [GBY_80] (rows=262 width=10)
-                                              Output:["_col0","_col1"],keys:KEY._col0, KEY._col1
-                                            <-Union 25 [SIMPLE_EDGE]
-                                              <-Map 24 [CONTAINS]
-                                                Reduce Output Operator [RS_79]
-                                                  PartitionCols:_col0, _col1
-                                                  Group By Operator [GBY_78] (rows=525 width=10)
-                                                    Output:["_col0","_col1"],keys:_col0, _col1
-                                                    Select Operator [SEL_71] (rows=25 width=7)
-                                                      Output:["_col0","_col1"]
-                                                      Filter Operator [FIL_159] (rows=25 width=7)
-                                                        predicate:value is not null
-                                                        TableScan [TS_69] (rows=25 width=7)
-                                                          Output:["key","value"]
-                                              <-Map 33 [CONTAINS]
-                                                Reduce Output Operator [RS_79]
-                                                  PartitionCols:_col0, _col1
-                                                  Group By Operator [GBY_78] (rows=525 width=10)
-                                                    Output:["_col0","_col1"],keys:_col0, _col1
-                                                    Select Operator [SEL_74] (rows=500 width=10)
-                                                      Output:["_col0","_col1"]
-                                                      Filter Operator [FIL_160] (rows=500 width=10)
-                                                        predicate:value is not null
-                                                        TableScan [TS_72] (rows=500 width=10)
-                                                          Output:["key","value"]
+                                    Output:["_col0","_col1"],keys:_col1, _col0
+                                    Select Operator [SEL_91] (rows=381 width=10)
+                                      Output:["_col0","_col1"]
+                                      Group By Operator [GBY_90] (rows=381 width=10)
+                                        Output:["_col0","_col1"],keys:KEY._col0, KEY._col1
+                                      <-Union 27 [SIMPLE_EDGE]
+                                        <-Map 34 [CONTAINS]
+                                          Reduce Output Operator [RS_89]
+                                            PartitionCols:_col0, _col1
+                                            Group By Operator [GBY_88] (rows=762 width=10)
+                                              Output:["_col0","_col1"],keys:_col1, _col0
+                                              Select Operator [SEL_84] (rows=500 width=10)
+                                                Output:["_col0","_col1"]
+                                                Filter Operator [FIL_161] (rows=500 width=10)
+                                                  predicate:value is not null
+                                                  TableScan [TS_82] (rows=500 width=10)
+                                                    Output:["key","value"]
+                                        <-Reducer 26 [CONTAINS]
+                                          Reduce Output Operator [RS_89]
+                                            PartitionCols:_col0, _col1
+                                            Group By Operator [GBY_88] (rows=762 width=10)
+                                              Output:["_col0","_col1"],keys:_col1, _col0
+                                              Select Operator [SEL_81] (rows=262 width=10)
+                                                Output:["_col0","_col1"]
+                                                Group By Operator [GBY_80] (rows=262 width=10)
+                                                  Output:["_col0","_col1"],keys:KEY._col0, KEY._col1
+                                                <-Union 25 [SIMPLE_EDGE]
+                                                  <-Map 24 [CONTAINS]
+                                                    Reduce Output Operator [RS_79]
+                                                      PartitionCols:_col0, _col1
+                                                      Group By Operator [GBY_78] (rows=525 width=10)
+                                                        Output:["_col0","_col1"],keys:_col1, _col0
+                                                        Select Operator [SEL_71] (rows=25 width=7)
+                                                          Output:["_col0","_col1"]
+                                                          Filter Operator [FIL_159] (rows=25 width=7)
+                                                            predicate:value is not null
+                                                            TableScan [TS_69] (rows=25 width=7)
+                                                              Output:["key","value"]
+                                                  <-Map 33 [CONTAINS]
+                                                    Reduce Output Operator [RS_79]
+                                                      PartitionCols:_col0, _col1
+                                                      Group By Operator [GBY_78] (rows=525 width=10)
+                                                        Output:["_col0","_col1"],keys:_col1, _col0
+                                                        Select Operator [SEL_74] (rows=500 width=10)
+                                                          Output:["_col0","_col1"]
+                                                          Filter Operator [FIL_160] (rows=500 width=10)
+                                                            predicate:value is not null
+                                                            TableScan [TS_72] (rows=500 width=10)
+                                                              Output:["key","value"]
           <-Reducer 7 [CONTAINS]
             Reduce Output Operator [RS_119]
               PartitionCols:_col0, _col1
@@ -807,7 +809,7 @@ Stage-0
                                         Reduce Output Operator [RS_46]
                                           PartitionCols:_col0, _col1
                                           Group By Operator [GBY_45] (rows=762 width=10)
-                                            Output:["_col0","_col1"],keys:_col0, _col1
+                                            Output:["_col0","_col1"],keys:_col1, _col0
                                             Select Operator [SEL_41] (rows=500 width=10)
                                               Output:["_col0","_col1"]
                                               Filter Operator [FIL_156] (rows=500 width=10)
@@ -818,32 +820,34 @@ Stage-0
                                         Reduce Output Operator [RS_46]
                                           PartitionCols:_col0, _col1
                                           Group By Operator [GBY_45] (rows=762 width=10)
-                                            Output:["_col0","_col1"],keys:_col0, _col1
-                                            Group By Operator [GBY_37] (rows=262 width=10)
-                                              Output:["_col0","_col1"],keys:KEY._col0, KEY._col1
-                                            <-Union 14 [SIMPLE_EDGE]
-                                              <-Map 13 [CONTAINS]
-                                                Reduce Output Operator [RS_36]
-                                                  PartitionCols:_col0, _col1
-                                                  Group By Operator [GBY_35] (rows=525 width=10)
-                                                    Output:["_col0","_col1"],keys:_col0, _col1
-                                                    Select Operator [SEL_28] (rows=25 width=7)
-                                                      Output:["_col0","_col1"]
-                                                      Filter Operator [FIL_154] (rows=25 width=7)
-                                                        predicate:value is not null
-                                                        TableScan [TS_26] (rows=25 width=7)
-                                                          Output:["key","value"]
-                                              <-Map 20 [CONTAINS]
-                                                Reduce Output Operator [RS_36]
-                                                  PartitionCols:_col0, _col1
-                                                  Group By Operator [GBY_35] (rows=525 width=10)
-                                                    Output:["_col0","_col1"],keys:_col0, _col1
-                                                    Select Operator [SEL_31] (rows=500 width=10)
-                                                      Output:["_col0","_col1"]
-                                                      Filter Operator [FIL_155] (rows=500 width=10)
-                                                        predicate:value is not null
-                                                        TableScan [TS_29] (rows=500 width=10)
-                                                          Output:["key","value"]
+                                            Output:["_col0","_col1"],keys:_col1, _col0
+                                            Select Operator [SEL_38] (rows=262 width=10)
+                                              Output:["_col0","_col1"]
+                                              Group By Operator [GBY_37] (rows=262 width=10)
+                                                Output:["_col0","_col1"],keys:KEY._col0, KEY._col1
+                                              <-Union 14 [SIMPLE_EDGE]
+                                                <-Map 13 [CONTAINS]
+                                                  Reduce Output Operator [RS_36]
+                                                    PartitionCols:_col0, _col1
+                                                    Group By Operator [GBY_35] (rows=525 width=10)
+                                                      Output:["_col0","_col1"],keys:_col1, _col0
+                                                      Select Operator [SEL_28] (rows=25 width=7)
+                                                        Output:["_col0","_col1"]
+                                                        Filter Operator [FIL_154] (rows=25 width=7)
+                                                          predicate:value is not null
+                                                          TableScan [TS_26] (rows=25 width=7)
+                                                            Output:["key","value"]
+                                                <-Map 20 [CONTAINS]
+                                                  Reduce Output Operator [RS_36]
+                                                    PartitionCols:_col0, _col1
+                                                    Group By Operator [GBY_35] (rows=525 width=10)
+                                                      Output:["_col0","_col1"],keys:_col1, _col0
+                                                      Select Operator [SEL_31] (rows=500 width=10)
+                                                        Output:["_col0","_col1"]
+                                                        Filter Operator [FIL_155] (rows=500 width=10)
+                                                          predicate:value is not null
+                                                          TableScan [TS_29] (rows=500 width=10)
+                                                            Output:["key","value"]
                   <-Reducer 5 [CONTAINS]
                     Reduce Output Operator [RS_66]
                       PartitionCols:_col0, _col1
@@ -888,7 +892,7 @@ Stage-0
                                         Reduce Output Operator [RS_10]
                                           PartitionCols:_col0, _col1
                                           Group By Operator [GBY_9] (rows=525 width=10)
-                                            Output:["_col0","_col1"],keys:_col0, _col1
+                                            Output:["_col0","_col1"],keys:_col1, _col0
                                             Select Operator [SEL_2] (rows=25 width=7)
                                               Output:["_col0","_col1"]
                                               Filter Operator [FIL_150] (rows=25 width=7)
@@ -899,7 +903,7 @@ Stage-0
                                         Reduce Output Operator [RS_10]
                                           PartitionCols:_col0, _col1
                                           Group By Operator [GBY_9] (rows=525 width=10)
-                                            Output:["_col0","_col1"],keys:_col0, _col1
+                                            Output:["_col0","_col1"],keys:_col1, _col0
                                             Select Operator [SEL_5] (rows=500 width=10)
                                               Output:["_col0","_col1"]
                                               Filter Operator [FIL_151] (rows=500 width=10)
@@ -1036,102 +1040,100 @@ Stage-0
             Output:["_col0","_col1","_col2","_col3","_col4","_col5"]
           <-Reducer 4 [SIMPLE_EDGE]
             SHUFFLE [RS_52]
-              Select Operator [SEL_51] (rows=805 width=10)
-                Output:["_col0","_col1","_col2","_col3","_col4","_col5"]
-                Group By Operator [GBY_50] (rows=805 width=10)
-                  Output:["_col0","_col1","_col2","_col3","_col4","_col5"],aggregations:["count(VALUE._col0)","count(VALUE._col1)","count(VALUE._col2)"],keys:KEY._col0, KEY._col1, KEY._col2
-                <-Map 3 [SIMPLE_EDGE]
-                  SHUFFLE [RS_49]
-                    PartitionCols:_col0, _col1, _col2
-                    Group By Operator [GBY_48] (rows=1610 width=10)
-                      Output:["_col0","_col1","_col2","_col3","_col4","_col5"],aggregations:["count(_col13)","count(_col21)","count(_col3)"],keys:_col2, _col12, _col20
-                      Select Operator [SEL_47] (rows=1610 width=10)
-                        Output:["_col2","_col12","_col20","_col13","_col21","_col3"]
-                        Map Join Operator [MAPJOIN_97] (rows=1610 width=10)
-                          Conds:RS_44._col1, _col3=SEL_40._col15, _col17(Inner),HybridGraceHashJoin:true,Output:["_col2","_col3","_col12","_col13","_col20","_col21"]
-                        <-Map 2 [BROADCAST_EDGE]
-                          BROADCAST [RS_44]
-                            PartitionCols:_col1, _col3
-                            Map Join Operator [MAPJOIN_91] (rows=275 width=10)
-                              Conds:RS_41._col0=SEL_5._col0(Inner),HybridGraceHashJoin:true,Output:["_col1","_col2","_col3"]
-                            <-Map 1 [BROADCAST_EDGE]
-                              BROADCAST [RS_41]
-                                PartitionCols:_col0
-                                Select Operator [SEL_2] (rows=170 width=34)
-                                  Output:["_col0","_col1","_col2","_col3"]
-                                  Filter Operator [FIL_83] (rows=170 width=34)
-                                    predicate:(v2 is not null and v3 is not null and k1 is not null)
-                                    TableScan [TS_0] (rows=170 width=34)
-                                      default@cs,cs,Tbl:COMPLETE,Col:NONE,Output:["k1","v2","k3","v3"]
-                            <-Select Operator [SEL_5] (rows=250 width=10)
-                                Output:["_col0"]
-                                Filter Operator [FIL_84] (rows=250 width=10)
-                                  predicate:((value) IN ('2000Q1', '2000Q2', '2000Q3') and key is not null)
-                                  TableScan [TS_3] (rows=500 width=10)
-                                    default@src,d1,Tbl:COMPLETE,Col:NONE,Output:["key","value"]
-                        <-Select Operator [SEL_40] (rows=1464 width=10)
-                            Output:["_col14","_col15","_col17","_col6","_col7"]
-                            Map Join Operator [MAPJOIN_96] (rows=1464 width=10)
-                              Conds:MAPJOIN_94._col4, _col6=RS_38._col2, _col4(Inner),HybridGraceHashJoin:true,Output:["_col2","_col3","_col14","_col15","_col17"]
-                            <-Map 10 [BROADCAST_EDGE]
-                              BROADCAST [RS_38]
-                                PartitionCols:_col2, _col4
-                                Map Join Operator [MAPJOIN_95] (rows=275 width=10)
-                                  Conds:RS_24._col0=SEL_23._col0(Inner),HybridGraceHashJoin:true,Output:["_col2","_col3","_col4","_col5"]
-                                <-Map 9 [BROADCAST_EDGE]
-                                  BROADCAST [RS_24]
-                                    PartitionCols:_col0
-                                    Select Operator [SEL_20] (rows=42 width=34)
-                                      Output:["_col0","_col2","_col3","_col4","_col5"]
-                                      Filter Operator [FIL_89] (rows=42 width=34)
-                                        predicate:((v1 = 'srv1') and k2 is not null and k3 is not null and v2 is not null and v3 is not null and k1 is not null)
-                                        TableScan [TS_18] (rows=85 width=34)
-                                          default@sr,sr,Tbl:COMPLETE,Col:NONE,Output:["k1","v1","k2","v2","k3","v3"]
-                                <-Select Operator [SEL_23] (rows=250 width=10)
+              Group By Operator [GBY_50] (rows=805 width=10)
+                Output:["_col0","_col1","_col2","_col3","_col4","_col5"],aggregations:["count(VALUE._col0)","count(VALUE._col1)","count(VALUE._col2)"],keys:KEY._col0, KEY._col1, KEY._col2
+              <-Map 3 [SIMPLE_EDGE]
+                SHUFFLE [RS_49]
+                  PartitionCols:_col0, _col1, _col2
+                  Group By Operator [GBY_48] (rows=1610 width=10)
+                    Output:["_col0","_col1","_col2","_col3","_col4","_col5"],aggregations:["count(_col13)","count(_col21)","count(_col3)"],keys:_col12, _col20, _col2
+                    Select Operator [SEL_47] (rows=1610 width=10)
+                      Output:["_col12","_col20","_col2","_col13","_col21","_col3"]
+                      Map Join Operator [MAPJOIN_97] (rows=1610 width=10)
+                        Conds:RS_44._col1, _col3=SEL_40._col15, _col17(Inner),HybridGraceHashJoin:true,Output:["_col2","_col3","_col12","_col13","_col20","_col21"]
+                      <-Map 2 [BROADCAST_EDGE]
+                        BROADCAST [RS_44]
+                          PartitionCols:_col1, _col3
+                          Map Join Operator [MAPJOIN_91] (rows=275 width=10)
+                            Conds:RS_41._col0=SEL_5._col0(Inner),HybridGraceHashJoin:true,Output:["_col1","_col2","_col3"]
+                          <-Map 1 [BROADCAST_EDGE]
+                            BROADCAST [RS_41]
+                              PartitionCols:_col0
+                              Select Operator [SEL_2] (rows=170 width=34)
+                                Output:["_col0","_col1","_col2","_col3"]
+                                Filter Operator [FIL_83] (rows=170 width=34)
+                                  predicate:(v2 is not null and v3 is not null and k1 is not null)
+                                  TableScan [TS_0] (rows=170 width=34)
+                                    default@cs,cs,Tbl:COMPLETE,Col:NONE,Output:["k1","v2","k3","v3"]
+                          <-Select Operator [SEL_5] (rows=250 width=10)
+                              Output:["_col0"]
+                              Filter Operator [FIL_84] (rows=250 width=10)
+                                predicate:((value) IN ('2000Q1', '2000Q2', '2000Q3') and key is not null)
+                                TableScan [TS_3] (rows=500 width=10)
+                                  default@src,d1,Tbl:COMPLETE,Col:NONE,Output:["key","value"]
+                      <-Select Operator [SEL_40] (rows=1464 width=10)
+                          Output:["_col14","_col15","_col17","_col6","_col7"]
+                          Map Join Operator [MAPJOIN_96] (rows=1464 width=10)
+                            Conds:MAPJOIN_94._col6, _col4=RS_38._col4, _col2(Inner),HybridGraceHashJoin:true,Output:["_col2","_col3","_col14","_col15","_col17"]
+                          <-Map 10 [BROADCAST_EDGE]
+                            BROADCAST [RS_38]
+                              PartitionCols:_col4, _col2
+                              Map Join Operator [MAPJOIN_95] (rows=275 width=10)
+                                Conds:RS_24._col0=SEL_23._col0(Inner),HybridGraceHashJoin:true,Output:["_col2","_col3","_col4","_col5"]
+                              <-Map 9 [BROADCAST_EDGE]
+                                BROADCAST [RS_24]
+                                  PartitionCols:_col0
+                                  Select Operator [SEL_20] (rows=42 width=34)
+                                    Output:["_col0","_col2","_col3","_col4","_col5"]
+                                    Filter Operator [FIL_89] (rows=42 width=34)
+                                      predicate:((v1 = 'srv1') and k2 is not null and k3 is not null and v2 is not null and v3 is not null and k1 is not null)
+                                      TableScan [TS_18] (rows=85 width=34)
+                                        default@sr,sr,Tbl:COMPLETE,Col:NONE,Output:["k1","v1","k2","v2","k3","v3"]
+                              <-Select Operator [SEL_23] (rows=250 width=10)
+                                  Output:["_col0"]
+                                  Filter Operator [FIL_90] (rows=250 width=10)
+                                    predicate:((value) IN ('2000Q1', '2000Q2', '2000Q3') and key is not null)
+                                    TableScan [TS_21] (rows=500 width=10)
+                                      default@src,d1,Tbl:COMPLETE,Col:NONE,Output:["key","value"]
+                          <-Map Join Operator [MAPJOIN_94] (rows=1331 width=10)
+                              Conds:MAPJOIN_93._col3=RS_35._col1(Inner),HybridGraceHashJoin:true,Output:["_col2","_col3","_col4","_col6"]
+                            <-Map 8 [BROADCAST_EDGE]
+                              BROADCAST [RS_35]
+                                PartitionCols:_col1
+                                Select Operator [SEL_17] (rows=12 width=7)
+                                  Output:["_col1"]
+                                  Filter Operator [FIL_88] (rows=12 width=7)
+                                    predicate:((key = 'src1key') and value is not null)
+                                    TableScan [TS_15] (rows=25 width=7)
+                                      default@src1,src1,Tbl:COMPLETE,Col:NONE,Output:["key","value"]
+                            <-Map Join Operator [MAPJOIN_93] (rows=1210 width=10)
+                                Conds:MAPJOIN_92._col2=RS_32._col0(Inner),HybridGraceHashJoin:true,Output:["_col2","_col3","_col4","_col6"]
+                              <-Map 7 [BROADCAST_EDGE]
+                                BROADCAST [RS_32]
+                                  PartitionCols:_col0
+                                  Select Operator [SEL_14] (rows=250 width=10)
                                     Output:["_col0"]
-                                    Filter Operator [FIL_90] (rows=250 width=10)
-                                      predicate:((value) IN ('2000Q1', '2000Q2', '2000Q3') and key is not null)
-                                      TableScan [TS_21] (rows=500 width=10)
+                                    Filter Operator [FIL_87] (rows=250 width=10)
+                                      predicate:((value = 'd1value') and key is not null)
+                                      TableScan [TS_12] (rows=500 width=10)
                                         default@src,d1,Tbl:COMPLETE,Col:NONE,Output:["key","value"]
-                            <-Map Join Operator [MAPJOIN_94] (rows=1331 width=10)
-                                Conds:MAPJOIN_93._col3=RS_35._col1(Inner),HybridGraceHashJoin:true,Output:["_col2","_col3","_col4","_col6"]
-                              <-Map 8 [BROADCAST_EDGE]
-                                BROADCAST [RS_35]
-                                  PartitionCols:_col1
-                                  Select Operator [SEL_17] (rows=12 width=7)
+                              <-Map Join Operator [MAPJOIN_92] (rows=1100 width=10)
+                                  Conds:SEL_8._col1=RS_29._col3(Inner),HybridGraceHashJoin:true,Output:["_col2","_col3","_col4","_col6"]
+                                <-Map 6 [BROADCAST_EDGE]
+                                  BROADCAST [RS_29]
+                                    PartitionCols:_col3
+                                    Select Operator [SEL_11] (rows=42 width=34)
+                                      Output:["_col0","_col1","_col2","_col3","_col4"]
+                                      Filter Operator [FIL_86] (rows=42 width=34)
+                                        predicate:((v3 = 'ssv3') and k2 is not null and k3 is not null and k1 is not null and v1 is not null and v2 is not null)
+                                        TableScan [TS_9] (rows=85 width=34)
+                                          default@ss,ss,Tbl:COMPLETE,Col:NONE,Output:["k1","v1","k2","v2","k3","v3"]
+                                <-Select Operator [SEL_8] (rows=1000 width=10)
                                     Output:["_col1"]
-                                    Filter Operator [FIL_88] (rows=12 width=7)
-                                      predicate:((key = 'src1key') and value is not null)
-                                      TableScan [TS_15] (rows=25 width=7)
-                                        default@src1,src1,Tbl:COMPLETE,Col:NONE,Output:["key","value"]
-                              <-Map Join Operator [MAPJOIN_93] (rows=1210 width=10)
-                                  Conds:MAPJOIN_92._col2=RS_32._col0(Inner),HybridGraceHashJoin:true,Output:["_col2","_col3","_col4","_col6"]
-                                <-Map 7 [BROADCAST_EDGE]
-                                  BROADCAST [RS_32]
-                                    PartitionCols:_col0
-                                    Select Operator [SEL_14] (rows=250 width=10)
-                                      Output:["_col0"]
-                                      Filter Operator [FIL_87] (rows=250 width=10)
-                                        predicate:((value = 'd1value') and key is not null)
-                                        TableScan [TS_12] (rows=500 width=10)
-                                          default@src,d1,Tbl:COMPLETE,Col:NONE,Output:["key","value"]
-                                <-Map Join Operator [MAPJOIN_92] (rows=1100 width=10)
-                                    Conds:SEL_8._col1=RS_29._col3(Inner),HybridGraceHashJoin:true,Output:["_col2","_col3","_col4","_col6"]
-                                  <-Map 6 [BROADCAST_EDGE]
-                                    BROADCAST [RS_29]
-                                      PartitionCols:_col3
-                                      Select Operator [SEL_11] (rows=42 width=34)
-                                        Output:["_col0","_col1","_col2","_col3","_col4"]
-                                        Filter Operator [FIL_86] (rows=42 width=34)
-                                          predicate:((v3 = 'ssv3') and k2 is not null and k3 is not null and k1 is not null and v1 is not null and v2 is not null)
-                                          TableScan [TS_9] (rows=85 width=34)
-                                            default@ss,ss,Tbl:COMPLETE,Col:NONE,Output:["k1","v1","k2","v2","k3","v3"]
-                                  <-Select Operator [SEL_8] (rows=1000 width=10)
-                                      Output:["_col1"]
-                                      Filter Operator [FIL_85] (rows=1000 width=10)
-                                        predicate:((key = 'srcpartkey') and value is not null)
-                                        TableScan [TS_6] (rows=2000 width=10)
-                                          default@srcpart,srcpart,Tbl:COMPLETE,Col:NONE,Output:["key","value"]
+                                    Filter Operator [FIL_85] (rows=1000 width=10)
+                                      predicate:((key = 'srcpartkey') and value is not null)
+                                      TableScan [TS_6] (rows=2000 width=10)
+                                        default@srcpart,srcpart,Tbl:COMPLETE,Col:NONE,Output:["key","value"]
 
 PREHOOK: query: explain
 SELECT x.key, z.value, y.value
@@ -1209,7 +1211,7 @@ Stage-0
                             Reduce Output Operator [RS_36]
                               PartitionCols:_col0, _col1
                               Group By Operator [GBY_35] (rows=525 width=10)
-                                Output:["_col0","_col1"],keys:_col0, _col1
+                                Output:["_col0","_col1"],keys:_col1, _col0
                                 Select Operator [SEL_31] (rows=500 width=10)
                                   Output:["_col0","_col1"]
                                   Filter Operator [FIL_79] (rows=500 width=10)
@@ -1220,7 +1222,7 @@ Stage-0
                             Reduce Output Operator [RS_36]
                               PartitionCols:_col0, _col1
                               Group By Operator [GBY_35] (rows=525 width=10)
-                                Output:["_col0","_col1"],keys:_col0, _col1
+                                Output:["_col0","_col1"],keys:_col1, _col0
                                 Select Operator [SEL_28] (rows=25 width=7)
                                   Output:["_col0","_col1"]
                                   Filter Operator [FIL_78] (rows=25 width=7)
@@ -1265,7 +1267,7 @@ Stage-0
                             Reduce Output Operator [RS_10]
                               PartitionCols:_col0, _col1
                               Group By Operator [GBY_9] (rows=525 width=10)
-                                Output:["_col0","_col1"],keys:_col0, _col1
+                                Output:["_col0","_col1"],keys:_col1, _col0
                                 Select Operator [SEL_2] (rows=25 width=7)
                                   Output:["_col0","_col1"]
                                   Filter Operator [FIL_74] (rows=25 width=7)
@@ -1276,7 +1278,7 @@ Stage-0
                             Reduce Output Operator [RS_10]
                               PartitionCols:_col0, _col1
                               Group By Operator [GBY_9] (rows=525 width=10)
-                                Output:["_col0","_col1"],keys:_col0, _col1
+                                Output:["_col0","_col1"],keys:_col1, _col0
                                 Select Operator [SEL_5] (rows=500 width=10)
                                   Output:["_col0","_col1"]
                                   Filter Operator [FIL_75] (rows=500 width=10)
@@ -1378,7 +1380,7 @@ Stage-0
                             Reduce Output Operator [RS_99]
                               PartitionCols:_col0, _col1
                               Group By Operator [GBY_98] (rows=881 width=10)
-                                Output:["_col0","_col1"],keys:_col0, _col1
+                                Output:["_col0","_col1"],keys:_col1, _col0
                                 Select Operator [SEL_94] (rows=500 width=10)
                                   Output:["_col0","_col1"]
                                   Filter Operator [FIL_162] (rows=500 width=10)
@@ -1389,51 +1391,55 @@ Stage-0
                             Reduce Output Operator [RS_99]
                               PartitionCols:_col0, _col1
                               Group By Operator [GBY_98] (rows=881 width=10)
-                                Output:["_col0","_col1"],keys:_col0, _col1
-                                Group By Operator [GBY_90] (rows=381 width=10)
-                                  Output:["_col0","_col1"],keys:KEY._col0, KEY._col1
-                                <-Union 23 [SIMPLE_EDGE]
-                                  <-Map 28 [CONTAINS]
-                                    Reduce Output Operator [RS_89]
-                                      PartitionCols:_col0, _col1
-                                      Group By Operator [GBY_88] (rows=762 width=10)
-                                        Output:["_col0","_col1"],keys:_col0, _col1
-                                        Select Operator [SEL_84] (rows=500 width=10)
-                                          Output:["_col0","_col1"]
-                                          Filter Operator [FIL_161] (rows=500 width=10)
-                                            predicate:value is not null
-                                            TableScan [TS_82] (rows=500 width=10)
-                                              Output:["key","value"]
-                                  <-Reducer 22 [CONTAINS]
-                                    Reduce Output Operator [RS_89]
-                                      PartitionCols:_col0, _col1
-                                      Group By Operator [GBY_88] (rows=762 width=10)
-                                        Output:["_col0","_col1"],keys:_col0, _col1
-                                        Group By Operator [GBY_80] (rows=262 width=10)
-                                          Output:["_col0","_col1"],keys:KEY._col0, KEY._col1
-                                        <-Union 21 [SIMPLE_EDGE]
-                                          <-Map 20 [CONTAINS]
-                                            Reduce Output Operator [RS_79]
-                                              PartitionCols:_col0, _col1
-                                              Group By Operator [GBY_78] (rows=525 width=10)
-                                                Output:["_col0","_col1"],keys:_col0, _col1
-                                                Select Operator [SEL_71] (rows=25 width=7)
-                                                  Output:["_col0","_col1"]
-                                                  Filter Operator [FIL_159] (rows=25 width=7)
-                                                    predicate:value is not null
-                                                    TableScan [TS_69] (rows=25 width=7)
-                                                      Output:["key","value"]
-                                          <-Map 27 [CONTAINS]
-                                            Reduce Output Operator [RS_79]
-                                              PartitionCols:_col0, _col1
-                                              Group By Operator [GBY_78] (rows=525 width=10)
-                                                Output:["_col0","_col1"],keys:_col0, _col1
-                                                Select Operator [SEL_74] (rows=500 width=10)
-                                                  Output:["_col0","_col1"]
-                                                  Filter Operator [FIL_160] (rows=500 width=10)
-                                                    predicate:value is not null
-                                                    TableScan [TS_72] (rows=500 width=10)
-                                                      Output:["key","value"]
+                                Output:["_col0","_col1"],keys:_col1, _col0
+                                Select Operator [SEL_91] (rows=381 width=10)
+                                  Output:["_col0","_col1"]
+                                  Group By Operator [GBY_90] (rows=381 width=10)
+                                    Output:["_col0","_col1"],keys:KEY._col0, KEY._col1
+                                  <-Union 23 [SIMPLE_EDGE]
+                                    <-Map 28 [CONTAINS]
+                                      Reduce Output Operator [RS_89]
+                                        PartitionCols:_col0, _col1
+                                        Group By Operator [GBY_88] (rows=762 width=10)
+                                          Output:["_col0","_col1"],keys:_col1, _col0
+                                          Select Operator [SEL_84] (rows=500 width=10)
+                                            Output:["_col0","_col1"]
+                                            Filter Operator [FIL_161] (rows=500 width=10)
+                                              predicate:value is not null
+                                              TableScan [TS_82] (rows=500 width=10)
+                                                Output:["key","value"]
+                                    <-Reducer 22 [CONTAINS]
+                                      Reduce Output Operator [RS_89]
+                                        PartitionCols:_col0, _col1
+                                        Group By Operator [GBY_88] (rows=762 width=10)
+                                          Output:["_col0","_col1"],keys:_col1, _col0
+                                          Select Operator [SEL_81] (rows=262 width=10)
+                                            Output:["_col0","_col1"]
+                                            Group By Operator [GBY_80] (rows=262 width=10)
+                                              Output:["_col0","_col1"],keys:KEY._col0, KEY._col1
+                                            <-Union 21 [SIMPLE_EDGE]
+                                              <-Map 20 [CONTAINS]
+                                                Reduce Output Operator [RS_79]
+                                                  PartitionCols:_col0, _col1
+                                                  Group By Operator [GBY_78] (rows=525 width=10)
+                                                    Output:["_col0","_col1"],keys:_col1, _col0
+                                                    Select Operator [SEL_71] (rows=25 width=7)
+                                                      Output:["_col0","_col1"]
+                                                      Filter Operator [FIL_159] (rows=25 width=7)
+                                                        predicate:value is not null
+                                                        TableScan [TS_69] (rows=25 width=7)
+                                                          Output:["key","value"]
+                                              <-Map 27 [CONTAINS]
+                                                Reduce Output Operator [RS_79]
+                                                  PartitionCols:_col0, _col1
+                                                  Group By Operator [GBY_78] (rows=525 width=10)
+                                                    Output:["_col0","_col1"],keys:_col1, _col0
+                                                    Select Operator [SEL_74] (rows=500 width=10)
+                                                      Output:["_col0","_col1"]
+                                                      Filter Operator [FIL_160] (rows=500 width=10)
+                                                        predicate:value is not null
+                                                        TableScan [TS_72] (rows=500 width=10)
+                                                          Output:["key","value"]
           <-Reducer 5 [CONTAINS]
             Reduce Output Operator [RS_119]
               PartitionCols:_col0, _col1
@@ -1480,7 +1486,7 @@ Stage-0
                                     Reduce Output Operator [RS_46]
                                       PartitionCols:_col0, _col1
                                       Group By Operator [GBY_45] (rows=762 width=10)
-                                        Output:["_col0","_col1"],keys:_col0, _col1
+                                        Output:["_col0","_col1"],keys:_col1, _col0
                                         Select Operator [SEL_41] (rows=500 width=10)
                                           Output:["_col0","_col1"]
                                           Filter Operator [FIL_156] (rows=500 width=10)
@@ -1491,32 +1497,34 @@ Stage-0
                                     Reduce Output Operator [RS_46]
                                       PartitionCols:_col0, _col1
                                       Group By Operator [GBY_45] (rows=762 width=10)
-                                        Output:["_col0","_col1"],keys:_col0, _col1
-                                        Group By Operator [GBY_37] (rows=262 width=10)
-                                          Output:["_col0","_col1"],keys:KEY._col0, KEY._col1
-                                        <-Union 12 [SIMPLE_EDGE]
-                                          <-Map 11 [CONTAINS]
-                                            Reduce Output Operator [RS_36]
-                                              PartitionCols:_col0, _col1
-                                              Group By Operator [GBY_35] (rows=525 width=10)
-                                                Output:["_col0","_col1"],keys:_col0, _col1
-                                                Select Operator [SEL_28] (rows=25 width=7)
-                                                  Output:["_col0","_col1"]
-                                                  Filter Operator [FIL_154] (rows=25 width=7)
-                                                    predicate:value is not null
-                                                    TableScan [TS_26] (rows=25 width=7)
-                                                      Output:["key","value"]
-                                          <-Map 16 [CONTAINS]
-                                            Reduce Output Operator [RS_36]
-                                              PartitionCols:_col0, _col1
-                                              Group By Operator [GBY_35] (rows=525 width=10)
-                                                Output:["_col0","_col1"],keys:_col0, _col1
-                                                Select Operator [SEL_31] (rows=500 width=10)
-                                                  Output:["_col0","_col1"]
-                                                  Filter Operator [FIL_155] (rows=500 width=10)
-                                                    predicate:value is not null
-                                                    TableScan [TS_29] (rows=500 width=10)
-                                                      Output:["key","value"]
+                                        Output:["_col0","_col1"],keys:_col1, _col0
+                                        Select Operator [SEL_38] (rows=262 width=10)
+                                          Output:["_col0","_col1"]
+                                          Group By Operator [GBY_37] (rows=262 width=10)
+                                            Output:["_col0","_col1"],keys:KEY._col0, KEY._col1
+                                          <-Union 12 [SIMPLE_EDGE]
+                                            <-Map 11 [CONTAINS]
+                                              Reduce Output Operator [RS_36]
+                                                PartitionCols:_col0, _col1
+                                                Group By Operator [GBY_35] (rows=525 width=10)
+                                                  Output:["_col0","_col1"],keys:_col1, _col0
+                                                  Select Operator [SEL_28] (rows=25 width=7)
+                                                    Output:["_col0","_col1"]
+                                                    Filter Operator [FIL_154] (rows=25 width=7)
+                                                      predicate:value is not null
+                                                      TableScan [TS_26] (rows=25 width=7)
+                                                        Output:["key","value"]
+                                            <-Map 16 [CONTAINS]
+                                              Reduce Output Operator [RS_36]
+                                                PartitionCols:_col0, _col1
+                                                Group By Operator [GBY_35] (rows=525 width=10)
+                                                  Output:["_col0","_col1"],keys:_col1, _col0
+                                                  Select Operator [SEL_31] (rows=500 width=10)
+                                                    Output:["_col0","_col1"]
+                                                    Filter Operator [FIL_155] (rows=500 width=10)
+                                                      predicate:value is not null
+                                                      TableScan [TS_29] (rows=500 width=10)
+                                                        Output:["key","value"]
                   <-Reducer 3 [CONTAINS]
                     Reduce Output Operator [RS_66]
                       PartitionCols:_col0, _col1
@@ -1555,7 +1563,7 @@ Stage-0
                                     Reduce Output Operator [RS_10]
                                       PartitionCols:_col0, _col1
                                       Group By Operator [GBY_9] (rows=525 width=10)
-                                        Output:["_col0","_col1"],keys:_col0, _col1
+                                        Output:["_col0","_col1"],keys:_col1, _col0
                                         Select Operator [SEL_2] (rows=25 width=7)
                                           Output:["_col0","_col1"]
                                           Filter Operator [FIL_150] (rows=25 width=7)
@@ -1566,7 +1574,7 @@ Stage-0
                                     Reduce Output Operator [RS_10]
                                       PartitionCols:_col0, _col1
                                       Group By Operator [GBY_9] (rows=525 width=10)
-                                        Output:["_col0","_col1"],keys:_col0, _col1
+                                        Output:["_col0","_col1"],keys:_col1, _col0
                                         Select Operator [SEL_5] (rows=500 width=10)
                                           Output:["_col0","_col1"]
                                           Filter Operator [FIL_151] (rows=500 width=10)
@@ -2616,7 +2624,7 @@ Stage-0
                           Reduce Output Operator [RS_105]
                             PartitionCols:_col0, _col1
                             Group By Operator [GBY_104] (rows=881 width=10)
-                              Output:["_col0","_col1"],keys:_col0, _col1
+                              Output:["_col0","_col1"],keys:_col1, _col0
                               Select Operator [SEL_100] (rows=500 width=10)
                                 Output:["_col0","_col1"]
                                 Filter Operator [FIL_161] (rows=500 width=10)
@@ -2627,51 +2635,55 @@ Stage-0
                           Reduce Output Operator [RS_105]
                             PartitionCols:_col0, _col1
                             Group By Operator [GBY_104] (rows=881 width=10)
-                              Output:["_col0","_col1"],keys:_col0, _col1
-                              Group By Operator [GBY_96] (rows=381 width=10)
-                                Output:["_col0","_col1"],keys:KEY._col0, KEY._col1
-                              <-Union 28 [SIMPLE_EDGE]
-                                <-Map 33 [CONTAINS]
-                                  Reduce Output Operator [RS_95]
-                                    PartitionCols:_col0, _col1
-                                    Group By Operator [GBY_94] (rows=762 width=10)
-                                      Output:["_col0","_col1"],keys:_col0, _col1
-                                      Select Operator [SEL_90] (rows=500 width=10)
-                                        Output:["_col0","_col1"]
-                                        Filter Operator [FIL_160] (rows=500 width=10)
-                                          predicate:value is not null
-                                          TableScan [TS_88] (rows=500 width=10)
-                                            Output:["key","value"]
-                                <-Reducer 27 [CONTAINS]
-                                  Reduce Output Operator [RS_95]
-                                    PartitionCols:_col0, _col1
-                                    Group By Operator [GBY_94] (rows=762 width=10)
-                                      Output:["_col0","_col1"],keys:_col0, _col1
-                                      Group By Operator [GBY_86] (rows=262 width=10)
-                                        Output:["_col0","_col1"],keys:KEY._col0, KEY._col1
-                                      <-Union 26 [SIMPLE_EDGE]
-                                        <-Map 25 [CONTAINS]
-                                          Reduce Output Operator [RS_85]
-                                            PartitionCols:_col0, _col1
-                                            Group By Operator [GBY_84] (rows=525 width=10)
-                                              Output:["_col0","_col1"],keys:_col0, _col1
-                                              Select Operator [SEL_77] (rows=25 width=7)
-                                                Output:["_col0","_col1"]
-                                                Filter Operator [FIL_158] (rows=25 width=7)
-                                                  predicate:value is not null
-                                                  TableScan [TS_75] (rows=25 width=7)
-                                                    Output:["key","value"]
-                                        <-Map 32 [CONTAINS]
-                                          Reduce Output Operator [RS_85]
-                                            PartitionCols:_col0, _col1
-                                            Group By Operator [GBY_84] (rows=525 width=10)
-                                              Output:["_col0","_col1"],keys:_col0, _col1
-                                              Select Operator [SEL_80] (rows=500 width=10)
-                                                Output:["_col0","_col1"]
-                                                Filter Operator [FIL_159] (rows=500 width=10)
-                                                  predicate:value is not null
-                                                  TableScan [TS_78] (rows=500 width=10)
-                                                    Output:["key","value"]
+                              Output:["_col0","_col1"],keys:_col1, _col0
+                              Select Operator [SEL_97] (rows=381 width=10)
+                                Output:["_col0","_col1"]
+                                Group By Operator [GBY_96] (rows=381 width=10)
+                                  Output:["_col0","_col1"],keys:KEY._col0, KEY._col1
+                                <-Union 28 [SIMPLE_EDGE]
+                                  <-Map 33 [CONTAINS]
+                                    Reduce Output Operator [RS_95]
+                                      PartitionCols:_col0, _col1
+                                      Group By Operator [GBY_94] (rows=762 width=10)
+                                        Output:["_col0","_col1"],keys:_col1, _col0
+                                        Select Operator [SEL_90] (rows=500 width=10)
+                                          Output:["_col0","_col1"]
+                                          Filter Operator [FIL_160] (rows=500 width=10)
+                                            predicate:value is not null
+                                            TableScan [TS_88] (rows=500 width=10)
+                                              Output:["key","value"]
+                                  <-Reducer 27 [CONTAINS]
+                                    Reduce Output Operator [RS_95]
+                                      PartitionCols:_col0, _col1
+                                      Group By Operator [GBY_94] (rows=762 width=10)
+                                        Output:["_col0","_col1"],keys:_col1, _col0
+                                        Select Operator [SEL_87] (rows=262 width=10)
+                                          Output:["_col0","_col1"]
+                                          Group By Operator [GBY_86] (rows=262 width=10)
+                                            Output:["_col0","_col1"],keys:KEY._col0, KEY._col1
+                                          <-Union 26 [SIMPLE_EDGE]
+                                            <-Map 25 [CONTAINS]
+                                              Reduce Output Operator [RS_85]
+                                                PartitionCols:_col0, _col1
+                                                Group By Operator [GBY_84] (rows=525 width=10)
+                                                  Output:["_col0","_col1"],keys:_col1, _col0
+                                                  Select Operator [SEL_77] (rows=25 width=7)
+                                                    Output:["_col0","_col1"]
+                                                    Filter Operator [FIL_158] (rows=25 width=7)
+                                                      predicate:value is not null
+                                                      TableScan [TS_75] (rows=25 width=7)
+                                                        Output:["key","value"]
+                                            <-Map 32 [CONTAINS]
+                                              Reduce Output Operator [RS_85]
+                                                PartitionCols:_col0, _col1
+                                                Group By Operator [GBY_84] (rows=525 width=10)
+                                                  Output:["_col0","_col1"],keys:_col1, _col0
+                                                  Select Operator [SEL_80] (rows=500 width=10)
+                                                    Output:["_col0","_col1"]
+                                                    Filter Operator [FIL_159] (rows=500 width=10)
+                                                      predicate:value is not null
+                                                      TableScan [TS_78] (rows=500 width=10)
+                                                        Output:["key","value"]
           <-Reducer 6 [CONTAINS]
             Reduce Output Operator [RS_119]
               PartitionCols:_col0, _col1
@@ -2724,7 +2736,7 @@ Stage-0
                                         Reduce Output Operator [RS_46]
                                           PartitionCols:_col0, _col1
                                           Group By Operator [GBY_45] (rows=762 width=10)
-                                            Output:["_col0","_col1"],keys:_col0, _col1
+                                            Output:["_col0","_col1"],keys:_col1, _col0
                                             Select Operator [SEL_41] (rows=500 width=10)
                                               Output:["_col0","_col1"]
                                               Filter Operator [FIL_153] (rows=500 width=10)
@@ -2735,32 +2747,34 @@ Stage-0
                                         Reduce Output Operator [RS_46]
                                           PartitionCols:_col0, _col1
                                           Group By Operator [GBY_45] (rows=762 width=10)
-                                            Output:["_col0","_col1"],keys:_col0, _col1
-                                            Group By Operator [GBY_37] (rows=262 width=10)
-                                              Output:["_col0","_col1"],keys:KEY._col0, KEY._col1
-                                            <-Union 13 [SIMPLE_EDGE]
-                                              <-Map 12 [CONTAINS]
-                                                Reduce Output Operator [RS_36]
-                                                  PartitionCols:_col0, _col1
-                                                  Group By Operator [GBY_35] (rows=525 width=10)
-                                                    Output:["_col0","_col1"],keys:_col0, _col1
-                                                    Select Operator [SEL_28] (rows=25 width=7)
-                                                      Output:["_col0","_col1"]
-                                                      Filter Operator [FIL_151] (rows=25 width=7)
-                                                        predicate:value is not null
-                                                        TableScan [TS_26] (rows=25 width=7)
-                                                          Output:["key","value"]
-                                              <-Map 19 [CONTAINS]
-                                                Reduce Output Operator [RS_36]
-                                                  PartitionCols:_col0, _col1
-                                                  Group By Operator [GBY_35] (rows=525 width=10)
-                                                    Output:["_col0","_col1"],keys:_col0, _col1
-                                                    Select Operator [SEL_31] (rows=500 width=10)
-                                                      Output:["_col0","_col1"]
-                                                      Filter Operator [FIL_152] (rows=500 width=10)
-                                                        predicate:value is not null
-                                                        TableScan [TS_29] (rows=500 width=10)
-                                                          Output:["key","value"]
+                                            Output:["_col0","_col1"],keys:_col1, _col0
+                                            Select Operator [SEL_38] (rows=262 width=10)
+                                              Output:["_col0","_col1"]
+                                              Group By Operator [GBY_37] (rows=262 width=10)
+                                                Output:["_col0","_col1"],keys:KEY._col0, KEY._col1
+                                              <-Union 13 [SIMPLE_EDGE]
+                                                <-Map 12 [CONTAINS]
+                                                  Reduce Output Operator [RS_36]
+                                                    PartitionCols:_col0, _col1
+                                                    Group By Operator [GBY_35] (rows=525 width=10)
+                                                      Output:["_col0","_col1"],keys:_col1, _col0
+                                                      Select Operator [SEL_28] (rows=25 width=7)
+                                                        Output:["_col0","_col1"]
+                                                        Filter Operator [FIL_151] (rows=25 width=7)
+                                                          predicate:value is not null
+                                                          TableScan [TS_26] (rows=25 width=7)
+                                                            Output:["key","value"]
+                                                <-Map 19 [CONTAINS]
+                                                  Reduce Output Operator [RS_36]
+                                                    PartitionCols:_col0, _col1
+                                                    Group By Operator [GBY_35] (rows=525 width=10)
+                                                      Output:["_col0","_col1"],keys:_col1, _col0
+                                                      Select Operator [SEL_31] (rows=500 width=10)
+                                                        Output:["_col0","_col1"]
+                                                        Filter Operator [FIL_152] (rows=500 width=10)
+                                                          predicate:value is not null
+                                                          TableScan [TS_29] (rows=500 width=10)
+                                                            Output:["key","value"]
                   <-Reducer 4 [CONTAINS]
                     Reduce Output Operator [RS_66]
                       PartitionCols:_col0, _col1
@@ -2802,7 +2816,7 @@ Stage-0
                                       Reduce Output Operator [RS_10]
                                         PartitionCols:_col0, _col1
                                         Group By Operator [GBY_9] (rows=525 width=10)
-                                          Output:["_col0","_col1"],keys:_col0, _col1
+                                          Output:["_col0","_col1"],keys:_col1, _col0
                                           Select Operator [SEL_2] (rows=25 width=7)
                                             Output:["_col0","_col1"]
                                             Filter Operator [FIL_147] (rows=25 width=7)
@@ -2813,7 +2827,7 @@ Stage-0
                                       Reduce Output Operator [RS_10]
                                         PartitionCols:_col0, _col1
                                         Group By Operator [GBY_9] (rows=525 width=10)
-                                          Output:["_col0","_col1"],keys:_col0, _col1
+                                          Output:["_col0","_col1"],keys:_col1, _col0
                                           Select Operator [SEL_5] (rows=500 width=10)
                                             Output:["_col0","_col1"]
                                             Filter Operator [FIL_148] (rows=500 width=10)

http://git-wip-us.apache.org/repos/asf/hive/blob/a70c82fd/ql/src/test/results/clientpositive/tez/subquery_exists.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/tez/subquery_exists.q.out b/ql/src/test/results/clientpositive/tez/subquery_exists.q.out
index b281885..f3a1fa5 100644
--- a/ql/src/test/results/clientpositive/tez/subquery_exists.q.out
+++ b/ql/src/test/results/clientpositive/tez/subquery_exists.q.out
@@ -49,9 +49,9 @@ STAGE PLANS:
                       outputColumnNames: _col0, _col1
                       Statistics: Num rows: 166 Data size: 1763 Basic stats: COMPLETE Column stats: NONE
                       Reduce Output Operator
-                        key expressions: _col1 (type: string), _col0 (type: string)
+                        key expressions: _col0 (type: string), _col1 (type: string)
                         sort order: ++
-                        Map-reduce partition columns: _col1 (type: string), _col0 (type: string)
+                        Map-reduce partition columns: _col0 (type: string), _col1 (type: string)
                         Statistics: Num rows: 166 Data size: 1763 Basic stats: COMPLETE Column stats: NONE
         Map 3 
             Map Operator Tree:
@@ -62,7 +62,7 @@ STAGE PLANS:
                     predicate: ((value > 'val_9') and key is not null) (type: boolean)
                     Statistics: Num rows: 166 Data size: 1763 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
-                      expressions: value (type: string), key (type: string)
+                      expressions: key (type: string), value (type: string)
                       outputColumnNames: _col0, _col1
                       Statistics: Num rows: 166 Data size: 1763 Basic stats: COMPLETE Column stats: NONE
                       Group By Operator
@@ -81,7 +81,7 @@ STAGE PLANS:
                 condition map:
                      Left Semi Join 0 to 1
                 keys:
-                  0 _col1 (type: string), _col0 (type: string)
+                  0 _col0 (type: string), _col1 (type: string)
                   1 _col0 (type: string), _col1 (type: string)
                 outputColumnNames: _col0, _col1
                 Statistics: Num rows: 182 Data size: 1939 Basic stats: COMPLETE Column stats: NONE


Mime
View raw message