Class TableFunctionImpl

java.lang.Object
org.apache.calcite.schema.impl.ReflectiveFunctionBase
org.apache.calcite.schema.impl.TableFunctionImpl
All Implemented Interfaces:
Function, ImplementableFunction, TableFunction

public class TableFunctionImpl extends ReflectiveFunctionBase implements TableFunction, ImplementableFunction
Implementation of TableFunction based on a method.
  • Method Details

    • create

      public static @Nullable TableFunction create(Class<?> clazz)
      Creates a TableFunctionImpl from a class, looking for an "eval" method. Returns null if there is no such method.
    • create

      public static @Nullable TableFunction create(Class<?> clazz, String methodName)
      Creates a TableFunctionImpl from a class, looking for a method with a given name. Returns null if there is no such method.
    • create

      public static @Nullable TableFunction create(Method method)
      Creates a TableFunctionImpl from a method.
    • getRowType

      public RelDataType getRowType(RelDataTypeFactory typeFactory, List<? extends @Nullable Object> arguments)
      Description copied from interface: TableFunction
      Returns the record type of the table yielded by this function when applied to given arguments. Only literal arguments are passed, non-literal are replaced with default values (null, 0, false, etc).
      Specified by:
      getRowType in interface TableFunction
      Parameters:
      typeFactory - Type factory
      arguments - arguments of a function call (only literal arguments are passed, nulls for non-literal ones)
      Returns:
      row type of the table
    • getElementType

      public Type getElementType(List<? extends @Nullable Object> arguments)
      Description copied from interface: TableFunction
      Returns the row type of the table yielded by this function when applied to given arguments. Only literal arguments are passed, non-literal are replaced with default values (null, 0, false, etc).
      Specified by:
      getElementType in interface TableFunction
      Parameters:
      arguments - arguments of a function call (only literal arguments are passed, nulls for non-literal ones)
      Returns:
      element type of the table (e.g. Object[].class)
    • getImplementor

      public CallImplementor getImplementor()
      Description copied from interface: ImplementableFunction
      Returns implementor that translates the function to linq4j expression.
      Specified by:
      getImplementor in interface ImplementableFunction
      Returns:
      implementor that translates the function to linq4j expression.