Repository: hive
Updated Branches:
  refs/heads/master 6bde1ed74 -> 123e2eb64


HIVE-18585 : Return type for udfs should be determined using Hive inference 
rules instead of Calcite (Ashutosh Chauhan via Jesus Camacho Rodriguez)

Signed-off-by: Ashutosh Chauhan <[email protected]>


Project: http://git-wip-us.apache.org/repos/asf/hive/repo
Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/123e2eb6
Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/123e2eb6
Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/123e2eb6

Branch: refs/heads/master
Commit: 123e2eb64c4d5a57a8841576ffae66c0dcd2afa1
Parents: 6bde1ed
Author: Ashutosh Chauhan <[email protected]>
Authored: Tue Jan 30 10:59:29 2018 -0800
Committer: Ashutosh Chauhan <[email protected]>
Committed: Tue Jan 30 17:27:16 2018 -0800

----------------------------------------------------------------------
 .../calcite/translator/RexNodeConverter.java    |  2 +-
 ql/src/test/queries/clientpositive/fold_case.q  |  2 +
 .../results/clientpositive/cbo_udf_max.q.out    |  8 +--
 .../clientpositive/decimal_precision2.q.out     |  2 +-
 .../test/results/clientpositive/fold_case.q.out | 23 ++++++
 .../clientpositive/perf/spark/query72.q.out     | 73 ++++++++++----------
 .../clientpositive/perf/tez/query72.q.out       | 34 ++++-----
 .../results/clientpositive/union_offcbo.q.out   |  8 +--
 8 files changed, 89 insertions(+), 63 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/123e2eb6/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/translator/RexNodeConverter.java
----------------------------------------------------------------------
diff --git 
a/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/translator/RexNodeConverter.java
 
b/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/translator/RexNodeConverter.java
index f53739d..39ff591 100644
--- 
a/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/translator/RexNodeConverter.java
+++ 
b/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/translator/RexNodeConverter.java
@@ -337,7 +337,7 @@ public class RexNodeConverter {
         // If it is a floor <date> operator, we need to rewrite it
         childRexNodeLst = rewriteFloorDateChildren(calciteOp, childRexNodeLst);
       }
-      expr = cluster.getRexBuilder().makeCall(calciteOp, childRexNodeLst);
+      expr = cluster.getRexBuilder().makeCall(retType, calciteOp, 
childRexNodeLst);
     } else {
       retType = expr.getType();
     }

http://git-wip-us.apache.org/repos/asf/hive/blob/123e2eb6/ql/src/test/queries/clientpositive/fold_case.q
----------------------------------------------------------------------
diff --git a/ql/src/test/queries/clientpositive/fold_case.q 
b/ql/src/test/queries/clientpositive/fold_case.q
index e2b490e..0066c41 100644
--- a/ql/src/test/queries/clientpositive/fold_case.q
+++ b/ql/src/test/queries/clientpositive/fold_case.q
@@ -24,3 +24,5 @@ from src;
 explain
 select (CASE WHEN key = value THEN '1' WHEN true THEN '0' ELSE NULL END)
 from src;
+explain
+select (case when true then key when not true then to_date(key) else null end) 
from src;

http://git-wip-us.apache.org/repos/asf/hive/blob/123e2eb6/ql/src/test/results/clientpositive/cbo_udf_max.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/cbo_udf_max.q.out 
b/ql/src/test/results/clientpositive/cbo_udf_max.q.out
index 461351d..9671bf1 100644
--- a/ql/src/test/results/clientpositive/cbo_udf_max.q.out
+++ b/ql/src/test/results/clientpositive/cbo_udf_max.q.out
@@ -22,7 +22,7 @@ FROM src
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@src
 #### A masked pattern was here ####
-{"expr$0":498,"expr$1":"val_498"}      {"expr$0":"98","expr$1":"val_98"}
+{"col1":498,"col2":"val_498"}  {"col1":"98","col2":"val_98"}
 PREHOOK: query: SELECT max(struct(CAST(key as INT), value)),
        max(struct(key, value))
 FROM src
@@ -35,7 +35,7 @@ FROM src
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@src
 #### A masked pattern was here ####
-{"expr$0":498,"expr$1":"val_498"}      {"expr$0":"98","expr$1":"val_98"}
+{"col1":498,"col2":"val_498"}  {"col1":"98","col2":"val_98"}
 PREHOOK: query: SELECT max(struct(CAST(key as INT), value)),
        max(struct(key, value))
 FROM src
@@ -48,7 +48,7 @@ FROM src
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@src
 #### A masked pattern was here ####
-{"expr$0":498,"expr$1":"val_498"}      {"expr$0":"98","expr$1":"val_98"}
+{"col1":498,"col2":"val_498"}  {"col1":"98","col2":"val_98"}
 PREHOOK: query: SELECT max(struct(CAST(key as INT), value)),
        max(struct(key, value))
 FROM src
@@ -61,4 +61,4 @@ FROM src
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@src
 #### A masked pattern was here ####
-{"expr$0":498,"expr$1":"val_498"}      {"expr$0":"98","expr$1":"val_98"}
+{"col1":498,"col2":"val_498"}  {"col1":"98","col2":"val_98"}

http://git-wip-us.apache.org/repos/asf/hive/blob/123e2eb6/ql/src/test/results/clientpositive/decimal_precision2.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/decimal_precision2.q.out 
b/ql/src/test/results/clientpositive/decimal_precision2.q.out
index ca533a4..3185c38 100644
--- a/ql/src/test/results/clientpositive/decimal_precision2.q.out
+++ b/ql/src/test/results/clientpositive/decimal_precision2.q.out
@@ -147,7 +147,7 @@ STAGE PLANS:
           Row Limit Per Split: 1
           Statistics: Num rows: 1 Data size: 10 Basic stats: COMPLETE Column 
stats: COMPLETE
           Select Operator
-            expressions: 69.0212249755859375 (type: decimal(18,16))
+            expressions: 69.0212249755859375 (type: decimal(27,20))
             outputColumnNames: _col0
             Statistics: Num rows: 1 Data size: 112 Basic stats: COMPLETE 
Column stats: COMPLETE
             ListSink

http://git-wip-us.apache.org/repos/asf/hive/blob/123e2eb6/ql/src/test/results/clientpositive/fold_case.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/fold_case.q.out 
b/ql/src/test/results/clientpositive/fold_case.q.out
index 156608f..191c108 100644
--- a/ql/src/test/results/clientpositive/fold_case.q.out
+++ b/ql/src/test/results/clientpositive/fold_case.q.out
@@ -511,3 +511,26 @@ STAGE PLANS:
       Processor Tree:
         ListSink
 
+PREHOOK: query: explain
+select (case when true then key when not true then to_date(key) else null end) 
from src
+PREHOOK: type: QUERY
+POSTHOOK: query: explain
+select (case when true then key when not true then to_date(key) else null end) 
from src
+POSTHOOK: type: QUERY
+STAGE DEPENDENCIES:
+  Stage-0 is a root stage
+
+STAGE PLANS:
+  Stage: Stage-0
+    Fetch Operator
+      limit: -1
+      Processor Tree:
+        TableScan
+          alias: src
+          Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE 
Column stats: NONE
+          Select Operator
+            expressions: key (type: string)
+            outputColumnNames: _col0
+            Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE 
Column stats: NONE
+            ListSink
+

http://git-wip-us.apache.org/repos/asf/hive/blob/123e2eb6/ql/src/test/results/clientpositive/perf/spark/query72.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/perf/spark/query72.q.out 
b/ql/src/test/results/clientpositive/perf/spark/query72.q.out
index 809d213..ea43033 100644
--- a/ql/src/test/results/clientpositive/perf/spark/query72.q.out
+++ b/ql/src/test/results/clientpositive/perf/spark/query72.q.out
@@ -321,7 +321,7 @@ STAGE PLANS:
                     keys:
                       0 _col5 (type: int)
                       1 _col0 (type: int)
-                    outputColumnNames: _col1, _col4, _col6, _col7, _col9, 
_col10
+                    outputColumnNames: _col1, _col4, _col6, _col7, _col9, 
_col10, _col16
                     input vertices:
                       1 Map 16
                     Statistics: Num rows: 421645953 Data size: 57099332415 
Basic stats: COMPLETE Column stats: NONE
@@ -330,7 +330,7 @@ STAGE PLANS:
                       sort order: +
                       Map-reduce partition columns: _col4 (type: int)
                       Statistics: Num rows: 421645953 Data size: 57099332415 
Basic stats: COMPLETE Column stats: NONE
-                      value expressions: _col1 (type: int), _col6 (type: int), 
_col7 (type: int), _col9 (type: string), _col10 (type: int)
+                      value expressions: _col1 (type: int), _col6 (type: int), 
_col7 (type: int), _col9 (type: string), _col10 (type: int), _col16 (type: int)
         Reducer 11 
             Reduce Operator Tree:
               Join Operator
@@ -339,14 +339,14 @@ STAGE PLANS:
                 keys:
                   0 _col4 (type: int)
                   1 _col0 (type: int)
-                outputColumnNames: _col1, _col4, _col6, _col7, _col9, _col10, 
_col18
+                outputColumnNames: _col1, _col4, _col6, _col7, _col9, _col10, 
_col16, _col18
                 Statistics: Num rows: 463810558 Data size: 62809267017 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: 463810558 Data size: 62809267017 Basic 
stats: COMPLETE Column stats: NONE
-                  value expressions: _col4 (type: int), _col6 (type: int), 
_col7 (type: int), _col9 (type: string), _col10 (type: int), _col18 (type: 
string)
+                  value expressions: _col4 (type: int), _col6 (type: int), 
_col7 (type: int), _col9 (type: string), _col10 (type: int), _col16 (type: 
int), _col18 (type: string)
         Reducer 12 
             Reduce Operator Tree:
               Join Operator
@@ -355,21 +355,21 @@ STAGE PLANS:
                 keys:
                   0 _col1 (type: int)
                   1 _col0 (type: int)
-                outputColumnNames: _col4, _col6, _col7, _col9, _col10, _col18, 
_col20
+                outputColumnNames: _col4, _col6, _col7, _col9, _col10, _col16, 
_col18, _col20
                 Statistics: Num rows: 510191624 Data size: 69090195216 Basic 
stats: COMPLETE Column stats: NONE
                 Filter Operator
                   predicate: (UDFToDouble(_col20) > (UDFToDouble(_col9) + 
5.0)) (type: boolean)
                   Statistics: Num rows: 170063874 Data size: 23030064981 Basic 
stats: COMPLETE Column stats: NONE
                   Select Operator
-                    expressions: _col18 (type: string), _col4 (type: int), 
_col6 (type: int), _col7 (type: int), _col10 (type: int)
-                    outputColumnNames: _col3, _col8, _col10, _col11, _col14
+                    expressions: _col18 (type: string), _col4 (type: int), 
_col6 (type: int), _col7 (type: int), _col10 (type: int), _col16 (type: int)
+                    outputColumnNames: _col3, _col8, _col10, _col11, _col14, 
_col20
                     Statistics: Num rows: 170063874 Data size: 23030064981 
Basic stats: COMPLETE Column stats: NONE
                     Reduce Output Operator
                       key expressions: _col8 (type: int)
                       sort order: +
                       Map-reduce partition columns: _col8 (type: int)
                       Statistics: Num rows: 170063874 Data size: 23030064981 
Basic stats: COMPLETE Column stats: NONE
-                      value expressions: _col3 (type: string), _col10 (type: 
int), _col11 (type: int), _col14 (type: int)
+                      value expressions: _col3 (type: string), _col10 (type: 
int), _col11 (type: int), _col14 (type: int), _col20 (type: int)
         Reducer 2 
             Reduce Operator Tree:
               Join Operator
@@ -378,7 +378,7 @@ STAGE PLANS:
                 keys:
                   0 _col1 (type: int)
                   1 _col8 (type: int)
-                outputColumnNames: _col0, _col3, _col5, _col9, _col14, _col16, 
_col17, _col20
+                outputColumnNames: _col0, _col3, _col5, _col9, _col14, _col16, 
_col17, _col20, _col26
                 Statistics: Num rows: 187070265 Data size: 25333072028 Basic 
stats: COMPLETE Column stats: NONE
                 Filter Operator
                   predicate: (_col3 < _col17) (type: boolean)
@@ -388,7 +388,7 @@ STAGE PLANS:
                     sort order: ++
                     Map-reduce partition columns: _col0 (type: int), _col20 
(type: int)
                     Statistics: Num rows: 62356755 Data size: 8444357342 Basic 
stats: COMPLETE Column stats: NONE
-                    value expressions: _col5 (type: string), _col9 (type: 
string), _col14 (type: int), _col16 (type: int)
+                    value expressions: _col5 (type: string), _col9 (type: 
string), _col14 (type: int), _col16 (type: int), _col26 (type: int)
         Reducer 3 
             Reduce Operator Tree:
               Join Operator
@@ -397,18 +397,18 @@ STAGE PLANS:
                 keys:
                   0 _col0 (type: int), _col20 (type: int)
                   1 _col0 (type: int), _col1 (type: int)
-                outputColumnNames: _col5, _col9, _col14, _col16, _col20
+                outputColumnNames: _col5, _col9, _col14, _col16, _col20, _col26
                 Statistics: Num rows: 68592431 Data size: 9288793277 Basic 
stats: COMPLETE Column stats: NONE
                 Select Operator
-                  expressions: _col14 (type: int), _col16 (type: int), _col5 
(type: string), _col9 (type: string), _col20 (type: int)
-                  outputColumnNames: _col4, _col6, _col13, _col15, _col22
+                  expressions: _col14 (type: int), _col16 (type: int), _col5 
(type: string), _col9 (type: string), _col20 (type: int), _col26 (type: int)
+                  outputColumnNames: _col4, _col6, _col13, _col15, _col22, 
_col28
                   Statistics: Num rows: 68592431 Data size: 9288793277 Basic 
stats: COMPLETE Column stats: NONE
                   Reduce Output Operator
                     key expressions: _col4 (type: int), _col6 (type: int)
                     sort order: ++
                     Map-reduce partition columns: _col4 (type: int), _col6 
(type: int)
                     Statistics: Num rows: 68592431 Data size: 9288793277 Basic 
stats: COMPLETE Column stats: NONE
-                    value expressions: _col13 (type: string), _col15 (type: 
string), _col22 (type: int)
+                    value expressions: _col13 (type: string), _col15 (type: 
string), _col22 (type: int), _col28 (type: int)
         Reducer 4 
             Reduce Operator Tree:
               Join Operator
@@ -417,41 +417,42 @@ STAGE PLANS:
                 keys:
                   0 _col4 (type: int), _col6 (type: int)
                   1 _col0 (type: int), _col1 (type: int)
-                outputColumnNames: _col13, _col15, _col22
+                outputColumnNames: _col13, _col15, _col22, _col28
                 Statistics: Num rows: 75451675 Data size: 10217672826 Basic 
stats: COMPLETE Column stats: NONE
-                Group By Operator
-                  aggregations: count()
-                  keys: _col15 (type: string), _col13 (type: string), _col22 
(type: int)
-                  mode: hash
-                  outputColumnNames: _col0, _col1, _col2, _col3
+                Select Operator
+                  expressions: _col15 (type: string), _col13 (type: string), 
_col22 (type: int), CASE WHEN (_col28 is null) THEN (1) ELSE (0) END (type: 
int), CASE WHEN (_col28 is not null) THEN (1) ELSE (0) END (type: int)
+                  outputColumnNames: _col0, _col1, _col2, _col3, _col4
                   Statistics: Num rows: 75451675 Data size: 10217672826 Basic 
stats: COMPLETE Column stats: NONE
-                  Reduce Output Operator
-                    key expressions: _col0 (type: string), _col1 (type: 
string), _col2 (type: int)
-                    sort order: +++
-                    Map-reduce partition columns: _col0 (type: string), _col1 
(type: string), _col2 (type: int)
+                  Group By Operator
+                    aggregations: count(_col3), count(_col4), count()
+                    keys: _col0 (type: string), _col1 (type: string), _col2 
(type: int)
+                    mode: hash
+                    outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5
                     Statistics: Num rows: 75451675 Data size: 10217672826 
Basic stats: COMPLETE Column stats: NONE
-                    value expressions: _col3 (type: bigint)
+                    Reduce Output Operator
+                      key expressions: _col0 (type: string), _col1 (type: 
string), _col2 (type: int)
+                      sort order: +++
+                      Map-reduce partition columns: _col0 (type: string), 
_col1 (type: string), _col2 (type: int)
+                      Statistics: Num rows: 75451675 Data size: 10217672826 
Basic stats: COMPLETE Column stats: NONE
+                      value expressions: _col3 (type: bigint), _col4 (type: 
bigint), _col5 (type: bigint)
         Reducer 5 
             Reduce Operator Tree:
               Group By Operator
-                aggregations: count(VALUE._col0)
+                aggregations: count(VALUE._col0), count(VALUE._col1), 
count(VALUE._col2)
                 keys: KEY._col0 (type: string), KEY._col1 (type: string), 
KEY._col2 (type: int)
                 mode: mergepartial
-                outputColumnNames: _col0, _col1, _col2, _col3
+                outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5
                 Statistics: Num rows: 37725837 Data size: 5108836345 Basic 
stats: COMPLETE Column stats: NONE
-                Select Operator
-                  expressions: _col0 (type: string), _col1 (type: string), 
_col2 (type: int), _col3 (type: bigint)
-                  outputColumnNames: _col0, _col1, _col2, _col5
+                Reduce Output Operator
+                  key expressions: _col5 (type: bigint), _col0 (type: string), 
_col1 (type: string), _col2 (type: int)
+                  sort order: -+++
                   Statistics: Num rows: 37725837 Data size: 5108836345 Basic 
stats: COMPLETE Column stats: NONE
-                  Reduce Output Operator
-                    key expressions: _col5 (type: bigint), _col0 (type: 
string), _col1 (type: string), _col2 (type: int)
-                    sort order: -+++
-                    Statistics: Num rows: 37725837 Data size: 5108836345 Basic 
stats: COMPLETE Column stats: NONE
-                    TopN Hash Memory Usage: 0.1
+                  TopN Hash Memory Usage: 0.1
+                  value expressions: _col3 (type: bigint), _col4 (type: bigint)
         Reducer 6 
             Reduce Operator Tree:
               Select Operator
-                expressions: KEY.reducesinkkey1 (type: string), 
KEY.reducesinkkey2 (type: string), KEY.reducesinkkey3 (type: int), 
KEY.reducesinkkey0 (type: bigint), KEY.reducesinkkey0 (type: bigint), 
KEY.reducesinkkey0 (type: bigint)
+                expressions: KEY.reducesinkkey1 (type: string), 
KEY.reducesinkkey2 (type: string), KEY.reducesinkkey3 (type: int), VALUE._col0 
(type: bigint), VALUE._col1 (type: bigint), KEY.reducesinkkey0 (type: bigint)
                 outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5
                 Statistics: Num rows: 37725837 Data size: 5108836345 Basic 
stats: COMPLETE Column stats: NONE
                 Limit

http://git-wip-us.apache.org/repos/asf/hive/blob/123e2eb6/ql/src/test/results/clientpositive/perf/tez/query72.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/perf/tez/query72.q.out 
b/ql/src/test/results/clientpositive/perf/tez/query72.q.out
index a5e3501..55ddd5a 100644
--- a/ql/src/test/results/clientpositive/perf/tez/query72.q.out
+++ b/ql/src/test/results/clientpositive/perf/tez/query72.q.out
@@ -86,17 +86,17 @@ Stage-0
             Output:["_col0","_col1","_col2","_col3","_col4","_col5"]
           <-Reducer 6 [SIMPLE_EDGE]
             SHUFFLE [RS_72]
-              Select Operator [SEL_70] (rows=37725837 width=135)
-                Output:["_col0","_col1","_col2","_col5"]
-                Group By Operator [GBY_69] (rows=37725837 width=135)
-                  
Output:["_col0","_col1","_col2","_col3"],aggregations:["count(VALUE._col0)"],keys:KEY._col0,
 KEY._col1, KEY._col2
-                <-Reducer 5 [SIMPLE_EDGE]
-                  SHUFFLE [RS_68]
-                    PartitionCols:_col0, _col1, _col2
-                    Group By Operator [GBY_67] (rows=75451675 width=135)
-                      
Output:["_col0","_col1","_col2","_col3"],aggregations:["count()"],keys:_col15, 
_col13, _col22
+              Group By Operator [GBY_70] (rows=37725837 width=135)
+                
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 5 [SIMPLE_EDGE]
+                SHUFFLE [RS_69]
+                  PartitionCols:_col0, _col1, _col2
+                  Group By Operator [GBY_68] (rows=75451675 width=135)
+                    
Output:["_col0","_col1","_col2","_col3","_col4","_col5"],aggregations:["count(_col3)","count(_col4)","count()"],keys:_col0,
 _col1, _col2
+                    Select Operator [SEL_66] (rows=75451675 width=135)
+                      Output:["_col0","_col1","_col2","_col3","_col4"]
                       Merge Join Operator [MERGEJOIN_141] (rows=75451675 
width=135)
-                        Conds:RS_63._col4, _col6=RS_64._col0, _col1(Left 
Outer),Output:["_col13","_col15","_col22"]
+                        Conds:RS_63._col4, _col6=RS_64._col0, _col1(Left 
Outer),Output:["_col13","_col15","_col22","_col28"]
                       <-Map 23 [SIMPLE_EDGE]
                         SHUFFLE [RS_64]
                           PartitionCols:_col0, _col1
@@ -110,9 +110,9 @@ Stage-0
                         SHUFFLE [RS_63]
                           PartitionCols:_col4, _col6
                           Select Operator [SEL_59] (rows=68592431 width=135)
-                            Output:["_col4","_col6","_col13","_col15","_col22"]
+                            
Output:["_col4","_col6","_col13","_col15","_col22","_col28"]
                             Merge Join Operator [MERGEJOIN_140] (rows=68592431 
width=135)
-                              Conds:RS_56._col0, _col20=RS_57._col0, 
_col1(Inner),Output:["_col5","_col9","_col14","_col16","_col20"]
+                              Conds:RS_56._col0, _col20=RS_57._col0, 
_col1(Inner),Output:["_col5","_col9","_col14","_col16","_col20","_col26"]
                             <-Map 22 [SIMPLE_EDGE]
                               SHUFFLE [RS_57]
                                 PartitionCols:_col0, _col1
@@ -128,16 +128,16 @@ Stage-0
                                 Filter Operator [FIL_55] (rows=62356755 
width=135)
                                   predicate:(_col3 < _col17)
                                   Merge Join Operator [MERGEJOIN_139] 
(rows=187070265 width=135)
-                                    
Conds:RS_52._col1=RS_53._col8(Inner),Output:["_col0","_col3","_col5","_col9","_col14","_col16","_col17","_col20"]
+                                    
Conds:RS_52._col1=RS_53._col8(Inner),Output:["_col0","_col3","_col5","_col9","_col14","_col16","_col17","_col20","_col26"]
                                   <-Reducer 15 [SIMPLE_EDGE]
                                     SHUFFLE [RS_53]
                                       PartitionCols:_col8
                                       Select Operator [SEL_45] (rows=170063874 
width=135)
-                                        
Output:["_col3","_col8","_col10","_col11","_col14"]
+                                        
Output:["_col3","_col8","_col10","_col11","_col14","_col20"]
                                         Filter Operator [FIL_44] 
(rows=170063874 width=135)
                                           predicate:(UDFToDouble(_col20) > 
(UDFToDouble(_col9) + 5.0))
                                           Merge Join Operator [MERGEJOIN_138] 
(rows=510191624 width=135)
-                                            
Conds:RS_41._col1=RS_42._col0(Inner),Output:["_col4","_col6","_col7","_col9","_col10","_col18","_col20"]
+                                            
Conds:RS_41._col1=RS_42._col0(Inner),Output:["_col4","_col6","_col7","_col9","_col10","_col16","_col18","_col20"]
                                           <-Map 21 [SIMPLE_EDGE]
                                             SHUFFLE [RS_42]
                                               PartitionCols:_col0
@@ -151,7 +151,7 @@ Stage-0
                                             SHUFFLE [RS_41]
                                               PartitionCols:_col1
                                               Merge Join Operator 
[MERGEJOIN_137] (rows=463810558 width=135)
-                                                
Conds:RS_38._col4=RS_39._col0(Inner),Output:["_col1","_col4","_col6","_col7","_col9","_col10","_col18"]
+                                                
Conds:RS_38._col4=RS_39._col0(Inner),Output:["_col1","_col4","_col6","_col7","_col9","_col10","_col16","_col18"]
                                               <-Map 20 [SIMPLE_EDGE]
                                                 SHUFFLE [RS_39]
                                                   PartitionCols:_col0
@@ -165,7 +165,7 @@ Stage-0
                                                 SHUFFLE [RS_38]
                                                   PartitionCols:_col4
                                                   Merge Join Operator 
[MERGEJOIN_136] (rows=421645953 width=135)
-                                                    
Conds:RS_35._col5=RS_36._col0(Left 
Outer),Output:["_col1","_col4","_col6","_col7","_col9","_col10"]
+                                                    
Conds:RS_35._col5=RS_36._col0(Left 
Outer),Output:["_col1","_col4","_col6","_col7","_col9","_col10","_col16"]
                                                   <-Map 19 [SIMPLE_EDGE]
                                                     SHUFFLE [RS_36]
                                                       PartitionCols:_col0

http://git-wip-us.apache.org/repos/asf/hive/blob/123e2eb6/ql/src/test/results/clientpositive/union_offcbo.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/union_offcbo.q.out 
b/ql/src/test/results/clientpositive/union_offcbo.q.out
index df56539..a723f00 100644
--- a/ql/src/test/results/clientpositive/union_offcbo.q.out
+++ b/ql/src/test/results/clientpositive/union_offcbo.q.out
@@ -629,7 +629,7 @@ 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
           Filter Operator
-            predicate: (((NVL(_col0,-1) <> NVL(_col7,-1)) or (NVL(_col1,-1) <> 
NVL(_col8,-1))) and (CASE WHEN ((_col7 is not null and _col0 is null and (_col3 
>= '2016-02-05'))) THEN ('DEL') WHEN ((_col7 is not null and _col0 is null and 
(_col3 <= '2016-02-05'))) THEN ('RET') WHEN (((_col7 = _col0) and (_col8 <> 
_col1))) THEN ('A_INS') ELSE ('NA') END <> 'RET')) (type: boolean)
+            predicate: (((NVL(_col0,-1) <> NVL(_col7,-1)) or (NVL(_col1,-1) <> 
NVL(_col8,-1))) and CASE WHEN ((_col0 is null and (_col3 >= '2016-02-05') and 
_col7 is not null)) THEN (true) WHEN ((_col0 is null and (_col3 <= 
'2016-02-05') and _col7 is not null)) THEN (false) WHEN (((_col7 = _col0) and 
(_col8 <> _col1))) THEN (true) ELSE (true) END) (type: boolean)
             Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column 
stats: NONE
             Select Operator
               expressions: _col2 (type: bigint), _col5 (type: string), _col6 
(type: bigint), _col4 (type: string), _col7 (type: string), _col8 (type: 
string), CASE WHEN ((_col7 is not null and _col0 is null and (_col3 >= 
'2016-02-05'))) THEN ('DEL') WHEN ((_col7 is not null and _col0 is null and 
(_col3 <= '2016-02-05'))) THEN ('RET') WHEN (((_col7 = _col0) and (_col8 <> 
_col1))) THEN ('A_INS') ELSE ('NA') END (type: string)
@@ -719,7 +719,7 @@ STAGE PLANS:
           outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, 
_col7
           Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column 
stats: NONE
           Filter Operator
-            predicate: (((NVL(_col3,-1) <> NVL(_col6,-1)) or (NVL(_col4,-1) <> 
NVL(_col7,-1))) and (CASE WHEN ((_col6 is not null and _col3 is null and (_col5 
<= '2015-11-20'))) THEN ('DEL') WHEN (((_col6 is null and _col3 is not null) or 
((_col6 = _col3) and (_col7 <> _col4)))) THEN ('INS') ELSE ('NA') END <> 
'RET')) (type: boolean)
+            predicate: ((NVL(_col3,-1) <> NVL(_col6,-1)) or (NVL(_col4,-1) <> 
NVL(_col7,-1))) (type: boolean)
             Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column 
stats: NONE
             Select Operator
               expressions: _col0 (type: bigint), _col1 (type: string), _col2 
(type: bigint), '2099-12-31' (type: string), _col3 (type: string), _col4 (type: 
string), CASE WHEN ((_col6 is not null and _col3 is null and (_col5 <= 
'2015-11-20'))) THEN ('DEL') WHEN (((_col6 is null and _col3 is not null) or 
((_col6 = _col3) and (_col7 <> _col4)))) THEN ('INS') ELSE ('NA') END (type: 
string)
@@ -1668,7 +1668,7 @@ 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
           Filter Operator
-            predicate: (((NVL(_col0,-1) <> NVL(_col7,-1)) or (NVL(_col1,-1) <> 
NVL(_col8,-1))) and (CASE WHEN ((_col7 is not null and _col0 is null and (_col3 
>= '2016-02-05'))) THEN ('DEL') WHEN ((_col7 is not null and _col0 is null and 
(_col3 <= '2016-02-05'))) THEN ('RET') WHEN (((_col7 = _col0) and (_col8 <> 
_col1))) THEN ('A_INS') ELSE ('NA') END <> 'RET')) (type: boolean)
+            predicate: (((NVL(_col0,-1) <> NVL(_col7,-1)) or (NVL(_col1,-1) <> 
NVL(_col8,-1))) and CASE WHEN ((_col0 is null and (_col3 >= '2016-02-05') and 
_col7 is not null)) THEN (true) WHEN ((_col0 is null and (_col3 <= 
'2016-02-05') and _col7 is not null)) THEN (false) WHEN (((_col7 = _col0) and 
(_col8 <> _col1))) THEN (true) ELSE (true) END) (type: boolean)
             Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column 
stats: NONE
             Select Operator
               expressions: _col2 (type: bigint), _col5 (type: string), _col6 
(type: bigint), _col4 (type: string), _col7 (type: string), _col8 (type: 
string), CASE WHEN ((_col7 is not null and _col0 is null and (_col3 >= 
'2016-02-05'))) THEN ('DEL') WHEN ((_col7 is not null and _col0 is null and 
(_col3 <= '2016-02-05'))) THEN ('RET') WHEN (((_col7 = _col0) and (_col8 <> 
_col1))) THEN ('A_INS') ELSE ('NA') END (type: string)
@@ -1758,7 +1758,7 @@ STAGE PLANS:
           outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, 
_col7
           Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column 
stats: NONE
           Filter Operator
-            predicate: (((NVL(_col3,-1) <> NVL(_col6,-1)) or (NVL(_col4,-1) <> 
NVL(_col7,-1))) and (CASE WHEN ((_col6 is not null and _col3 is null and (_col5 
<= '2015-11-20'))) THEN ('DEL') WHEN (((_col6 is null and _col3 is not null) or 
((_col6 = _col3) and (_col7 <> _col4)))) THEN ('INS') ELSE ('NA') END <> 
'RET')) (type: boolean)
+            predicate: ((NVL(_col3,-1) <> NVL(_col6,-1)) or (NVL(_col4,-1) <> 
NVL(_col7,-1))) (type: boolean)
             Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column 
stats: NONE
             Select Operator
               expressions: _col0 (type: bigint), _col1 (type: string), _col2 
(type: bigint), '2099-12-31' (type: string), _col3 (type: string), _col4 (type: 
string), CASE WHEN ((_col6 is not null and _col3 is null and (_col5 <= 
'2015-11-20'))) THEN ('DEL') WHEN (((_col6 is null and _col3 is not null) or 
((_col6 = _col3) and (_col7 <> _col4)))) THEN ('INS') ELSE ('NA') END (type: 
string)

Reply via email to