Record Class ScalarFunctionArgs

java.lang.Object
java.lang.Record
org.apache.datafusion.ScalarFunctionArgs

public record ScalarFunctionArgs(List<ColumnarValue> args, int rowCount) extends Record
Bundle of inputs passed to ScalarFunction.evaluate(org.apache.arrow.memory.BufferAllocator, org.apache.datafusion.ScalarFunctionArgs): the per-arg ColumnarValues (in declared order) and the batch row count DataFusion is driving.

Mirrors DataFusion's datafusion::logical_expr::ScalarFunctionArgs. rowCount is the only channel by which an array-returning UDF without array-typed inputs (all-scalar args, or nullary) can size its output. Nullary UDFs that prefer to broadcast a single value should return ColumnarValue.scalar(...) instead, which removes the need to consult rowCount.

  • Constructor Details

    • ScalarFunctionArgs

      public ScalarFunctionArgs(List<ColumnarValue> args, int rowCount)
      Creates an instance of a ScalarFunctionArgs record class.
      Parameters:
      args - the value for the args record component
      rowCount - the value for the rowCount record component
  • Method Details

    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • args

      public List<ColumnarValue> args()
      Returns the value of the args record component.
      Returns:
      the value of the args record component
    • rowCount

      public int rowCount()
      Returns the value of the rowCount record component.
      Returns:
      the value of the rowCount record component