Packages

trait SimpleFunction extends UnboundFunction with BoundFunction

A function that does not require binding to input types.

This interface is designed for functions that have no overloads and do not need custom binding logic. Implementations can directly provide function parameters and execution logic without implementing the bind method.

The default bind method simply returns this, as the function is already considered bound.

Annotations
@Evolving()
Source
SimpleFunction.java
Since

4.2.0

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. SimpleFunction
  2. BoundFunction
  3. UnboundFunction
  4. Function
  5. Serializable
  6. AnyRef
  7. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Abstract Value Members

  1. abstract def description(): String

    Returns Function documentation.

    Returns Function documentation.

    returns

    this function's documentation

    Definition Classes
    UnboundFunction
  2. abstract def inputTypes(): Array[DataType]

    Returns the required data types of the input values to this function.

    Returns the required data types of the input values to this function.

    If the types returned differ from the types passed to UnboundFunction#bind(StructType), Spark will cast input values to the required data types. This allows implementations to delegate input value casting to Spark.

    returns

    an array of input value data types

    Definition Classes
    BoundFunction
  3. abstract def name(): String

    A name to identify this function.

    A name to identify this function. Implementations should provide a meaningful name, like the database and function name from the catalog.

    Definition Classes
    Function
  4. abstract def resultType(): DataType

    Returns the data type of values produced by this function.

    Returns the data type of values produced by this function.

    For example, a "plus" function may return IntegerType when it is bound to arguments that are also IntegerType.

    returns

    a data type for values produced by this function

    Definition Classes
    BoundFunction

Concrete Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def bind(inputType: StructType): BoundFunction

    Bind this function to an input type.

    Bind this function to an input type.

    If the input type is not supported, implementations must throw UnsupportedOperationException.

    For example, a "length" function that only supports a single string argument should throw UnsupportedOperationException if the struct has more than one field or if that field is not a string, and it may optionally throw if the field is nullable.

    inputType

    a struct type for inputs that will be passed to the bound function

    returns

    a function that can process rows with the given input type

    Definition Classes
    SimpleFunctionUnboundFunction
    Annotations
    @Override()
    Exceptions thrown

    UnsupportedOperationException If the function cannot be applied to the input type

  6. def canonicalName(): String

    Returns the canonical name of this function, used to determine if functions are equivalent.

    Returns the canonical name of this function, used to determine if functions are equivalent.

    The canonical name is used to determine whether two functions are the same when loaded by different catalogs. For example, the same catalog implementation may be used for by two environments, "prod" and "test". Functions produced by the catalogs may be equivalent, but loaded using different names, like "test.func_name" and "prod.func_name".

    Names returned by this function should be unique and unlikely to conflict with similar functions in other catalogs. For example, many catalogs may define a "bucket" function with a different implementation. Adding context, like "com.mycompany.bucket(string)", is recommended to avoid unintentional collisions.

    returns

    a canonical name for this function

    Definition Classes
    BoundFunction
  7. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @IntrinsicCandidate() @native()
  8. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  9. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  10. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @IntrinsicCandidate() @native()
  11. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @IntrinsicCandidate() @native()
  12. def isDeterministic(): Boolean

    Returns whether this function result is deterministic.

    Returns whether this function result is deterministic.

    By default, functions are assumed to be deterministic. Functions that are not deterministic should override this method so that Spark can ensure the function runs only once for a given input.

    returns

    true if this function is deterministic, false otherwise

    Definition Classes
    BoundFunction
  13. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  14. def isResultNullable(): Boolean

    Returns whether the values produced by this function may be null.

    Returns whether the values produced by this function may be null.

    For example, a "plus" function may return false when it is bound to arguments that are always non-null, but true when either argument may be null.

    returns

    true if values produced by this function may be null, false otherwise

    Definition Classes
    BoundFunction
  15. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  16. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @IntrinsicCandidate() @native()
  17. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @IntrinsicCandidate() @native()
  18. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  19. def toString(): String
    Definition Classes
    AnyRef → Any
  20. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  21. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  22. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

    (Since version 9)

Inherited from BoundFunction

Inherited from UnboundFunction

Inherited from Function

Inherited from Serializable

Inherited from AnyRef

Inherited from Any

Ungrouped