Interface RowValue

Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface RowValue
Computes one derived Arrow column value.

Used inside a DerivedColumn passed to BuiltinOp.withColumns(org.apache.arrow.memory.BufferAllocator, DerivedColumn...). The returned object is coerced to the derived column's declared Arrow type; returning null writes a null. Numeric coercions are overflow-checked and a value no conversion accepts throws ColumnarException.

Example

RowValue doubled = (batch, row) ->
    ((BigIntVector) batch.getVector("amount")).get(row) * 2;
var column = new DerivedColumn(
    new Field("double_amount", FieldType.nullable(new ArrowType.Int(64, true)), null),
    doubled);
  • Method Summary

    Modifier and Type
    Method
    Description
    value(org.apache.arrow.vector.VectorSchemaRoot batch, int row)
    Computes the derived value for one row.
  • Method Details

    • value

      Object value(org.apache.arrow.vector.VectorSchemaRoot batch, int row)
      Computes the derived value for one row.
      Parameters:
      batch - the input batch; the function must not modify or close it
      row - the row index to compute the value for
      Returns:
      the value to write, coerced to the declared Arrow type, or null