Class ContextResolvedFunction

java.lang.Object
org.apache.flink.table.catalog.ContextResolvedFunction

@Internal public final class ContextResolvedFunction extends Object
This class contains information about a function and its relationship with a Catalog, if any.

There can be 3 kinds of ContextResolvedFunction:

  • A permanent function: a function which is stored in a Catalog or is provided by a Module as a system function. It always has an associated unique FunctionIdentifier.
  • A temporary function: a function which is stored in the FunctionCatalog (either as a catalog or system function), has an associated unique FunctionIdentifier and is flagged as temporary.
  • An anonymous/inline function: a function which is not stored in a catalog or module and doesn't have an associated unique FunctionIdentifier. During Table API translation, BuiltInFunctionDefinitions are treated as anonymous functions in the API builders that get translated to permanent functions if available in the CoreModule.

This class is meant for internal usages. However, it needs to be kept in sync with the public CallExpression which contains similar context information. The convenience methods fromCallExpression(CallExpression) and toCallExpression(List, DataType) allow a symmetric conversion.

  • Method Details

    • permanent

      public static ContextResolvedFunction permanent(org.apache.flink.table.functions.FunctionIdentifier functionIdentifier, org.apache.flink.table.functions.FunctionDefinition functionDefinition)
    • permanent

      public static ContextResolvedFunction permanent(org.apache.flink.table.functions.FunctionIdentifier functionIdentifier, org.apache.flink.table.functions.FunctionDefinition functionDefinition, org.apache.flink.table.catalog.CatalogFunction catalogFunction)
    • temporary

      public static ContextResolvedFunction temporary(org.apache.flink.table.functions.FunctionIdentifier functionIdentifier, org.apache.flink.table.functions.FunctionDefinition functionDefinition)
    • temporary

      public static ContextResolvedFunction temporary(org.apache.flink.table.functions.FunctionIdentifier functionIdentifier, org.apache.flink.table.functions.FunctionDefinition functionDefinition, org.apache.flink.table.catalog.CatalogFunction catalogFunction)
    • anonymous

      public static ContextResolvedFunction anonymous(org.apache.flink.table.functions.FunctionDefinition functionDefinition)
    • fromCallExpression

      public static ContextResolvedFunction fromCallExpression(org.apache.flink.table.expressions.CallExpression callExpression)
    • isAnonymous

      public boolean isAnonymous()
    • isTemporary

      public boolean isTemporary()
      Returns:
      true if the function is temporary. An anonymous function is always temporary.
    • isPermanent

      public boolean isPermanent()
    • getIdentifier

      public Optional<org.apache.flink.table.functions.FunctionIdentifier> getIdentifier()
    • getDefinition

      public org.apache.flink.table.functions.FunctionDefinition getDefinition()
    • getCatalogFunction

      public org.apache.flink.table.catalog.CatalogFunction getCatalogFunction()
    • asSummaryString

      public String asSummaryString()
    • toCallExpression

      public org.apache.flink.table.expressions.CallExpression toCallExpression(List<org.apache.flink.table.expressions.ResolvedExpression> resolvedArgs, org.apache.flink.table.types.DataType outputDataType)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object