Package org.apache.flink.table.functions
Class BuiltInFunctionDefinition.Builder
- java.lang.Object
-
- org.apache.flink.table.functions.BuiltInFunctionDefinition.Builder
-
- Enclosing class:
- BuiltInFunctionDefinition
@Internal public static final class BuiltInFunctionDefinition.Builder extends Object
Builder for fluent definition of built-in functions.
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
-
-
-
Method Detail
-
name
public BuiltInFunctionDefinition.Builder name(String name)
Specifies a name that uniquely identifies a built-in function.Please adhere to the following naming convention:
- Use upper case and separate words with underscore.
- Depending on the importance of the function, the underscore is sometimes omitted
e.g. for
IFNULL
orTYPEOF
but not forTO_TIMESTAMP_LTZ
. - Internal functions must start with $ and include a version starting from 1. The
following format is enforced:
$NAME$VERSION
such as$REPLICATE_ROWS$1
.
-
version
public BuiltInFunctionDefinition.Builder version(int version)
Specifies a version that will be persisted in the plan together with the function's name. The default version is 1 for non-internal functions.Note: Internal functions don't need to specify a version as we enforce a unique name that includes a version (see
name(String)
).
-
kind
public BuiltInFunctionDefinition.Builder kind(FunctionKind kind)
-
namedArguments
public BuiltInFunctionDefinition.Builder namedArguments(String... argumentNames)
-
typedArguments
public BuiltInFunctionDefinition.Builder typedArguments(DataType... argumentTypes)
-
inputTypeStrategy
public BuiltInFunctionDefinition.Builder inputTypeStrategy(InputTypeStrategy inputTypeStrategy)
-
outputTypeStrategy
public BuiltInFunctionDefinition.Builder outputTypeStrategy(TypeStrategy outputTypeStrategy)
-
notDeterministic
public BuiltInFunctionDefinition.Builder notDeterministic()
-
runtimeProvided
public BuiltInFunctionDefinition.Builder runtimeProvided()
Specifies that thisBuiltInFunctionDefinition
is implemented during code generation.
-
runtimeClass
public BuiltInFunctionDefinition.Builder runtimeClass(String runtimeClass)
Specifies the runtime class implementing thisBuiltInFunctionDefinition
.
-
runtimeDeferred
public BuiltInFunctionDefinition.Builder runtimeDeferred()
Specifies that thisBuiltInFunctionDefinition
will be mapped to a Calcite function.
-
internal
public BuiltInFunctionDefinition.Builder internal()
Specifies that thisBuiltInFunctionDefinition
is meant for internal purposes only and should not be exposed when listing functions.
-
callSyntax
public BuiltInFunctionDefinition.Builder callSyntax(SqlCallSyntax syntax)
Overwrites the syntax used for unparsing a function into a SQL string. If not specified,SqlCallSyntax.FUNCTION
is used.
-
callSyntax
public BuiltInFunctionDefinition.Builder callSyntax(String name, SqlCallSyntax syntax)
Overwrites the syntax used for unparsing a function into a SQL string. If not specified,SqlCallSyntax.FUNCTION
is used. This method overwrites the name as well. If the name is not providedname(String)
is passed to theSqlCallSyntax
.
-
sqlName
public BuiltInFunctionDefinition.Builder sqlName(String name)
Overwrites the name that is used for unparsing a function into a SQL string. If not specified,name(String)
is used.
-
build
public BuiltInFunctionDefinition build()
-
-