Interface FunctionDefinition
-
- All Known Subinterfaces:
SpecializedFunction
- All Known Implementing Classes:
AddOne
,AggregateFunction
,AggregateFunctionDefinition
,ArrayAggFunction
,ArrayAppendFunction
,ArrayConcatFunction
,ArrayContainsFunction
,ArrayDistinctFunction
,ArrayExceptFunction
,ArrayIntersectFunction
,ArrayJoinFunction
,ArrayMaxFunction
,ArrayMinFunction
,ArrayPositionFunction
,ArrayPrependFunction
,ArrayRemoveFunction
,ArrayReverseFunction
,ArraySliceFunction
,ArraySortFunction
,ArrayUnionFunction
,AsyncLookupFunction
,AsyncScalarFunction
,AsyncTableFunction
,AvgAggFunction
,AvgAggFunction.ByteAvgAggFunction
,AvgAggFunction.DecimalAvgAggFunction
,AvgAggFunction.DoubleAvgAggFunction
,AvgAggFunction.FloatAvgAggFunction
,AvgAggFunction.IntAvgAggFunction
,AvgAggFunction.LongAvgAggFunction
,AvgAggFunction.ShortAvgAggFunction
,BatchApproxCountDistinctAggFunctions.ApproxCountDistinctAggFunction
,BatchApproxCountDistinctAggFunctions.ByteApproxCountDistinctAggFunction
,BatchApproxCountDistinctAggFunctions.DateApproxCountDistinctAggFunction
,BatchApproxCountDistinctAggFunctions.DecimalApproxCountDistinctAggFunction
,BatchApproxCountDistinctAggFunctions.DoubleApproxCountDistinctAggFunction
,BatchApproxCountDistinctAggFunctions.FloatApproxCountDistinctAggFunction
,BatchApproxCountDistinctAggFunctions.IntApproxCountDistinctAggFunction
,BatchApproxCountDistinctAggFunctions.LongApproxCountDistinctAggFunction
,BatchApproxCountDistinctAggFunctions.ShortApproxCountDistinctAggFunction
,BatchApproxCountDistinctAggFunctions.StringApproxCountDistinctAggFunction
,BatchApproxCountDistinctAggFunctions.TimeApproxCountDistinctAggFunction
,BatchApproxCountDistinctAggFunctions.TimestampApproxCountDistinctAggFunction
,BatchApproxCountDistinctAggFunctions.TimestampLtzApproxCountDistinctAggFunction
,BTrimFunction
,BuiltInAggregateFunction
,BuiltInFunctionDefinition
,BuiltInScalarFunction
,BuiltInSpecializedFunction
,BuiltInTableFunction
,CachingAsyncLookupFunction
,CachingLookupFunction
,CoalesceFunction
,CollectAggFunction
,Count1AggFunction
,CountAggFunction
,CountAggFunction
,CsvTableSource.CsvLookupFunction
,CumeDistAggFunction
,DeclarativeAggregateFunction
,DenseRankAggFunction
,EltFunction
,EndsWithFunction
,FirstValueAggFunction
,FirstValueWithRetractAggFunction
,GettingStartedExample.AddressNormalizer
,IfNullFunction
,ImperativeAggregateFunction
,InternalRowMergerFunction
,JsonArrayAggFunction
,JsonObjectAggFunction
,JsonQuoteFunction
,JsonUnquoteFunction
,LagAggFunction
,LastDatedValueFunction
,LastValueAggFunction
,LastValueWithRetractAggFunction
,LeadLagAggFunction
,LeadLagAggFunction.BooleanLeadLagAggFunction
,LeadLagAggFunction.ByteLeadLagAggFunction
,LeadLagAggFunction.CharLeadLagAggFunction
,LeadLagAggFunction.DateLeadLagAggFunction
,LeadLagAggFunction.DecimalLeadLagAggFunction
,LeadLagAggFunction.DoubleLeadLagAggFunction
,LeadLagAggFunction.FloatLeadLagAggFunction
,LeadLagAggFunction.IntLeadLagAggFunction
,LeadLagAggFunction.LongLeadLagAggFunction
,LeadLagAggFunction.ShortLeadLagAggFunction
,LeadLagAggFunction.StringLeadLagAggFunction
,LeadLagAggFunction.TimeLeadLagAggFunction
,LeadLagAggFunction.TimestampLeadLagAggFunction
,ListAggFunction
,ListAggWithRetractAggFunction
,ListAggWsWithRetractAggFunction
,LookupFunction
,MapEntriesFunction
,MapFromArraysFunction
,MapKeysFunction
,MapUnionFunction
,MapValuesFunction
,MaxAggFunction
,MaxAggFunction.BooleanMaxAggFunction
,MaxAggFunction.ByteMaxAggFunction
,MaxAggFunction.DateMaxAggFunction
,MaxAggFunction.DecimalMaxAggFunction
,MaxAggFunction.DoubleMaxAggFunction
,MaxAggFunction.FloatMaxAggFunction
,MaxAggFunction.IntMaxAggFunction
,MaxAggFunction.LongMaxAggFunction
,MaxAggFunction.ShortMaxAggFunction
,MaxAggFunction.StringMaxAggFunction
,MaxAggFunction.TimeMaxAggFunction
,MaxAggFunction.TimestampLtzMaxAggFunction
,MaxAggFunction.TimestampMaxAggFunction
,MaxWithRetractAggFunction
,MinAggFunction
,MinAggFunction.BooleanMinAggFunction
,MinAggFunction.ByteMinAggFunction
,MinAggFunction.DateMinAggFunction
,MinAggFunction.DecimalMinAggFunction
,MinAggFunction.DoubleMinAggFunction
,MinAggFunction.FloatMinAggFunction
,MinAggFunction.IntMinAggFunction
,MinAggFunction.LongMinAggFunction
,MinAggFunction.ShortMinAggFunction
,MinAggFunction.StringMinAggFunction
,MinAggFunction.TimeMinAggFunction
,MinAggFunction.TimestampLtzMinAggFunction
,MinAggFunction.TimestampMinAggFunction
,MinWithRetractAggFunction
,NTILEAggFunction
,PercentileAggFunction
,PercentileAggFunction.MultiPercentileAggFunction
,PercentileAggFunction.SinglePercentileAggFunction
,PercentRankAggFunction
,PrintfFunction
,ProcedureDefinition
,PythonAggregateFunction
,PythonScalarFunction
,PythonTableAggregateFunction
,PythonTableFunction
,RankAggFunction
,RankLikeAggFunctionBase
,RegexpCountFunction
,RegexpExtractAllFunction
,RegexpInstrFunction
,RegexpSubstrFunction
,ReplicateRowsFunction
,RetryableAsyncLookupFunctionDelegator
,RetryableLookupFunctionDelegator
,RowNumberAggFunction
,ScalarFunction
,ScalarFunctionDefinition
,SingleValueAggFunction
,SingleValueAggFunction.BooleanSingleValueAggFunction
,SingleValueAggFunction.ByteSingleValueAggFunction
,SingleValueAggFunction.CharSingleValueAggFunction
,SingleValueAggFunction.DateSingleValueAggFunction
,SingleValueAggFunction.DecimalSingleValueAggFunction
,SingleValueAggFunction.DoubleSingleValueAggFunction
,SingleValueAggFunction.FloatSingleValueAggFunction
,SingleValueAggFunction.IntSingleValueAggFunction
,SingleValueAggFunction.LongSingleValueAggFunction
,SingleValueAggFunction.ShortSingleValueAggFunction
,SingleValueAggFunction.StringSingleValueAggFunction
,SingleValueAggFunction.TimeSingleValueAggFunction
,SingleValueAggFunction.TimestampLtzSingleValueAggFunction
,SingleValueAggFunction.TimestampSingleValueAggFunction
,SourceWatermarkFunction
,SplitFunction
,StartsWithFunction
,StringRegexReplaceFunction
,Sum0AggFunction
,Sum0AggFunction.ByteSum0AggFunction
,Sum0AggFunction.DecimalSum0AggFunction
,Sum0AggFunction.DoubleSum0AggFunction
,Sum0AggFunction.FloatSum0AggFunction
,Sum0AggFunction.IntSum0AggFunction
,Sum0AggFunction.LongSum0AggFunction
,Sum0AggFunction.ShortSum0AggFunction
,SumAggFunction
,SumAggFunction.ByteSumAggFunction
,SumAggFunction.DecimalSumAggFunction
,SumAggFunction.DoubleSumAggFunction
,SumAggFunction.FloatSumAggFunction
,SumAggFunction.IntSumAggFunction
,SumAggFunction.LongSumAggFunction
,SumAggFunction.ShortSumAggFunction
,SumWithRetractAggFunction
,SumWithRetractAggFunction.ByteSumWithRetractAggFunction
,SumWithRetractAggFunction.DecimalSumWithRetractAggFunction
,SumWithRetractAggFunction.DoubleSumWithRetractAggFunction
,SumWithRetractAggFunction.FloatSumWithRetractAggFunction
,SumWithRetractAggFunction.IntSumWithRetractAggFunction
,SumWithRetractAggFunction.LongSumWithRetractAggFunction
,SumWithRetractAggFunction.ShortSumWithRetractAggFunction
,TableAggregateFunction
,TableAggregateFunctionDefinition
,TableFunction
,TableFunctionDefinition
,TemporalTableFunction
,TemporalTableFunctionImpl
,TranslateFunction
,TypeOfFunction
,UnhexFunction
,UnnestRowsFunction
,UnnestRowsFunction.CollectionUnnestTableFunction
,UnnestRowsFunction.MapUnnestTableFunction
,UrlDecodeFunction
,UrlEncodeFunction
,UserDefinedFunction
@PublicEvolving public interface FunctionDefinition
Definition of a function. Instances of this class provide all details necessary to validate a function call and perform planning.A pure function definition doesn't have to contain a runtime implementation. This can be provided by the planner at later stages. A
UserDefinedFunction
is a function definition that includes a runtime implementation already.- See Also:
UserDefinedFunction
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description FunctionKind
getKind()
Returns the kind of function this definition describes.default Set<FunctionRequirement>
getRequirements()
Returns the set of requirements this definition demands.TypeInference
getTypeInference(DataTypeFactory typeFactory)
Returns the logic for performing type inference of a call to this function definition.default boolean
isDeterministic()
Returns information about the determinism of the function's results.default boolean
supportsConstantFolding()
If the constant-folding should be run during planning time on calls to this function.
-
-
-
Method Detail
-
getKind
FunctionKind getKind()
Returns the kind of function this definition describes.
-
getTypeInference
TypeInference getTypeInference(DataTypeFactory typeFactory)
Returns 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
BuiltInFunctionDefinitions
for concrete usage examples.
-
getRequirements
default Set<FunctionRequirement> getRequirements()
Returns the set of requirements this definition demands.
-
isDeterministic
default boolean isDeterministic()
Returns information about the determinism of the function's results.It returns
true
if and only if a call to this function is guaranteed to always return the same result given the same parameters.true
is assumed by default. If the function is not purely functional likerandom(), date(), now(), ...
this method must returnfalse
.Furthermore, return
false
if 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.
-
supportsConstantFolding
default boolean supportsConstantFolding()
If the constant-folding should be run during planning time on calls to this function. If not, the expression will be left as-is and the call will be made during runtime.
-
-