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

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


The following commit(s) were added to refs/heads/master by this push:
     new 32844b2a5b [fix](java-udf) Fix need to restart BE after replacing the 
jar package in java-udf (#24372)
32844b2a5b is described below

commit 32844b2a5b6596173ccb564363ee4ffe961eb60c
Author: DongLiang-0 <46414265+donglian...@users.noreply.github.com>
AuthorDate: Fri Sep 15 13:30:08 2023 +0800

    [fix](java-udf) Fix need to restart BE after replacing the jar package in 
java-udf (#24372)
    
    Fix need to restart BE after replacing the jar package in java-udf
---
 .../nereids/trees/expressions/functions/udf/JavaUdaf.java      | 10 +++++++---
 .../doris/nereids/trees/expressions/functions/udf/JavaUdf.java | 10 +++++++---
 2 files changed, 14 insertions(+), 6 deletions(-)

diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/udf/JavaUdaf.java
 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/udf/JavaUdaf.java
index 58c497a352..4fbce8b94a 100644
--- 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/udf/JavaUdaf.java
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/udf/JavaUdaf.java
@@ -47,6 +47,7 @@ import java.util.stream.Collectors;
  */
 public class JavaUdaf extends AggregateFunction implements 
ExplicitlyCastableSignature, Udf {
     private final String dbName;
+    private final long functionId;
     private final TFunctionBinaryType binaryType;
     private final FunctionSignature signature;
     private final DataType intermediateType;
@@ -65,7 +66,8 @@ public class JavaUdaf extends AggregateFunction implements 
ExplicitlyCastableSig
     /**
      * Constructor of UDAF
      */
-    public JavaUdaf(String name, String dbName, TFunctionBinaryType 
binaryType, FunctionSignature signature,
+    public JavaUdaf(String name, long functionId, String dbName, 
TFunctionBinaryType binaryType,
+            FunctionSignature signature,
             DataType intermediateType, NullableMode nullableMode,
             String objectFile, String symbol,
             String initFn, String updateFn, String mergeFn,
@@ -73,6 +75,7 @@ public class JavaUdaf extends AggregateFunction implements 
ExplicitlyCastableSig
             boolean isDistinct, String checkSum, Expression... args) {
         super(name, isDistinct, args);
         this.dbName = dbName;
+        this.functionId = functionId;
         this.binaryType = binaryType;
         this.signature = signature;
         this.intermediateType = intermediateType == null ? 
signature.returnType : intermediateType;
@@ -115,7 +118,7 @@ public class JavaUdaf extends AggregateFunction implements 
ExplicitlyCastableSig
     @Override
     public JavaUdaf withDistinctAndChildren(boolean isDistinct, 
List<Expression> children) {
         Preconditions.checkArgument(children.size() == this.children.size());
-        return new JavaUdaf(getName(), dbName, binaryType, signature, 
intermediateType, nullableMode,
+        return new JavaUdaf(getName(), functionId, dbName, binaryType, 
signature, intermediateType, nullableMode,
                 objectFile, symbol, initFn, updateFn, mergeFn, serializeFn, 
finalizeFn, getValueFn, removeFn,
                 isDistinct, checkSum, children.toArray(new Expression[0]));
     }
@@ -145,7 +148,7 @@ public class JavaUdaf extends AggregateFunction implements 
ExplicitlyCastableSig
             intermediateType = 
DataType.fromCatalogType(aggregate.getIntermediateType());
         }
 
-        JavaUdaf udaf = new JavaUdaf(fnName, dbName, 
aggregate.getBinaryType(), sig,
+        JavaUdaf udaf = new JavaUdaf(fnName, aggregate.getId(), dbName, 
aggregate.getBinaryType(), sig,
                 intermediateType,
                 aggregate.getNullableMode(),
                 aggregate.getLocation().getLocation(),
@@ -192,6 +195,7 @@ public class JavaUdaf extends AggregateFunction implements 
ExplicitlyCastableSig
             expr.setBinaryType(binaryType);
             expr.setNullableMode(nullableMode);
             expr.setChecksum(checkSum);
+            expr.setId(functionId);
             return expr;
         } catch (Exception e) {
             throw new AnalysisException(e.getMessage(), e.getCause());
diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/udf/JavaUdf.java
 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/udf/JavaUdf.java
index 84c21e0f76..90d27481cf 100644
--- 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/udf/JavaUdf.java
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/udf/JavaUdf.java
@@ -47,6 +47,7 @@ import java.util.stream.Collectors;
  */
 public class JavaUdf extends ScalarFunction implements 
ExplicitlyCastableSignature, Udf {
     private final String dbName;
+    private final long functionId;
     private final TFunctionBinaryType binaryType;
     private final FunctionSignature signature;
     private final NullableMode nullableMode;
@@ -59,11 +60,13 @@ public class JavaUdf extends ScalarFunction implements 
ExplicitlyCastableSignatu
     /**
      * Constructor of UDF
      */
-    public JavaUdf(String name, String dbName, TFunctionBinaryType binaryType, 
FunctionSignature signature,
+    public JavaUdf(String name, long functionId, String dbName, 
TFunctionBinaryType binaryType,
+            FunctionSignature signature,
             NullableMode nullableMode, String objectFile, String symbol, 
String prepareFn, String closeFn,
             String checkSum, Expression... args) {
         super(name, args);
         this.dbName = dbName;
+        this.functionId = functionId;
         this.binaryType = binaryType;
         this.signature = signature;
         this.nullableMode = nullableMode;
@@ -100,7 +103,7 @@ public class JavaUdf extends ScalarFunction implements 
ExplicitlyCastableSignatu
     @Override
     public JavaUdf withChildren(List<Expression> children) {
         Preconditions.checkArgument(children.size() == this.children.size());
-        return new JavaUdf(getName(), dbName, binaryType, signature, 
nullableMode,
+        return new JavaUdf(getName(), functionId, dbName, binaryType, 
signature, nullableMode,
                 objectFile, symbol, prepareFn, closeFn, checkSum, 
children.toArray(new Expression[0]));
     }
 
@@ -124,7 +127,7 @@ public class JavaUdf extends ScalarFunction implements 
ExplicitlyCastableSignatu
                         (shape) -> ImmutableList.of()))
                 .toArray(VirtualSlotReference[]::new);
 
-        JavaUdf udf = new JavaUdf(fnName, dbName, scalar.getBinaryType(), sig,
+        JavaUdf udf = new JavaUdf(fnName, scalar.getId(), dbName, 
scalar.getBinaryType(), sig,
                 scalar.getNullableMode(),
                 scalar.getLocation().getLocation(),
                 scalar.getSymbolName(),
@@ -158,6 +161,7 @@ public class JavaUdf extends ScalarFunction implements 
ExplicitlyCastableSignatu
             );
             expr.setNullableMode(nullableMode);
             expr.setChecksum(checkSum);
+            expr.setId(functionId);
             return expr;
         } catch (Exception e) {
             throw new AnalysisException(e.getMessage(), e.getCause());


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to