[Chore](function) clean some unused function symbols (#19649)
clean some unused function symbols
This commit is contained in:
@ -104,68 +104,6 @@ public class ArithmeticExpr extends Expr {
|
||||
}
|
||||
|
||||
public static void initBuiltins(FunctionSet functionSet) {
|
||||
for (Type t : Type.getNumericTypes()) {
|
||||
NullableMode mode = t.isDecimalV3() ? NullableMode.CUSTOM : NullableMode.DEPEND_ON_ARGUMENT;
|
||||
functionSet.addBuiltin(ScalarFunction.createBuiltinOperator(
|
||||
Operator.MULTIPLY.getName(), Lists.newArrayList(t, t), t, mode));
|
||||
functionSet.addBuiltin(ScalarFunction.createBuiltinOperator(
|
||||
Operator.ADD.getName(), Lists.newArrayList(t, t), t, mode));
|
||||
functionSet.addBuiltin(ScalarFunction.createBuiltinOperator(
|
||||
Operator.SUBTRACT.getName(), Lists.newArrayList(t, t), t, mode));
|
||||
}
|
||||
functionSet.addBuiltin(ScalarFunction.createBuiltinOperator(
|
||||
Operator.DIVIDE.getName(),
|
||||
Lists.<Type>newArrayList(Type.DOUBLE, Type.DOUBLE),
|
||||
Type.DOUBLE, Function.NullableMode.ALWAYS_NULLABLE));
|
||||
functionSet.addBuiltin(ScalarFunction.createBuiltinOperator(
|
||||
Operator.DIVIDE.getName(),
|
||||
Lists.<Type>newArrayList(Type.MAX_DECIMALV2_TYPE, Type.MAX_DECIMALV2_TYPE),
|
||||
Type.MAX_DECIMALV2_TYPE, Function.NullableMode.ALWAYS_NULLABLE));
|
||||
functionSet.addBuiltin(ScalarFunction.createBuiltinOperator(
|
||||
Operator.DIVIDE.getName(),
|
||||
Lists.<Type>newArrayList(Type.DECIMAL32, Type.DECIMAL32),
|
||||
Type.DECIMAL32, Function.NullableMode.ALWAYS_NULLABLE));
|
||||
functionSet.addBuiltin(ScalarFunction.createBuiltinOperator(
|
||||
Operator.DIVIDE.getName(),
|
||||
Lists.<Type>newArrayList(Type.DECIMAL32, Type.DECIMAL64),
|
||||
Type.DECIMAL32, Function.NullableMode.ALWAYS_NULLABLE));
|
||||
functionSet.addBuiltin(ScalarFunction.createBuiltinOperator(
|
||||
Operator.DIVIDE.getName(),
|
||||
Lists.<Type>newArrayList(Type.DECIMAL32, Type.DECIMAL128),
|
||||
Type.DECIMAL32, Function.NullableMode.ALWAYS_NULLABLE));
|
||||
functionSet.addBuiltin(ScalarFunction.createBuiltinOperator(
|
||||
Operator.DIVIDE.getName(),
|
||||
Lists.<Type>newArrayList(Type.DECIMAL64, Type.DECIMAL64),
|
||||
Type.DECIMAL64, Function.NullableMode.ALWAYS_NULLABLE));
|
||||
functionSet.addBuiltin(ScalarFunction.createBuiltinOperator(
|
||||
Operator.DIVIDE.getName(),
|
||||
Lists.<Type>newArrayList(Type.DECIMAL64, Type.DECIMAL32),
|
||||
Type.DECIMAL64, Function.NullableMode.ALWAYS_NULLABLE));
|
||||
functionSet.addBuiltin(ScalarFunction.createBuiltinOperator(
|
||||
Operator.DIVIDE.getName(),
|
||||
Lists.<Type>newArrayList(Type.DECIMAL64, Type.DECIMAL128),
|
||||
Type.DECIMAL64, Function.NullableMode.ALWAYS_NULLABLE));
|
||||
functionSet.addBuiltin(ScalarFunction.createBuiltinOperator(
|
||||
Operator.DIVIDE.getName(),
|
||||
Lists.<Type>newArrayList(Type.DECIMAL128, Type.DECIMAL128),
|
||||
Type.DECIMAL128, Function.NullableMode.ALWAYS_NULLABLE));
|
||||
functionSet.addBuiltin(ScalarFunction.createBuiltinOperator(
|
||||
Operator.DIVIDE.getName(),
|
||||
Lists.<Type>newArrayList(Type.DECIMAL128, Type.DECIMAL32),
|
||||
Type.DECIMAL128, Function.NullableMode.ALWAYS_NULLABLE));
|
||||
functionSet.addBuiltin(ScalarFunction.createBuiltinOperator(
|
||||
Operator.DIVIDE.getName(),
|
||||
Lists.<Type>newArrayList(Type.DECIMAL128, Type.DECIMAL64),
|
||||
Type.DECIMAL128, Function.NullableMode.ALWAYS_NULLABLE));
|
||||
|
||||
// MOD(), FACTORIAL(), BITAND(), BITOR(), BITXOR(), and BITNOT() are registered as
|
||||
// builtins, see palo_functions.py
|
||||
for (Type t : Type.getIntegerTypes()) {
|
||||
functionSet.addBuiltin(ScalarFunction.createBuiltinOperator(
|
||||
Operator.INT_DIVIDE.getName(), Lists.newArrayList(t, t),
|
||||
t, Function.NullableMode.ALWAYS_NULLABLE));
|
||||
}
|
||||
|
||||
// init vec build function
|
||||
for (int i = 0; i < Type.getNumericTypes().size(); i++) {
|
||||
Type t1 = Type.getNumericTypes().get(i);
|
||||
@ -174,81 +112,81 @@ public class ArithmeticExpr extends Expr {
|
||||
|
||||
Type retType = Type.getNextNumType(Type.getAssignmentCompatibleType(t1, t2, false));
|
||||
NullableMode mode = retType.isDecimalV3() ? NullableMode.CUSTOM : NullableMode.DEPEND_ON_ARGUMENT;
|
||||
functionSet.addBuiltin(ScalarFunction.createVecBuiltinOperator(
|
||||
functionSet.addBuiltin(ScalarFunction.createBuiltinOperator(
|
||||
Operator.MULTIPLY.getName(), Lists.newArrayList(t1, t2), retType, mode));
|
||||
functionSet.addBuiltin(ScalarFunction.createVecBuiltinOperator(
|
||||
functionSet.addBuiltin(ScalarFunction.createBuiltinOperator(
|
||||
Operator.ADD.getName(), Lists.newArrayList(t1, t2), retType, mode));
|
||||
functionSet.addBuiltin(ScalarFunction.createVecBuiltinOperator(
|
||||
functionSet.addBuiltin(ScalarFunction.createBuiltinOperator(
|
||||
Operator.SUBTRACT.getName(), Lists.newArrayList(t1, t2), retType, mode));
|
||||
}
|
||||
}
|
||||
|
||||
functionSet.addBuiltin(ScalarFunction.createVecBuiltinOperator(
|
||||
functionSet.addBuiltin(ScalarFunction.createBuiltinOperator(
|
||||
Operator.DIVIDE.getName(),
|
||||
Lists.<Type>newArrayList(Type.DOUBLE, Type.DOUBLE),
|
||||
Type.DOUBLE, Function.NullableMode.ALWAYS_NULLABLE));
|
||||
functionSet.addBuiltin(ScalarFunction.createVecBuiltinOperator(
|
||||
functionSet.addBuiltin(ScalarFunction.createBuiltinOperator(
|
||||
Operator.DIVIDE.getName(),
|
||||
Lists.<Type>newArrayList(Type.MAX_DECIMALV2_TYPE, Type.MAX_DECIMALV2_TYPE),
|
||||
Type.MAX_DECIMALV2_TYPE, Function.NullableMode.ALWAYS_NULLABLE));
|
||||
functionSet.addBuiltin(ScalarFunction.createVecBuiltinOperator(
|
||||
functionSet.addBuiltin(ScalarFunction.createBuiltinOperator(
|
||||
Operator.DIVIDE.getName(),
|
||||
Lists.<Type>newArrayList(Type.DECIMAL32, Type.DECIMAL32),
|
||||
Type.DECIMAL32, Function.NullableMode.ALWAYS_NULLABLE));
|
||||
functionSet.addBuiltin(ScalarFunction.createVecBuiltinOperator(
|
||||
functionSet.addBuiltin(ScalarFunction.createBuiltinOperator(
|
||||
Operator.DIVIDE.getName(),
|
||||
Lists.<Type>newArrayList(Type.DECIMAL32, Type.DECIMAL64),
|
||||
Type.DECIMAL32, Function.NullableMode.ALWAYS_NULLABLE));
|
||||
functionSet.addBuiltin(ScalarFunction.createVecBuiltinOperator(
|
||||
functionSet.addBuiltin(ScalarFunction.createBuiltinOperator(
|
||||
Operator.DIVIDE.getName(),
|
||||
Lists.<Type>newArrayList(Type.DECIMAL32, Type.DECIMAL128),
|
||||
Type.DECIMAL32, Function.NullableMode.ALWAYS_NULLABLE));
|
||||
functionSet.addBuiltin(ScalarFunction.createVecBuiltinOperator(
|
||||
functionSet.addBuiltin(ScalarFunction.createBuiltinOperator(
|
||||
Operator.DIVIDE.getName(),
|
||||
Lists.<Type>newArrayList(Type.DECIMAL64, Type.DECIMAL64),
|
||||
Type.DECIMAL64, Function.NullableMode.ALWAYS_NULLABLE));
|
||||
functionSet.addBuiltin(ScalarFunction.createVecBuiltinOperator(
|
||||
functionSet.addBuiltin(ScalarFunction.createBuiltinOperator(
|
||||
Operator.DIVIDE.getName(),
|
||||
Lists.<Type>newArrayList(Type.DECIMAL64, Type.DECIMAL128),
|
||||
Type.DECIMAL64, Function.NullableMode.ALWAYS_NULLABLE));
|
||||
functionSet.addBuiltin(ScalarFunction.createVecBuiltinOperator(
|
||||
functionSet.addBuiltin(ScalarFunction.createBuiltinOperator(
|
||||
Operator.DIVIDE.getName(),
|
||||
Lists.<Type>newArrayList(Type.DECIMAL128, Type.DECIMAL128),
|
||||
Type.DECIMAL128, Function.NullableMode.ALWAYS_NULLABLE));
|
||||
functionSet.addBuiltin(ScalarFunction.createVecBuiltinOperator(
|
||||
functionSet.addBuiltin(ScalarFunction.createBuiltinOperator(
|
||||
Operator.DIVIDE.getName(),
|
||||
Lists.<Type>newArrayList(Type.DECIMAL64, Type.DECIMAL32),
|
||||
Type.DECIMAL32, Function.NullableMode.ALWAYS_NULLABLE));
|
||||
functionSet.addBuiltin(ScalarFunction.createVecBuiltinOperator(
|
||||
functionSet.addBuiltin(ScalarFunction.createBuiltinOperator(
|
||||
Operator.DIVIDE.getName(),
|
||||
Lists.<Type>newArrayList(Type.DECIMAL128, Type.DECIMAL64),
|
||||
Type.DECIMAL64, Function.NullableMode.ALWAYS_NULLABLE));
|
||||
functionSet.addBuiltin(ScalarFunction.createVecBuiltinOperator(
|
||||
functionSet.addBuiltin(ScalarFunction.createBuiltinOperator(
|
||||
Operator.DIVIDE.getName(),
|
||||
Lists.<Type>newArrayList(Type.DECIMAL128, Type.DECIMAL32),
|
||||
Type.DECIMAL128, Function.NullableMode.ALWAYS_NULLABLE));
|
||||
|
||||
functionSet.addBuiltin(ScalarFunction.createVecBuiltinOperator(
|
||||
functionSet.addBuiltin(ScalarFunction.createBuiltinOperator(
|
||||
Operator.MOD.getName(),
|
||||
Lists.<Type>newArrayList(Type.FLOAT, Type.FLOAT),
|
||||
Type.FLOAT, Function.NullableMode.ALWAYS_NULLABLE));
|
||||
functionSet.addBuiltin(ScalarFunction.createVecBuiltinOperator(
|
||||
functionSet.addBuiltin(ScalarFunction.createBuiltinOperator(
|
||||
Operator.MOD.getName(),
|
||||
Lists.<Type>newArrayList(Type.DOUBLE, Type.DOUBLE),
|
||||
Type.DOUBLE, Function.NullableMode.ALWAYS_NULLABLE));
|
||||
functionSet.addBuiltin(ScalarFunction.createVecBuiltinOperator(
|
||||
functionSet.addBuiltin(ScalarFunction.createBuiltinOperator(
|
||||
Operator.MOD.getName(),
|
||||
Lists.<Type>newArrayList(Type.MAX_DECIMALV2_TYPE, Type.MAX_DECIMALV2_TYPE),
|
||||
Type.MAX_DECIMALV2_TYPE, Function.NullableMode.ALWAYS_NULLABLE));
|
||||
functionSet.addBuiltin(ScalarFunction.createVecBuiltinOperator(
|
||||
functionSet.addBuiltin(ScalarFunction.createBuiltinOperator(
|
||||
Operator.MOD.getName(),
|
||||
Lists.<Type>newArrayList(Type.DECIMAL32, Type.DECIMAL32),
|
||||
Type.DECIMAL32, Function.NullableMode.ALWAYS_NULLABLE));
|
||||
functionSet.addBuiltin(ScalarFunction.createVecBuiltinOperator(
|
||||
functionSet.addBuiltin(ScalarFunction.createBuiltinOperator(
|
||||
Operator.MOD.getName(),
|
||||
Lists.<Type>newArrayList(Type.DECIMAL64, Type.DECIMAL64),
|
||||
Type.DECIMAL64, Function.NullableMode.ALWAYS_NULLABLE));
|
||||
functionSet.addBuiltin(ScalarFunction.createVecBuiltinOperator(
|
||||
functionSet.addBuiltin(ScalarFunction.createBuiltinOperator(
|
||||
Operator.MOD.getName(),
|
||||
Lists.<Type>newArrayList(Type.DECIMAL128, Type.DECIMAL128),
|
||||
Type.DECIMAL128, Function.NullableMode.ALWAYS_NULLABLE));
|
||||
@ -258,11 +196,11 @@ public class ArithmeticExpr extends Expr {
|
||||
for (int j = 0; j < Type.getIntegerTypes().size(); j++) {
|
||||
Type t2 = Type.getIntegerTypes().get(j);
|
||||
|
||||
functionSet.addBuiltin(ScalarFunction.createVecBuiltinOperator(
|
||||
functionSet.addBuiltin(ScalarFunction.createBuiltinOperator(
|
||||
Operator.INT_DIVIDE.getName(), Lists.newArrayList(t1, t2),
|
||||
Type.getAssignmentCompatibleType(t1, t2, false),
|
||||
Function.NullableMode.ALWAYS_NULLABLE));
|
||||
functionSet.addBuiltin(ScalarFunction.createVecBuiltinOperator(
|
||||
functionSet.addBuiltin(ScalarFunction.createBuiltinOperator(
|
||||
Operator.MOD.getName(), Lists.newArrayList(t1, t2),
|
||||
Type.getAssignmentCompatibleType(t1, t2, false),
|
||||
Function.NullableMode.ALWAYS_NULLABLE));
|
||||
|
||||
@ -181,51 +181,16 @@ public class CastExpr extends Expr {
|
||||
return targetTypeDef;
|
||||
}
|
||||
|
||||
private static boolean disableRegisterCastingFunction(Type fromType, Type toType) {
|
||||
// Disable casting from boolean to decimal or datetime or date
|
||||
if (fromType.isBoolean() && toType.isDateType()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Disable casting operation of hll/bitmap/quantile_state
|
||||
if (fromType.isObjectStored() || toType.isObjectStored()) {
|
||||
return true;
|
||||
}
|
||||
// Disable no-op casting
|
||||
return fromType.equals(toType) && !fromType.isDecimalV3() && !fromType.isDatetimeV2();
|
||||
}
|
||||
|
||||
public static void initBuiltins(FunctionSet functionSet) {
|
||||
for (Type fromType : Type.getSupportedTypes()) {
|
||||
for (Type fromType : Type.getTrivialTypes()) {
|
||||
if (fromType.isNull()) {
|
||||
continue;
|
||||
}
|
||||
for (Type toType : Type.getSupportedTypes()) {
|
||||
if (toType.isNull() || disableRegisterCastingFunction(fromType, toType)) {
|
||||
continue;
|
||||
}
|
||||
String beClass = toType.isDecimalV2() || fromType.isDecimalV2()
|
||||
? "DecimalV2Operators" : "CastFunctions";
|
||||
if (fromType.isTime()) {
|
||||
beClass = "TimeOperators";
|
||||
}
|
||||
String typeName = Function.getUdfTypeName(toType.getPrimitiveType());
|
||||
// only refactor date/datetime for vectorized engine.
|
||||
if (toType.getPrimitiveType() == PrimitiveType.DATE) {
|
||||
typeName = "date_val";
|
||||
}
|
||||
if (toType.getPrimitiveType() == PrimitiveType.DATEV2) {
|
||||
typeName = "datev2_val";
|
||||
}
|
||||
if (toType.getPrimitiveType() == PrimitiveType.DATETIMEV2) {
|
||||
typeName = "datetimev2_val";
|
||||
}
|
||||
String beSymbol = "doris::" + beClass + "::cast_to_"
|
||||
+ typeName;
|
||||
for (Type toType : Type.getTrivialTypes()) {
|
||||
functionSet.addBuiltinBothScalaAndVectorized(ScalarFunction.createBuiltin(getFnName(toType),
|
||||
toType, TYPE_NULLABLE_MODE.get(Pair.of(fromType, toType)),
|
||||
Lists.newArrayList(fromType), false,
|
||||
beSymbol, null, null, true));
|
||||
null, null, null, true));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,51 +0,0 @@
|
||||
// Licensed to the Apache Software Foundation (ASF) under one
|
||||
// or more contributor license agreements. See the NOTICE file
|
||||
// distributed with this work for additional information
|
||||
// regarding copyright ownership. The ASF licenses this file
|
||||
// to you under the Apache License, Version 2.0 (the
|
||||
// "License"); you may not use this file except in compliance
|
||||
// with the License. You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing,
|
||||
// software distributed under the License is distributed on an
|
||||
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
// KIND, either express or implied. See the License for the
|
||||
// specific language governing permissions and limitations
|
||||
// under the License.
|
||||
// This file is copied from
|
||||
// https://github.com/apache/impala/blob/branch-2.9.0/fe/src/main/java/org/apache/impala/FunctionArgs.java
|
||||
// and modified by Doris
|
||||
|
||||
package org.apache.doris.analysis;
|
||||
|
||||
import org.apache.doris.catalog.Type;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
import com.google.common.collect.Lists;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
// Wrapper class around argument types and if it has varArgs
|
||||
public class FunctionArgs {
|
||||
public final ArrayList<Type> argTypes;
|
||||
public boolean hasVarArgs;
|
||||
|
||||
public FunctionArgs() {
|
||||
argTypes = Lists.newArrayList();
|
||||
hasVarArgs = false;
|
||||
}
|
||||
|
||||
public FunctionArgs(ArrayList<Type> argTypes, boolean varArgs) {
|
||||
this.argTypes = argTypes;
|
||||
this.hasVarArgs = varArgs;
|
||||
if (varArgs) {
|
||||
Preconditions.checkState(argTypes.size() > 0);
|
||||
}
|
||||
}
|
||||
|
||||
public void setHasVarArgs(boolean b) {
|
||||
hasVarArgs = b;
|
||||
}
|
||||
}
|
||||
@ -54,8 +54,6 @@ public class InPredicate extends Predicate {
|
||||
private static final String IN_ITERATE = "in_iterate";
|
||||
private static final String NOT_IN_ITERATE = "not_in_iterate";
|
||||
private final boolean isNotIn;
|
||||
private static final String IN = "in";
|
||||
private static final String NOT_IN = "not_in";
|
||||
|
||||
private static final NullLiteral NULL_LITERAL = new NullLiteral();
|
||||
|
||||
@ -64,31 +62,29 @@ public class InPredicate extends Predicate {
|
||||
if (t.isNull()) {
|
||||
continue;
|
||||
}
|
||||
// TODO we do not support codegen for CHAR and the In predicate must be codegened
|
||||
// TODO we do not support codegen for CHAR and the In predicate must be
|
||||
// codegened
|
||||
// because it has variable number of arguments. This will force CHARs to be
|
||||
// cast up to strings; meaning that "in" comparisons will not have CHAR comparison
|
||||
// cast up to strings; meaning that "in" comparisons will not have CHAR
|
||||
// comparison
|
||||
// semantics.
|
||||
if (t.getPrimitiveType() == PrimitiveType.CHAR) {
|
||||
continue;
|
||||
}
|
||||
|
||||
String typeString = Function.getUdfTypeName(t.getPrimitiveType());
|
||||
|
||||
functionSet.addBuiltinBothScalaAndVectorized(ScalarFunction.createBuiltin(IN_ITERATE,
|
||||
Type.BOOLEAN, Lists.newArrayList(t, t), true,
|
||||
"doris::InPredicate::in_iterate", null, null, false));
|
||||
null, null, null, false));
|
||||
functionSet.addBuiltinBothScalaAndVectorized(ScalarFunction.createBuiltin(NOT_IN_ITERATE,
|
||||
Type.BOOLEAN, Lists.newArrayList(t, t), true,
|
||||
"doris::InPredicate::not_in_iterate", null, null, false));
|
||||
null, null, null, false));
|
||||
|
||||
String prepareFn = "doris::InPredicate::set_lookup_prepare_" + typeString;
|
||||
String closeFn = "doris::InPredicate::set_lookup_close_" + typeString;
|
||||
functionSet.addBuiltin(ScalarFunction.createBuiltin(IN_SET_LOOKUP,
|
||||
Type.BOOLEAN, Lists.newArrayList(t, t), true,
|
||||
"doris::InPredicate::in_set_lookup", prepareFn, closeFn, false));
|
||||
null, null, null, false));
|
||||
functionSet.addBuiltin(ScalarFunction.createBuiltin(NOT_IN_SET_LOOKUP,
|
||||
Type.BOOLEAN, Lists.newArrayList(t, t), true,
|
||||
"doris::InPredicate::not_in_set_lookup", prepareFn, closeFn, false));
|
||||
null, null, null, false));
|
||||
|
||||
}
|
||||
}
|
||||
@ -150,7 +146,7 @@ public class InPredicate extends Predicate {
|
||||
}
|
||||
|
||||
public List<Expr> getListChildren() {
|
||||
return children.subList(1, children.size());
|
||||
return children.subList(1, children.size());
|
||||
}
|
||||
|
||||
public boolean isNotIn() {
|
||||
@ -176,7 +172,8 @@ public class InPredicate extends Predicate {
|
||||
super.analyzeImpl(analyzer);
|
||||
|
||||
if (contains(Subquery.class)) {
|
||||
// An [NOT] IN predicate with a subquery must contain two children, the second of
|
||||
// An [NOT] IN predicate with a subquery must contain two children, the second
|
||||
// of
|
||||
// which is a Subquery.
|
||||
if (children.size() != 2 || !(getChild(1) instanceof Subquery)) {
|
||||
throw new AnalysisException("Unsupported IN predicate with a subquery: " + toSql());
|
||||
@ -219,12 +216,14 @@ public class InPredicate extends Predicate {
|
||||
}
|
||||
}
|
||||
boolean useSetLookup = allConstant;
|
||||
// Only lookup fn_ if all subqueries have been rewritten. If the second child is a
|
||||
// Only lookup fn_ if all subqueries have been rewritten. If the second child is
|
||||
// a
|
||||
// subquery, it will have type ArrayType, which cannot be resolved to a builtin
|
||||
// function and will fail analysis.
|
||||
Type[] argTypes = {getChild(0).type, getChild(1).type};
|
||||
Type[] argTypes = { getChild(0).type, getChild(1).type };
|
||||
if (useSetLookup) {
|
||||
// fn = getBuiltinFunction(analyzer, isNotIn ? NOT_IN_SET_LOOKUP : IN_SET_LOOKUP,
|
||||
// fn = getBuiltinFunction(analyzer, isNotIn ? NOT_IN_SET_LOOKUP :
|
||||
// IN_SET_LOOKUP,
|
||||
// argTypes, Function.CompareMode.IS_NONSTRICT_SUPERTYPE_OF);
|
||||
opcode = isNotIn ? TExprOpcode.FILTER_NOT_IN : TExprOpcode.FILTER_IN;
|
||||
} else {
|
||||
|
||||
@ -41,38 +41,26 @@ public class IsNullPredicate extends Predicate {
|
||||
if (t.isNull()) {
|
||||
continue;
|
||||
}
|
||||
String isNullSymbol;
|
||||
if (t == Type.BOOLEAN) {
|
||||
isNullSymbol = "_ZN5doris15IsNullPredicate7is_nullIN9doris_udf10BooleanValE"
|
||||
+ "EES3_PNS2_15FunctionContextERKT_";
|
||||
} else {
|
||||
String udfType = Function.getUdfType(t.getPrimitiveType());
|
||||
isNullSymbol = "_ZN5doris15IsNullPredicate7is_nullIN9doris_udf"
|
||||
+ udfType.length() + udfType
|
||||
+ "EEENS2_10BooleanValEPNS2_15FunctionContextERKT_";
|
||||
}
|
||||
|
||||
functionSet.addBuiltinBothScalaAndVectorized(ScalarFunction.createBuiltinOperator(IS_NULL, isNullSymbol,
|
||||
functionSet.addBuiltinBothScalaAndVectorized(ScalarFunction.createBuiltinOperator(IS_NULL, null,
|
||||
Lists.newArrayList(t), Type.BOOLEAN, NullableMode.ALWAYS_NOT_NULLABLE));
|
||||
|
||||
String isNotNullSymbol = isNullSymbol.replace("7is_null", "11is_not_null");
|
||||
functionSet.addBuiltinBothScalaAndVectorized(ScalarFunction.createBuiltinOperator(IS_NOT_NULL,
|
||||
isNotNullSymbol, Lists.newArrayList(t), Type.BOOLEAN, NullableMode.ALWAYS_NOT_NULLABLE));
|
||||
null, Lists.newArrayList(t), Type.BOOLEAN, NullableMode.ALWAYS_NOT_NULLABLE));
|
||||
|
||||
// for array type
|
||||
for (Type complexType : Lists.newArrayList(Type.ARRAY, Type.MAP, Type.GENERIC_STRUCT)) {
|
||||
functionSet.addBuiltinBothScalaAndVectorized(ScalarFunction.createBuiltinOperator(IS_NULL, isNullSymbol,
|
||||
functionSet.addBuiltinBothScalaAndVectorized(ScalarFunction.createBuiltinOperator(IS_NULL, null,
|
||||
Lists.newArrayList(complexType), Type.BOOLEAN, NullableMode.ALWAYS_NOT_NULLABLE));
|
||||
|
||||
functionSet.addBuiltinBothScalaAndVectorized(ScalarFunction.createBuiltinOperator(IS_NOT_NULL,
|
||||
isNotNullSymbol, Lists.newArrayList(complexType), Type.BOOLEAN,
|
||||
null, Lists.newArrayList(complexType), Type.BOOLEAN,
|
||||
NullableMode.ALWAYS_NOT_NULLABLE));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private final boolean isNotNull;
|
||||
|
||||
public IsNullPredicate(Expr e, boolean isNotNull) {
|
||||
|
||||
@ -215,16 +215,6 @@ public class AggregateFunction extends Function {
|
||||
this.returnsNonNullOnEmpty = returnsNonNullOnEmpty;
|
||||
}
|
||||
|
||||
public static AggregateFunction createBuiltin(String name,
|
||||
List<Type> argTypes, Type retType, Type intermediateType,
|
||||
String initFnSymbol, String updateFnSymbol, String mergeFnSymbol,
|
||||
String serializeFnSymbol, String finalizeFnSymbol, boolean ignoresDistinct,
|
||||
boolean isAnalyticFn, boolean returnsNonNullOnEmpty) {
|
||||
return createBuiltin(name, argTypes, retType, intermediateType,
|
||||
initFnSymbol, updateFnSymbol, mergeFnSymbol,
|
||||
serializeFnSymbol, finalizeFnSymbol, ignoresDistinct, isAnalyticFn, returnsNonNullOnEmpty, false);
|
||||
}
|
||||
|
||||
public static AggregateFunction createBuiltin(String name,
|
||||
List<Type> argTypes, Type retType, Type intermediateType,
|
||||
String initFnSymbol, String updateFnSymbol, String mergeFnSymbol,
|
||||
@ -235,18 +225,6 @@ public class AggregateFunction extends Function {
|
||||
ignoresDistinct, isAnalyticFn, returnsNonNullOnEmpty, vectorized);
|
||||
}
|
||||
|
||||
public static AggregateFunction createBuiltin(String name,
|
||||
List<Type> argTypes, Type retType, Type intermediateType,
|
||||
String initFnSymbol, String updateFnSymbol, String mergeFnSymbol,
|
||||
String serializeFnSymbol, String getValueFnSymbol, String removeFnSymbol,
|
||||
String finalizeFnSymbol, boolean ignoresDistinct, boolean isAnalyticFn,
|
||||
boolean returnsNonNullOnEmpty) {
|
||||
return createBuiltin(name, argTypes, retType, intermediateType,
|
||||
initFnSymbol, updateFnSymbol, mergeFnSymbol,
|
||||
serializeFnSymbol, getValueFnSymbol, removeFnSymbol,
|
||||
finalizeFnSymbol, ignoresDistinct, isAnalyticFn, returnsNonNullOnEmpty, false);
|
||||
}
|
||||
|
||||
public static AggregateFunction createBuiltin(String name,
|
||||
List<Type> argTypes, Type retType, Type intermediateType,
|
||||
String initFnSymbol, String updateFnSymbol, String mergeFnSymbol,
|
||||
@ -259,17 +237,6 @@ public class AggregateFunction extends Function {
|
||||
finalizeFnSymbol, ignoresDistinct, isAnalyticFn, returnsNonNullOnEmpty, vectorized);
|
||||
}
|
||||
|
||||
public static AggregateFunction createBuiltin(String name,
|
||||
List<Type> argTypes, Type retType, Type intermediateType, boolean hasVarArgs,
|
||||
String initFnSymbol, String updateFnSymbol, String mergeFnSymbol,
|
||||
String serializeFnSymbol, String getValueFnSymbol, String removeFnSymbol,
|
||||
String finalizeFnSymbol, boolean ignoresDistinct, boolean isAnalyticFn,
|
||||
boolean returnsNonNullOnEmpty) {
|
||||
return createBuiltin(name, argTypes, retType, intermediateType, hasVarArgs, initFnSymbol, updateFnSymbol,
|
||||
mergeFnSymbol, serializeFnSymbol, getValueFnSymbol, removeFnSymbol, finalizeFnSymbol, ignoresDistinct,
|
||||
isAnalyticFn, returnsNonNullOnEmpty, false);
|
||||
}
|
||||
|
||||
public static AggregateFunction createBuiltin(String name,
|
||||
List<Type> argTypes, Type retType, Type intermediateType, boolean hasVarArgs,
|
||||
String initFnSymbol, String updateFnSymbol, String mergeFnSymbol,
|
||||
@ -300,7 +267,7 @@ public class AggregateFunction extends Function {
|
||||
String getValueFnSymbol, String finalizeFnSymbol) {
|
||||
return createAnalyticBuiltin(name, argTypes, retType, intermediateType,
|
||||
initFnSymbol, updateFnSymbol, removeFnSymbol, getValueFnSymbol, finalizeFnSymbol,
|
||||
true, false);
|
||||
true, true);
|
||||
}
|
||||
|
||||
public static AggregateFunction createAnalyticBuiltin(String name,
|
||||
@ -328,6 +295,22 @@ public class AggregateFunction extends Function {
|
||||
return fn;
|
||||
}
|
||||
|
||||
public AggregateFunction(AggregateFunction other) {
|
||||
super(other);
|
||||
if (other == null) {
|
||||
return;
|
||||
}
|
||||
ignoresDistinct = other.ignoresDistinct;
|
||||
isAnalyticFn = other.isAnalyticFn;
|
||||
isAggregateFn = other.isAggregateFn;
|
||||
returnsNonNullOnEmpty = other.returnsNonNullOnEmpty;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Function clone() {
|
||||
return new AggregateFunction(this);
|
||||
}
|
||||
|
||||
// Used to create UDAF
|
||||
public AggregateFunction(FunctionName fnName, Type[] argTypes,
|
||||
Type retType, boolean hasVarArgs, Type intermediateType, URI location,
|
||||
|
||||
@ -122,7 +122,7 @@ public class Function implements Writable {
|
||||
|
||||
protected NullableMode nullableMode = NullableMode.DEPEND_ON_ARGUMENT;
|
||||
|
||||
protected boolean vectorized = false;
|
||||
protected boolean vectorized = true;
|
||||
|
||||
// library's checksum to make sure all backends use one library to serve user's request
|
||||
protected String checksum = "";
|
||||
@ -135,7 +135,7 @@ public class Function implements Writable {
|
||||
}
|
||||
|
||||
public Function(FunctionName name, List<Type> args, Type retType, boolean varArgs) {
|
||||
this(0, name, args, retType, varArgs, false, NullableMode.DEPEND_ON_ARGUMENT);
|
||||
this(0, name, args, retType, varArgs, true, NullableMode.DEPEND_ON_ARGUMENT);
|
||||
}
|
||||
|
||||
public Function(FunctionName name, List<Type> args, Type retType, boolean varArgs, boolean vectorized) {
|
||||
@ -189,6 +189,10 @@ public class Function implements Writable {
|
||||
this.checksum = other.checksum;
|
||||
}
|
||||
|
||||
public Function clone() {
|
||||
return new Function(this);
|
||||
}
|
||||
|
||||
public FunctionName getFunctionName() {
|
||||
return name;
|
||||
}
|
||||
@ -540,108 +544,6 @@ public class Function implements Writable {
|
||||
return "";
|
||||
}
|
||||
|
||||
public static String getUdfTypeName(PrimitiveType t) {
|
||||
switch (t) {
|
||||
case BOOLEAN:
|
||||
return "boolean_val";
|
||||
case TINYINT:
|
||||
return "tiny_int_val";
|
||||
case SMALLINT:
|
||||
return "small_int_val";
|
||||
case INT:
|
||||
return "int_val";
|
||||
case BIGINT:
|
||||
return "big_int_val";
|
||||
case LARGEINT:
|
||||
return "large_int_val";
|
||||
case FLOAT:
|
||||
return "float_val";
|
||||
case DOUBLE:
|
||||
case TIME:
|
||||
case TIMEV2:
|
||||
return "double_val";
|
||||
case VARCHAR:
|
||||
case CHAR:
|
||||
case HLL:
|
||||
case BITMAP:
|
||||
case QUANTILE_STATE:
|
||||
case STRING:
|
||||
return "string_val";
|
||||
case JSONB:
|
||||
return "jsonb_val";
|
||||
case DATE:
|
||||
case DATETIME:
|
||||
return "datetime_val";
|
||||
case DATEV2:
|
||||
return "datev2_val";
|
||||
case DATETIMEV2:
|
||||
return "datetimev2_val";
|
||||
case DECIMALV2:
|
||||
return "decimalv2_val";
|
||||
case DECIMAL32:
|
||||
return "decimal32_val";
|
||||
case DECIMAL64:
|
||||
return "decimal64_val";
|
||||
case DECIMAL128:
|
||||
return "decimal128_val";
|
||||
default:
|
||||
Preconditions.checkState(false, t.toString());
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
public static String getUdfType(PrimitiveType t) {
|
||||
switch (t) {
|
||||
case NULL_TYPE:
|
||||
return "AnyVal";
|
||||
case BOOLEAN:
|
||||
return "BooleanVal";
|
||||
case TINYINT:
|
||||
return "TinyIntVal";
|
||||
case SMALLINT:
|
||||
return "SmallIntVal";
|
||||
case INT:
|
||||
return "IntVal";
|
||||
case BIGINT:
|
||||
return "BigIntVal";
|
||||
case LARGEINT:
|
||||
return "LargeIntVal";
|
||||
case FLOAT:
|
||||
return "FloatVal";
|
||||
case DOUBLE:
|
||||
case TIME:
|
||||
case TIMEV2:
|
||||
return "DoubleVal";
|
||||
case VARCHAR:
|
||||
case CHAR:
|
||||
case HLL:
|
||||
case BITMAP:
|
||||
case QUANTILE_STATE:
|
||||
case STRING:
|
||||
return "StringVal";
|
||||
case JSONB:
|
||||
return "JsonbVal";
|
||||
case DATE:
|
||||
case DATETIME:
|
||||
return "DateTimeVal";
|
||||
case DATEV2:
|
||||
return "DateV2Val";
|
||||
case DATETIMEV2:
|
||||
return "DateTimeV2Val";
|
||||
case DECIMALV2:
|
||||
return "DecimalV2Val";
|
||||
case DECIMAL32:
|
||||
return "Decimal32Val";
|
||||
case DECIMAL64:
|
||||
return "Decimal64Val";
|
||||
case DECIMAL128:
|
||||
return "Decimal128Val";
|
||||
default:
|
||||
Preconditions.checkState(false, t.toString());
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
public static Function getFunction(List<Function> fns, Function desc, CompareMode mode) {
|
||||
if (fns == null) {
|
||||
return null;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -22,13 +22,10 @@ import org.apache.doris.analysis.FunctionName;
|
||||
import org.apache.doris.common.io.IOUtils;
|
||||
import org.apache.doris.common.io.Text;
|
||||
import org.apache.doris.common.util.URI;
|
||||
import org.apache.doris.common.util.VectorizedUtil;
|
||||
import org.apache.doris.thrift.TFunction;
|
||||
import org.apache.doris.thrift.TFunctionBinaryType;
|
||||
import org.apache.doris.thrift.TScalarFunction;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.common.collect.Maps;
|
||||
import com.google.gson.Gson;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
@ -61,7 +58,7 @@ public class ScalarFunction extends Function {
|
||||
|
||||
public ScalarFunction(FunctionName fnName, List<Type> argTypes, Type retType, boolean hasVarArgs,
|
||||
boolean userVisible) {
|
||||
this(fnName, argTypes, retType, hasVarArgs, TFunctionBinaryType.BUILTIN, userVisible, false);
|
||||
this(fnName, argTypes, retType, hasVarArgs, TFunctionBinaryType.BUILTIN, userVisible, true);
|
||||
}
|
||||
|
||||
public ScalarFunction(FunctionName fnName, List<Type> argTypes, Type retType, boolean hasVarArgs,
|
||||
@ -110,7 +107,6 @@ public class ScalarFunction extends Function {
|
||||
String name, Type retType, NullableMode nullableMode,
|
||||
ArrayList<Type> argTypes, boolean hasVarArgs,
|
||||
String symbol, String prepareFnSymbol, String closeFnSymbol, boolean userVisible) {
|
||||
Preconditions.checkNotNull(symbol);
|
||||
ScalarFunction fn = new ScalarFunction(
|
||||
new FunctionName(name), argTypes, retType, hasVarArgs, userVisible);
|
||||
fn.symbolName = symbol;
|
||||
@ -126,164 +122,16 @@ public class ScalarFunction extends Function {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a builtin scalar operator function. This is a helper that wraps a few steps
|
||||
* Creates a builtin scalar operator function. This is a helper that wraps a few
|
||||
* steps
|
||||
* into one call.
|
||||
* TODO: this needs to be kept in sync with what generates the be operator
|
||||
* implementations. (gen_functions.py). Is there a better way to coordinate this.
|
||||
* implementations. (gen_functions.py). Is there a better way to coordinate
|
||||
* this.
|
||||
*/
|
||||
public static ScalarFunction createBuiltinOperator(
|
||||
String name, ArrayList<Type> argTypes, Type retType, NullableMode nullableMode) {
|
||||
// Operators have a well defined symbol based on the function name and type.
|
||||
// Convert Add(TINYINT, TINYINT) --> Add_TinyIntVal_TinyIntVal
|
||||
String beFn = name;
|
||||
boolean usesDecimal = false;
|
||||
boolean usesDecimalV2 = false;
|
||||
for (int i = 0; i < argTypes.size(); ++i) {
|
||||
switch (argTypes.get(i).getPrimitiveType()) {
|
||||
case BOOLEAN:
|
||||
beFn += "_boolean_val";
|
||||
break;
|
||||
case TINYINT:
|
||||
beFn += "_tiny_int_val";
|
||||
break;
|
||||
case SMALLINT:
|
||||
beFn += "_small_int_val";
|
||||
break;
|
||||
case INT:
|
||||
beFn += "_int_val";
|
||||
break;
|
||||
case BIGINT:
|
||||
beFn += "_big_int_val";
|
||||
break;
|
||||
case LARGEINT:
|
||||
beFn += "_large_int_val";
|
||||
break;
|
||||
case FLOAT:
|
||||
beFn += "_float_val";
|
||||
break;
|
||||
case DOUBLE:
|
||||
case TIME:
|
||||
case TIMEV2:
|
||||
beFn += "_double_val";
|
||||
break;
|
||||
case CHAR:
|
||||
case VARCHAR:
|
||||
case HLL:
|
||||
case BITMAP:
|
||||
case STRING:
|
||||
case QUANTILE_STATE:
|
||||
beFn += "_string_val";
|
||||
break;
|
||||
case DATE:
|
||||
case DATETIME:
|
||||
case DATEV2:
|
||||
case DATETIMEV2:
|
||||
beFn += "_datetime_val";
|
||||
break;
|
||||
case DECIMALV2:
|
||||
case DECIMAL32:
|
||||
case DECIMAL64:
|
||||
case DECIMAL128:
|
||||
beFn += "_decimalv2_val";
|
||||
usesDecimalV2 = true;
|
||||
break;
|
||||
case JSONB:
|
||||
beFn += "_jsonb_val";
|
||||
break;
|
||||
default:
|
||||
Preconditions.checkState(false, "Argument type not supported: " + argTypes.get(i));
|
||||
}
|
||||
}
|
||||
String beClass = usesDecimal ? "DecimalOperators" : "Operators";
|
||||
if (usesDecimalV2) {
|
||||
beClass = "DecimalV2Operators";
|
||||
}
|
||||
String symbol = "doris::" + beClass + "::" + beFn;
|
||||
return createBuiltinOperator(name, symbol, argTypes, retType, nullableMode);
|
||||
}
|
||||
|
||||
public static ScalarFunction createVecBuiltinOperator(
|
||||
String name, ArrayList<Type> argTypes, Type retType) {
|
||||
return createVecBuiltinOperator(name, argTypes, retType, NullableMode.DEPEND_ON_ARGUMENT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a builtin scala vec operator function. This is a helper that wraps a few steps
|
||||
* into one call.
|
||||
* TODO: this needs to be kept in sync with what generates the be operator
|
||||
* implementations. (gen_functions.py). Is there a better way to coordinate this.
|
||||
*/
|
||||
public static ScalarFunction createVecBuiltinOperator(
|
||||
String name, ArrayList<Type> argTypes, Type retType, NullableMode nullableMode) {
|
||||
StringBuilder beFn = new StringBuilder(name);
|
||||
boolean usesDecimal = false;
|
||||
boolean usesDecimalV2 = false;
|
||||
|
||||
// just mock a fake symbol for vec function, we treat
|
||||
// all argument is same as first argument
|
||||
for (int i = 0; i < argTypes.size(); ++i) {
|
||||
switch (argTypes.get(0).getPrimitiveType()) {
|
||||
case BOOLEAN:
|
||||
beFn.append("_boolean_val");
|
||||
break;
|
||||
case TINYINT:
|
||||
beFn.append("_tiny_int_val");
|
||||
break;
|
||||
case SMALLINT:
|
||||
beFn.append("_small_int_val");
|
||||
break;
|
||||
case INT:
|
||||
beFn.append("_int_val");
|
||||
break;
|
||||
case BIGINT:
|
||||
beFn.append("_big_int_val");
|
||||
break;
|
||||
case LARGEINT:
|
||||
beFn.append("_large_int_val");
|
||||
break;
|
||||
case FLOAT:
|
||||
beFn.append("_float_val");
|
||||
break;
|
||||
case DOUBLE:
|
||||
case TIME:
|
||||
case TIMEV2:
|
||||
beFn.append("_double_val");
|
||||
break;
|
||||
case CHAR:
|
||||
case VARCHAR:
|
||||
case HLL:
|
||||
case BITMAP:
|
||||
beFn.append("_string_val");
|
||||
break;
|
||||
case JSONB:
|
||||
beFn.append("_jsonb_val");
|
||||
break;
|
||||
case LAMBDA_FUNCTION:
|
||||
beFn.append("_lambda_function");
|
||||
break;
|
||||
case DATE:
|
||||
case DATETIME:
|
||||
case DATEV2:
|
||||
case DATETIMEV2:
|
||||
beFn.append("_datetime_val");
|
||||
break;
|
||||
case DECIMALV2:
|
||||
case DECIMAL32:
|
||||
case DECIMAL64:
|
||||
case DECIMAL128:
|
||||
beFn.append("_decimalv2_val");
|
||||
usesDecimalV2 = true;
|
||||
break;
|
||||
default:
|
||||
Preconditions.checkState(false, "Argument type not supported: " + argTypes.get(i));
|
||||
}
|
||||
}
|
||||
String beClass = usesDecimal ? "DecimalOperators" : "Operators";
|
||||
if (usesDecimalV2) {
|
||||
beClass = "DecimalV2Operators";
|
||||
}
|
||||
String symbol = "doris::" + beClass + "::" + beFn;
|
||||
return createVecBuiltinOperator(name, symbol, argTypes, retType, nullableMode);
|
||||
return createBuiltinOperator(name, null, argTypes, retType, nullableMode);
|
||||
}
|
||||
|
||||
public static ScalarFunction createBuiltinOperator(
|
||||
@ -306,41 +154,6 @@ public class ScalarFunction extends Function {
|
||||
return fn;
|
||||
}
|
||||
|
||||
public static ScalarFunction createVecBuiltinOperator(
|
||||
String name, String symbol, ArrayList<Type> argTypes, Type retType, NullableMode nullableMode) {
|
||||
return createVecBuiltin(name, null, symbol, null, argTypes, false, retType, false, nullableMode);
|
||||
}
|
||||
|
||||
// TODO: This method should not be here, move to other place in the future
|
||||
public static ScalarFunction createVecBuiltin(String name, String prepareFnSymbolBName, String symbol,
|
||||
String closeFnSymbolName, ArrayList<Type> argTypes, boolean hasVarArgs, Type retType, boolean userVisible,
|
||||
NullableMode nullableMode) {
|
||||
ScalarFunction fn = new ScalarFunction(new FunctionName(name), argTypes, retType, hasVarArgs, userVisible,
|
||||
true);
|
||||
if (prepareFnSymbolBName != null) {
|
||||
fn.prepareFnSymbol = prepareFnSymbolBName;
|
||||
}
|
||||
fn.symbolName = symbol;
|
||||
if (closeFnSymbolName != null) {
|
||||
fn.closeFnSymbol = closeFnSymbolName;
|
||||
}
|
||||
fn.nullableMode = nullableMode;
|
||||
return fn;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a function that is used to search the catalog for a matching builtin. Only
|
||||
* the fields necessary for matching function prototypes are specified.
|
||||
*/
|
||||
public static ScalarFunction createBuiltinSearchDesc(
|
||||
String name, Type[] argTypes, boolean hasVarArgs) {
|
||||
ArrayList<Type> fnArgs =
|
||||
(argTypes == null) ? new ArrayList<Type>() : Lists.newArrayList(argTypes);
|
||||
ScalarFunction fn = new ScalarFunction(
|
||||
new FunctionName(name), fnArgs, Type.INVALID, hasVarArgs, true);
|
||||
return fn;
|
||||
}
|
||||
|
||||
public static ScalarFunction createUdf(
|
||||
TFunctionBinaryType binaryType,
|
||||
FunctionName name, Type[] args,
|
||||
@ -419,14 +232,8 @@ public class ScalarFunction extends Function {
|
||||
public TFunction toThrift(Type realReturnType, Type[] realArgTypes) {
|
||||
TFunction fn = super.toThrift(realReturnType, realArgTypes);
|
||||
fn.setScalarFn(new TScalarFunction());
|
||||
if (getBinaryType() != TFunctionBinaryType.BUILTIN || !VectorizedUtil.isPipeline()) {
|
||||
if (getBinaryType() != TFunctionBinaryType.BUILTIN) {
|
||||
fn.getScalarFn().setSymbol(symbolName);
|
||||
if (prepareFnSymbol != null) {
|
||||
fn.getScalarFn().setPrepareFnSymbol(prepareFnSymbol);
|
||||
}
|
||||
if (closeFnSymbol != null) {
|
||||
fn.getScalarFn().setCloseFnSymbol(closeFnSymbol);
|
||||
}
|
||||
} else {
|
||||
fn.getScalarFn().setSymbol("");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user