hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sunc...@apache.org
Subject hive git commit: HIVE-15233: UDF UUID() should be non-deterministic (Chao Sun, reviewed by Xuefu Zhang)
Date Fri, 18 Nov 2016 17:25:02 GMT
Repository: hive
Updated Branches:
  refs/heads/master 62d802b87 -> aebc9060b


HIVE-15233: UDF UUID() should be non-deterministic (Chao Sun, reviewed by Xuefu Zhang)


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

Branch: refs/heads/master
Commit: aebc9060bcf097407005997502e065feb7007c80
Parents: 62d802b
Author: Chao Sun <sunchao@apache.org>
Authored: Fri Nov 18 09:24:42 2016 -0800
Committer: Chao Sun <sunchao@apache.org>
Committed: Fri Nov 18 09:24:42 2016 -0800

----------------------------------------------------------------------
 ql/src/java/org/apache/hadoop/hive/ql/udf/UDFUUID.java     | 1 +
 ql/src/test/org/apache/hadoop/hive/ql/udf/TestUDFUUID.java | 5 +++++
 2 files changed, 6 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/aebc9060/ql/src/java/org/apache/hadoop/hive/ql/udf/UDFUUID.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/udf/UDFUUID.java b/ql/src/java/org/apache/hadoop/hive/ql/udf/UDFUUID.java
index 1340ded..4999bb0 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/udf/UDFUUID.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/udf/UDFUUID.java
@@ -36,6 +36,7 @@ extended = "The value is returned as a canonical UUID 36-character string.\n"
 + "  '0baf1f52-53df-487f-8292-99a03716b688'\n"
 + "  > SELECT _FUNC_();\n"
 + "  '36718a53-84f5-45d6-8796-4f79983ad49d'")
+@UDFType(deterministic = false)
 public class UDFUUID extends UDF {
   private final Text result = new Text();
   /**

http://git-wip-us.apache.org/repos/asf/hive/blob/aebc9060/ql/src/test/org/apache/hadoop/hive/ql/udf/TestUDFUUID.java
----------------------------------------------------------------------
diff --git a/ql/src/test/org/apache/hadoop/hive/ql/udf/TestUDFUUID.java b/ql/src/test/org/apache/hadoop/hive/ql/udf/TestUDFUUID.java
index 5f04547..cf32c11 100644
--- a/ql/src/test/org/apache/hadoop/hive/ql/udf/TestUDFUUID.java
+++ b/ql/src/test/org/apache/hadoop/hive/ql/udf/TestUDFUUID.java
@@ -20,6 +20,8 @@ package org.apache.hadoop.hive.ql.udf;
 
 import junit.framework.TestCase;
 
+import org.apache.hadoop.hive.ql.exec.FunctionRegistry;
+import org.apache.hadoop.hive.ql.udf.generic.GenericUDFBridge;
 import org.junit.Test;
 
 public class TestUDFUUID extends TestCase {
@@ -34,5 +36,8 @@ public class TestUDFUUID extends TestCase {
     
     assertEquals(id1.length(), 36);
     assertEquals(id2.length(), 36);
+
+    GenericUDFBridge bridge = new GenericUDFBridge("uuid", false, UDFUUID.class.getName());
+    assertFalse(FunctionRegistry.isDeterministic(bridge));
   }
 }


Mime
View raw message