hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pxi...@apache.org
Subject [1/2] hive git commit: HIVE-12751: Fix NVL explain syntax (Gopal V via Pengcheng Xiong)
Date Sun, 27 Dec 2015 19:30:30 GMT
Repository: hive
Updated Branches:
  refs/heads/branch-2.0 55c629691 -> 1fbf12d45


HIVE-12751: Fix NVL explain syntax (Gopal V via Pengcheng Xiong)


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

Branch: refs/heads/branch-2.0
Commit: 28842f9b9f4e18f0b881778409b69b70c81d0b62
Parents: 55c6296
Author: Pengcheng Xiong <pxiong@apache.org>
Authored: Sun Dec 27 10:55:04 2015 -0800
Committer: Pengcheng Xiong <pxiong@apache.org>
Committed: Sun Dec 27 11:30:04 2015 -0800

----------------------------------------------------------------------
 .../org/apache/hadoop/hive/ql/udf/generic/GenericUDFNvl.java   | 6 +++---
 ql/src/test/results/clientpositive/tez/vector_nvl.q.out        | 2 +-
 ql/src/test/results/clientpositive/vector_nvl.q.out            | 2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/28842f9b/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFNvl.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFNvl.java b/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFNvl.java
index 0a16da8..87fd461 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFNvl.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFNvl.java
@@ -64,11 +64,11 @@ public class GenericUDFNvl extends GenericUDF{
   @Override
   public String getDisplayString(String[] children) {
     StringBuilder sb = new StringBuilder();
-    sb.append("if ");
+    sb.append("NVL(");
     sb.append(children[0]);
-    sb.append(" is null ");
-    sb.append("returns");
+    sb.append(',');
     sb.append(children[1]);
+    sb.append(')');
     return sb.toString() ;
   }
 

http://git-wip-us.apache.org/repos/asf/hive/blob/28842f9b/ql/src/test/results/clientpositive/tez/vector_nvl.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/tez/vector_nvl.q.out b/ql/src/test/results/clientpositive/tez/vector_nvl.q.out
index b3f83ce..b926ab4b 100644
--- a/ql/src/test/results/clientpositive/tez/vector_nvl.q.out
+++ b/ql/src/test/results/clientpositive/tez/vector_nvl.q.out
@@ -70,7 +70,7 @@ STAGE PLANS:
         TableScan
           alias: alltypesorc
           Select Operator
-            expressions: cfloat (type: float), if cfloat is null returns1 (type: float)
+            expressions: cfloat (type: float), NVL(cfloat,1) (type: float)
             outputColumnNames: _col0, _col1
             Limit
               Number of rows: 10

http://git-wip-us.apache.org/repos/asf/hive/blob/28842f9b/ql/src/test/results/clientpositive/vector_nvl.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/vector_nvl.q.out b/ql/src/test/results/clientpositive/vector_nvl.q.out
index 88836c0..88e8dca 100644
--- a/ql/src/test/results/clientpositive/vector_nvl.q.out
+++ b/ql/src/test/results/clientpositive/vector_nvl.q.out
@@ -88,7 +88,7 @@ STAGE PLANS:
             alias: alltypesorc
             Statistics: Num rows: 12288 Data size: 2641964 Basic stats: COMPLETE Column stats:
NONE
             Select Operator
-              expressions: cfloat (type: float), if cfloat is null returns1 (type: float)
+              expressions: cfloat (type: float), NVL(cfloat,1) (type: float)
               outputColumnNames: _col0, _col1
               Statistics: Num rows: 12288 Data size: 2641964 Basic stats: COMPLETE Column
stats: NONE
               Limit


Mime
View raw message