Class ScalarFunctionImpl

java.lang.Object
org.apache.beam.sdk.extensions.sql.impl.UdfImplReflectiveFunctionBase
org.apache.beam.sdk.extensions.sql.impl.ScalarFunctionImpl
All Implemented Interfaces:
org.apache.beam.vendor.calcite.v1_28_0.org.apache.calcite.schema.Function, org.apache.beam.vendor.calcite.v1_28_0.org.apache.calcite.schema.ImplementableFunction, org.apache.beam.vendor.calcite.v1_28_0.org.apache.calcite.schema.ScalarFunction
Direct Known Subclasses:
ZetaSqlScalarFunctionImpl

public class ScalarFunctionImpl extends UdfImplReflectiveFunctionBase implements org.apache.beam.vendor.calcite.v1_28_0.org.apache.calcite.schema.ScalarFunction, org.apache.beam.vendor.calcite.v1_28_0.org.apache.calcite.schema.ImplementableFunction
Beam-customized version from ScalarFunctionImpl , to address BEAM-5921.
  • Nested Class Summary

    Nested classes/interfaces inherited from class org.apache.beam.sdk.extensions.sql.impl.UdfImplReflectiveFunctionBase

    UdfImplReflectiveFunctionBase.ParameterListBuilder
  • Field Summary

    Fields inherited from class org.apache.beam.sdk.extensions.sql.impl.UdfImplReflectiveFunctionBase

    method, parameters
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    ScalarFunctionImpl(Method method, org.apache.beam.vendor.calcite.v1_28_0.org.apache.calcite.adapter.enumerable.CallImplementor implementor)
     
    protected
    ScalarFunctionImpl(Method method, org.apache.beam.vendor.calcite.v1_28_0.org.apache.calcite.adapter.enumerable.CallImplementor implementor, String jarPath)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static org.apache.beam.vendor.calcite.v1_28_0.org.apache.calcite.schema.Function
    create(Method method)
    Creates Function from given method.
    static org.apache.beam.vendor.calcite.v1_28_0.org.apache.calcite.schema.Function
    create(Method method, String jarPath)
    Creates
    invalid reference
    org.apache.beam.vendor.calcite.v1_20_0.org.apache.calcite.schema.Function
    from given method.
    static org.apache.beam.vendor.guava.v32_1_2_jre.com.google.common.collect.ImmutableMultimap<String,org.apache.beam.vendor.calcite.v1_28_0.org.apache.calcite.schema.Function>
    createAll(Class<?> clazz)
    Creates Function for each method in a given class.
    protected static org.apache.beam.vendor.calcite.v1_28_0.org.apache.calcite.adapter.enumerable.CallImplementor
     
    org.apache.beam.vendor.calcite.v1_28_0.org.apache.calcite.adapter.enumerable.CallImplementor
     
    Optional Beam filesystem path to the jar containing the bytecode for this function.
    org.apache.beam.vendor.calcite.v1_28_0.org.apache.calcite.rel.type.RelDataType
    getReturnType(org.apache.beam.vendor.calcite.v1_28_0.org.apache.calcite.rel.type.RelDataTypeFactory typeFactory)
     
    org.apache.beam.vendor.calcite.v1_28_0.org.apache.calcite.rel.type.RelDataType
    getReturnType(org.apache.beam.vendor.calcite.v1_28_0.org.apache.calcite.rel.type.RelDataTypeFactory typeFactory, org.apache.beam.vendor.calcite.v1_28_0.org.apache.calcite.sql.SqlOperatorBinding opBinding)
     
    protected static void
     

    Methods inherited from class org.apache.beam.sdk.extensions.sql.impl.UdfImplReflectiveFunctionBase

    builder, getParameters

    Methods inherited from class java.lang.Object

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

    Methods inherited from interface org.apache.beam.vendor.calcite.v1_28_0.org.apache.calcite.schema.Function

    getParameters
  • Constructor Details

    • ScalarFunctionImpl

      protected ScalarFunctionImpl(Method method, org.apache.beam.vendor.calcite.v1_28_0.org.apache.calcite.adapter.enumerable.CallImplementor implementor, String jarPath)
    • ScalarFunctionImpl

      protected ScalarFunctionImpl(Method method, org.apache.beam.vendor.calcite.v1_28_0.org.apache.calcite.adapter.enumerable.CallImplementor implementor)
  • Method Details

    • getJarPath

      public String getJarPath()
      Optional Beam filesystem path to the jar containing the bytecode for this function. Empty if the function is assumed to already be on the classpath.
    • createAll

      public static org.apache.beam.vendor.guava.v32_1_2_jre.com.google.common.collect.ImmutableMultimap<String,org.apache.beam.vendor.calcite.v1_28_0.org.apache.calcite.schema.Function> createAll(Class<?> clazz)
      Creates Function for each method in a given class.
    • create

      public static org.apache.beam.vendor.calcite.v1_28_0.org.apache.calcite.schema.Function create(Method method)
      Creates Function from given method. When eval method does not suit, null is returned.
      Parameters:
      method - method that is used to implement the function
      Returns:
      created Function or null
    • create

      public static org.apache.beam.vendor.calcite.v1_28_0.org.apache.calcite.schema.Function create(Method method, String jarPath)
      Creates
      invalid reference
      org.apache.beam.vendor.calcite.v1_20_0.org.apache.calcite.schema.Function
      from given method. When eval method does not suit, null is returned.
      Parameters:
      method - method that is used to implement the function
      jarPath - Path to jar that contains the method.
      Returns:
      created Function or null
    • validateMethod

      protected static void validateMethod(Method method)
    • getReturnType

      public org.apache.beam.vendor.calcite.v1_28_0.org.apache.calcite.rel.type.RelDataType getReturnType(org.apache.beam.vendor.calcite.v1_28_0.org.apache.calcite.rel.type.RelDataTypeFactory typeFactory)
      Specified by:
      getReturnType in interface org.apache.beam.vendor.calcite.v1_28_0.org.apache.calcite.schema.ScalarFunction
    • getImplementor

      public org.apache.beam.vendor.calcite.v1_28_0.org.apache.calcite.adapter.enumerable.CallImplementor getImplementor()
      Specified by:
      getImplementor in interface org.apache.beam.vendor.calcite.v1_28_0.org.apache.calcite.schema.ImplementableFunction
    • createImplementor

      protected static org.apache.beam.vendor.calcite.v1_28_0.org.apache.calcite.adapter.enumerable.CallImplementor createImplementor(Method method)
    • getReturnType

      public org.apache.beam.vendor.calcite.v1_28_0.org.apache.calcite.rel.type.RelDataType getReturnType(org.apache.beam.vendor.calcite.v1_28_0.org.apache.calcite.rel.type.RelDataTypeFactory typeFactory, org.apache.beam.vendor.calcite.v1_28_0.org.apache.calcite.sql.SqlOperatorBinding opBinding)