Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
DongLiang-0 committed Sep 14, 2023
1 parent 131b694 commit 6d62c2c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
*/
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;
Expand All @@ -65,14 +66,16 @@ 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,
String serializeFn, String finalizeFn, String getValueFn, String removeFn,
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;
Expand Down Expand Up @@ -115,7 +118,7 @@ public NullableMode getNullableMode() {
@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]));
}
Expand Down Expand Up @@ -145,7 +148,7 @@ public static void translateToNereidsFunction(String dbName, org.apache.doris.ca
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(),
Expand Down Expand Up @@ -192,6 +195,7 @@ public Function getCatalogFunction() {
expr.setBinaryType(binaryType);
expr.setNullableMode(nullableMode);
expr.setChecksum(checkSum);
expr.setId(functionId);
return expr;
} catch (Exception e) {
throw new AnalysisException(e.getMessage(), e.getCause());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ public class JavaUdf extends ScalarFunction implements ExplicitlyCastableSignatu
/**
* Constructor of UDF
*/
public JavaUdf(String name, long functionId,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);
Expand Down

0 comments on commit 6d62c2c

Please sign in to comment.