Class BuiltInFunctionDefinition
- All Implemented Interfaces:
FunctionDefinition,SpecializedFunction
Compared to regular FunctionDefinition, built-in functions have a default name. This
default name is used to look up the function in a catalog during resolution. However, note that
every built-in function is actually fully qualified by a name and a version. Internal functions
are required to have a name that includes the version (e.g. $REPLICATE_ROWS$1). The most
recent version of a regular function is picked during a lookup if a call does not reference an
internal function.
Equality is defined by reference equality.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilder for fluent definition of built-in functions.Nested classes/interfaces inherited from interface org.apache.flink.table.functions.SpecializedFunction
SpecializedFunction.ExpressionEvaluator, SpecializedFunction.ExpressionEvaluatorFactory, SpecializedFunction.SpecializedContext -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptiongetKind()Returns the kind of function this definition describes.getName()getTypeInference(DataTypeFactory typeFactory) Returns the logic for performing type inference of a call to this function definition.booleanbooleanReturns information about the determinism of the function's results.booleanBuilder for configuring and creating instances ofBuiltInFunctionDefinition.static StringqualifyFunctionName(String name, int version) Provides a runtime implementation that is specialized for the given call and session.toString()static voidvalidateFunction(String name, Integer version, boolean isInternal) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.flink.table.functions.FunctionDefinition
getRequirements, supportsConstantFolding
-
Field Details
-
DEFAULT_VERSION
public static final int DEFAULT_VERSION- See Also:
-
-
Method Details
-
newBuilder
Builder for configuring and creating instances ofBuiltInFunctionDefinition. -
getName
-
getSqlName
-
getVersion
-
getRuntimeClass
-
hasRuntimeImplementation
public boolean hasRuntimeImplementation() -
isInternal
public boolean isInternal() -
getQualifiedName
-
specialize
Description copied from interface:SpecializedFunctionProvides a runtime implementation that is specialized for the given call and session.The method must return an instance of
UserDefinedFunctionor throw aTableExceptionif the given call is not supported. The returned instance must have the sameFunctionDefinitionsemantics but can have a differentFunctionDefinition.getTypeInference(DataTypeFactory)implementation.- Specified by:
specializein interfaceSpecializedFunction
-
getKind
Description copied from interface:FunctionDefinitionReturns the kind of function this definition describes.- Specified by:
getKindin interfaceFunctionDefinition
-
getTypeInference
Description copied from interface:FunctionDefinitionReturns the logic for performing type inference of a call to this function definition.The type inference process is responsible for inferring unknown types of input arguments, validating input arguments, and producing result types. The type inference process happens independent of a function body. The output of the type inference is used to search for a corresponding runtime implementation.
Instances of type inference can be created by using
TypeInference.newBuilder().See
BuiltInFunctionDefinitionsfor concrete usage examples.- Specified by:
getTypeInferencein interfaceFunctionDefinition
-
getCallSyntax
-
isDeterministic
public boolean isDeterministic()Description copied from interface:FunctionDefinitionReturns information about the determinism of the function's results.It returns
trueif and only if a call to this function is guaranteed to always return the same result given the same parameters.trueis assumed by default. If the function is not purely functional likerandom(), date(), now(), ...this method must returnfalse.Furthermore, return
falseif the planner should always execute this function on the cluster side. In other words: the planner should not perform constant expression reduction during planning for constant calls to this function.- Specified by:
isDeterministicin interfaceFunctionDefinition
-
toString
-
validateFunction
-
qualifyFunctionName
-