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.
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
-
Method Details
-
value
Computes the derived value for one row.- Parameters:
batch- the input batch; the function must not modify or close itrow- the row index to compute the value for- Returns:
- the value to write, coerced to the declared Arrow type, or null
-