Record Class DerivedColumn
java.lang.Object
java.lang.Record
io.krabka.streams.columnar.DerivedColumn
- Record Components:
field- the Arrow field declaring the column's name, type, and nullabilityvalue- the function that computes the column's value for each row
public record DerivedColumn(org.apache.arrow.vector.types.pojo.Field field, RowValue value)
extends Record
Defines a column that a with-columns operator adds or replaces.
A derived column whose field name matches an existing payload column replaces it
in place, keeping its position; a new name is appended after the existing columns.
Reserved metadata names such as __timestamp are rejected when the operator
is constructed.
Example
var doubled = new DerivedColumn(
new Field("double_amount", FieldType.nullable(new ArrowType.Int(64, true)), null),
(batch, row) -> ((BigIntVector) batch.getVector("amount")).get(row) * 2);
var op = BuiltinOp.withColumns(allocator, doubled);
-
Constructor Summary
ConstructorsConstructorDescriptionDerivedColumn(org.apache.arrow.vector.types.pojo.Field field, RowValue value) Validates that both components are present. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.org.apache.arrow.vector.types.pojo.Fieldfield()Returns the value of thefieldrecord component.final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.value()Returns the value of thevaluerecord component.
-
Constructor Details
-
DerivedColumn
Validates that both components are present.- Parameters:
field- the Arrow field declaring the column's name, type, and nullabilityvalue- the function that computes the column's value for each row- Throws:
NullPointerException- iffieldorvalueis null
-
-
Method Details
-
toString
-
hashCode
-
equals
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. All components in this record class are compared withObjects::equals(Object,Object). -
field
-
value
-