This is an automated email from the ASF dual-hosted git repository.

ayushsaxena pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hive.git


The following commit(s) were added to refs/heads/master by this push:
     new 24a82a65f96 HIVE-27474: Deprecate registerUDF with function resources 
as param for in Registry (#4458). (Suprith Chandrashekharachar, reviewed by 
Ayush Saxena)
24a82a65f96 is described below

commit 24a82a65f96b65eeebe4e23b2fec425037a70216
Author: Suprith Kumar Suvarneshwar <[email protected]>
AuthorDate: Mon Jul 10 23:32:47 2023 -0700

    HIVE-27474: Deprecate registerUDF with function resources as param for in 
Registry (#4458). (Suprith Chandrashekharachar, reviewed by Ayush Saxena)
---
 .../org/apache/hadoop/hive/ql/exec/Registry.java    | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/ql/src/java/org/apache/hadoop/hive/ql/exec/Registry.java 
b/ql/src/java/org/apache/hadoop/hive/ql/exec/Registry.java
index d70cccd297a..d01da9f8f37 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/exec/Registry.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/exec/Registry.java
@@ -146,11 +146,21 @@ public class Registry {
 
   }
 
+  /**
+   * @deprecated From next release, replaced by {@link #registerUDF(String, 
Class, boolean)}
+   * Deprecated because method unnecessarily accepts and passes 
FunctionResource vararg param
+   */
+  @Deprecated
   public FunctionInfo registerUDF(String functionName,
       Class<? extends UDF> UDFClass, boolean isOperator, FunctionResource... 
resources) {
     return registerUDF(functionName, UDFClass, isOperator, 
functionName.toLowerCase(), resources);
   }
 
+  /**
+   * @deprecated From next release, replaced by {@link #registerUDF(String, 
Class, boolean, String)}
+   * Deprecated because method unnecessarily accepts FunctionResource vararg 
param
+   */
+  @Deprecated
   public FunctionInfo registerUDF(String functionName,
       Class<? extends UDF> UDFClass, boolean isOperator, String displayName,
       FunctionResource... resources) {
@@ -158,6 +168,17 @@ public class Registry {
     return registerUDF(functionName, functionType, UDFClass, isOperator, 
displayName);
   }
 
+  public FunctionInfo registerUDF(String functionName,
+                                  Class<? extends UDF> UDFClass, boolean 
isOperator) {
+    return registerUDF(functionName, UDFClass, isOperator, 
functionName.toLowerCase());
+  }
+
+  public FunctionInfo registerUDF(String functionName,
+                                  Class<? extends UDF> UDFClass, boolean 
isOperator, String displayName) {
+      FunctionType functionType = isNative ? FunctionType.BUILTIN : 
FunctionType.TEMPORARY;
+      return registerUDF(functionName, functionType, UDFClass, isOperator, 
displayName);
+  }
+
   private FunctionInfo registerUDF(String functionName, FunctionType 
functionType,
       Class<? extends UDF> UDFClass, boolean isOperator, String displayName,
       FunctionResource... resources) {

Reply via email to