Annotation Type ProcedureHint
-
@PublicEvolving @Retention(RUNTIME) @Target({TYPE,METHOD}) @Repeatable(ProcedureHints.class) public @interface ProcedureHint
A hint that influences the reflection-based extraction of input types and output types for constructing theTypeInference
logic of aProcedure
.One or more annotations can be declared on top of a
Procedure
class or individually for eachcall()
method for overloading function signatures. All hint parameters are optional. If a parameter is not defined, the default reflection-based extraction is used. Hint parameters defined on top of aProcedure
class are inherited by allcall()
methods. TheDataTypeHint
for the output data type of aProcedure
should always hint the component type of the array returned byProcedure
.The following examples show how to explicitly specify procedure signatures as a whole or in part and let the default extraction do the rest:
{@code // accepts (INT, STRING) and returns BOOLEAN
- See Also:
DataTypeHint
-
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description ArgumentHint[]
argument
Explicitly lists the argument that a procedure takes as input, including their names, types, and whether they are optional.String[]
argumentNames
Explicitly lists the argument names that a procedure takes as input.DataTypeHint[]
input
Explicitly lists the argument types that a procedure takes as input.boolean
isVarArgs
Defines that the last argument type defined ininput()
should be treated as a variable-length argument.DataTypeHint
output
Explicitly defines the result type that a procedure uses as output.
-
-
-
Element Detail
-
input
DataTypeHint[] input
Explicitly lists the argument types that a procedure takes as input.By default, explicit input types are undefined and the reflection-based extraction is used.
Note: Specifying the input arguments manually disables the entire reflection-based extraction around arguments. This means that also
isVarArgs()
andargumentNames()
need to be specified manually if required.- Default:
- {@org.apache.flink.table.annotation.DataTypeHint}
-
-
-
isVarArgs
boolean isVarArgs
Defines that the last argument type defined ininput()
should be treated as a variable-length argument.By default, if
input()
is defined, the last argument type is not a var-arg. Ifinput()
is not defined, the reflection-based extraction is used to decide about the var-arg flag, thus, this parameter is ignored.- Default:
- false
-
-
-
argumentNames
String[] argumentNames
Explicitly lists the argument names that a procedure takes as input.By default, if
input()
is defined, explicit argument names are undefined and this parameter can be used to provide argument names. Ifinput()
is not defined, the reflection-based extraction is used, thus, this parameter is ignored.- Default:
- {""}
-
-
-
argument
ArgumentHint[] argument
Explicitly lists the argument that a procedure takes as input, including their names, types, and whether they are optional.By default, it is recommended to use this parameter instead of
input()
. If the type of argumentHint is not defined, it will be considered an invalid argument and an exception will be thrown. Additionally, both this parameter andinput()
cannot be defined at the same time. If neither argument norinput()
are defined, reflection-based extraction will be used.- Default:
- {}
-
-
-
output
DataTypeHint output
Explicitly defines the result type that a procedure uses as output.By default, an explicit output type is undefined and the reflection-based extraction is used.
- Default:
- @org.apache.flink.table.annotation.DataTypeHint
-
-