Class BuiltInSqlFunction

java.lang.Object
org.apache.calcite.sql.SqlOperator
org.apache.calcite.sql.SqlFunction
org.apache.flink.table.planner.functions.sql.BuiltInSqlFunction
All Implemented Interfaces:
BuiltInSqlOperator
Direct Known Subclasses:
MatchRowTimeFunction, SqlTryCastFunction

@Internal public class BuiltInSqlFunction extends org.apache.calcite.sql.SqlFunction implements BuiltInSqlOperator
SQL version of BuiltInFunctionDefinition in cases where BridgingSqlFunction does not apply. This is the case when the operator has a special parsing syntax or uses other Calcite-specific features that are not exposed via BuiltInFunctionDefinition yet.

Note: Try to keep usages of this class to a minimum and use Flink's BuiltInFunctionDefinition stack instead.

For simple functions, use the provided builder. Otherwise, this class can also be extended.

  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
    Builder for fluent definition of built-in functions.
  • Field Summary

    Fields inherited from class org.apache.calcite.sql.SqlOperator

    kind, MDX_PRECEDENCE, NL
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    BuiltInSqlFunction(String name, int version, org.apache.calcite.sql.SqlKind kind, org.apache.calcite.sql.type.SqlReturnTypeInference returnTypeInference, org.apache.calcite.sql.type.SqlOperandTypeInference operandTypeInference, org.apache.calcite.sql.type.SqlOperandTypeChecker operandTypeChecker, org.apache.calcite.sql.SqlFunctionCategory category, boolean isDeterministic, boolean isInternal, Function<org.apache.calcite.sql.SqlOperatorBinding,org.apache.calcite.sql.validate.SqlMonotonicity> monotonicity)
     
    protected
    BuiltInSqlFunction(String name, org.apache.calcite.sql.SqlKind kind, org.apache.calcite.sql.type.SqlReturnTypeInference returnTypeInference, org.apache.calcite.sql.type.SqlOperandTypeInference operandTypeInference, org.apache.calcite.sql.type.SqlOperandTypeChecker operandTypeChecker, org.apache.calcite.sql.SqlFunctionCategory category)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    org.apache.calcite.sql.validate.SqlMonotonicity
    getMonotonicity(org.apache.calcite.sql.SqlOperatorBinding call)
     
     
     
    boolean
     
    final boolean
     
    Builder for configuring and creating instances of BuiltInSqlFunction.

    Methods inherited from class org.apache.calcite.sql.SqlFunction

    deriveType, getFunctionType, getNameAsId, getParamNames, getParamTypes, getSqlIdentifier, getSyntax, isQuantifierAllowed, unparse, validateCall, validateQuantifier

    Methods inherited from class org.apache.calcite.sql.SqlOperator

    acceptCall, acceptCall, adjustType, allowsFraming, argumentMustBeScalar, checkOperandCount, checkOperandTypes, constructArgNameList, constructArgTypeList, constructOperandList, createCall, createCall, createCall, createCall, createCall, createCall, createCall, deriveOperandType, equals, getAllowedSignatures, getAllowedSignatures, getKind, getLeftPrec, getMonotonicity, getName, getOperandCountRange, getOperandTypeChecker, getOperandTypeInference, getReturnTypeInference, getRightPrec, getSignatureTemplate, getStrongPolicyInference, hashCode, inferReturnType, inferReturnType, isAggregator, isDynamicFunction, isGroup, isGroupAuxiliary, isName, isSymmetrical, leftPrec, not, preValidateCall, requiresDecimalExpansion, requiresOrder, requiresOver, reverse, rewriteCall, rightPrec, toString, unparseListClause, unparseListClause, validateOperands, validRexOperands

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • BuiltInSqlFunction

      protected BuiltInSqlFunction(String name, int version, org.apache.calcite.sql.SqlKind kind, @Nullable org.apache.calcite.sql.type.SqlReturnTypeInference returnTypeInference, @Nullable org.apache.calcite.sql.type.SqlOperandTypeInference operandTypeInference, @Nullable org.apache.calcite.sql.type.SqlOperandTypeChecker operandTypeChecker, org.apache.calcite.sql.SqlFunctionCategory category, boolean isDeterministic, boolean isInternal, Function<org.apache.calcite.sql.SqlOperatorBinding,org.apache.calcite.sql.validate.SqlMonotonicity> monotonicity)
    • BuiltInSqlFunction

      protected BuiltInSqlFunction(String name, org.apache.calcite.sql.SqlKind kind, org.apache.calcite.sql.type.SqlReturnTypeInference returnTypeInference, org.apache.calcite.sql.type.SqlOperandTypeInference operandTypeInference, @Nullable org.apache.calcite.sql.type.SqlOperandTypeChecker operandTypeChecker, org.apache.calcite.sql.SqlFunctionCategory category)
  • Method Details

    • newBuilder

      public static BuiltInSqlFunction.Builder newBuilder()
      Builder for configuring and creating instances of BuiltInSqlFunction.
    • getVersion

      public final Optional<Integer> getVersion()
      Specified by:
      getVersion in interface BuiltInSqlOperator
      See Also:
      • BuiltInFunctionDefinition.getVersion()
    • getQualifiedName

      public String getQualifiedName()
      Specified by:
      getQualifiedName in interface BuiltInSqlOperator
      See Also:
      • BuiltInFunctionDefinition.getQualifiedName()
    • isDeterministic

      public boolean isDeterministic()
      Overrides:
      isDeterministic in class org.apache.calcite.sql.SqlOperator
    • isInternal

      public final boolean isInternal()
      Specified by:
      isInternal in interface BuiltInSqlOperator
      See Also:
      • BuiltInFunctionDefinition.isInternal()
    • getMonotonicity

      public org.apache.calcite.sql.validate.SqlMonotonicity getMonotonicity(org.apache.calcite.sql.SqlOperatorBinding call)
      Overrides:
      getMonotonicity in class org.apache.calcite.sql.SqlOperator