Class BuiltInScalarFunction

java.lang.Object
org.apache.flink.table.functions.UserDefinedFunction
org.apache.flink.table.functions.ScalarFunction
org.apache.flink.table.runtime.functions.scalar.BuiltInScalarFunction
All Implemented Interfaces:
Serializable, org.apache.flink.table.functions.FunctionDefinition
Direct Known Subclasses:
ArrayAppendFunction, ArrayConcatFunction, ArrayContainsFunction, ArrayDistinctFunction, ArrayExceptFunction, ArrayIntersectFunction, ArrayJoinFunction, ArrayMaxFunction, ArrayMinFunction, ArrayPositionFunction, ArrayPrependFunction, ArrayRemoveFunction, ArrayReverseFunction, ArraySliceFunction, ArraySortFunction, ArrayUnionFunction, BTrimFunction, CoalesceFunction, EltFunction, EndsWithFunction, IfNullFunction, JsonQuoteFunction, JsonUnquoteFunction, MapEntriesFunction, MapFromArraysFunction, MapKeysFunction, MapUnionFunction, MapValuesFunction, PrintfFunction, RegexpCountFunction, RegexpExtractAllFunction, RegexpInstrFunction, RegexpSubstrFunction, SourceWatermarkFunction, SplitFunction, StartsWithFunction, ToTimestampLtzFunction, TranslateFunction, TypeOfFunction, UnhexFunction, UrlDecodeFunction, UrlEncodeFunction

@Internal public abstract class BuiltInScalarFunction extends org.apache.flink.table.functions.ScalarFunction
Base class for runtime implementation represented as ScalarFunction that is constructed from BuiltInFunctionDefinition.specialize(SpecializedContext).

Subclasses must offer a constructor that takes SpecializedFunction.SpecializedContext if they are constructed from a BuiltInFunctionDefinition. Otherwise the BuiltInScalarFunction() constructor might be more appropriate.

By default, all built-in functions work on internal data structures. However, this can be changed by overriding getArgumentDataTypes() and getOutputDataType(). Or by overriding getTypeInference(DataTypeFactory) directly.

See Also:
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
     
    protected
    BuiltInScalarFunction(org.apache.flink.table.functions.BuiltInFunctionDefinition definition, org.apache.flink.table.functions.SpecializedFunction.SpecializedContext context)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    List<org.apache.flink.table.types.DataType>
     
    org.apache.flink.table.types.DataType
     
    Set<org.apache.flink.table.functions.FunctionRequirement>
     
    org.apache.flink.table.types.inference.TypeInference
    getTypeInference(org.apache.flink.table.catalog.DataTypeFactory typeFactory)
     
    boolean
     

    Methods inherited from class org.apache.flink.table.functions.ScalarFunction

    getKind, getParameterTypes, getResultType

    Methods inherited from class org.apache.flink.table.functions.UserDefinedFunction

    close, functionIdentifier, open, toString

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface org.apache.flink.table.functions.FunctionDefinition

    supportsConstantFolding
  • Constructor Details

    • BuiltInScalarFunction

      protected BuiltInScalarFunction(org.apache.flink.table.functions.BuiltInFunctionDefinition definition, org.apache.flink.table.functions.SpecializedFunction.SpecializedContext context)
    • BuiltInScalarFunction

      protected BuiltInScalarFunction()
  • Method Details

    • getArgumentDataTypes

      public List<org.apache.flink.table.types.DataType> getArgumentDataTypes()
    • getOutputDataType

      public org.apache.flink.table.types.DataType getOutputDataType()
    • getTypeInference

      public org.apache.flink.table.types.inference.TypeInference getTypeInference(org.apache.flink.table.catalog.DataTypeFactory typeFactory)
      Specified by:
      getTypeInference in interface org.apache.flink.table.functions.FunctionDefinition
      Overrides:
      getTypeInference in class org.apache.flink.table.functions.ScalarFunction
    • getRequirements

      public Set<org.apache.flink.table.functions.FunctionRequirement> getRequirements()
    • isDeterministic

      public boolean isDeterministic()