Record Class BagRelation
java.lang.Object
java.lang.Record
com.darkcollective.relix.processor.exec.BagRelation
- Record Components:
schema- the schema shared by all rows; never nullrows- the ordered list of rows; never null; a defensive copy is stored
- All Implemented Interfaces:
MaterializedRelation
public record BagRelation(Schema schema, List<Row> rows)
extends Record
implements MaterializedRelation
A materialised relation that preserves insertion order and allows duplicate
rows — the
Bag type in the IBM flat-collection taxonomy.
This is the natural output type for:
- Join operators (every matching pair is emitted, regardless of duplicates).
UNION ALL(both inputs are concatenated without deduplication).- Aggregation results (one row per group, but groups may produce identical values).
-
Constructor Summary
ConstructorsConstructorDescriptionBagRelation(Schema schema, List<Row> rows) Creates an instance of aBagRelationrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.static BagRelationFactory that accepts a mutable list and stores a defensive copy.rows()Returns the value of therowsrecord component.schema()Returns the value of theschemarecord component.stream()Returns a lazy stream over all rows in this relation.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Method Details
-
of
Factory that accepts a mutable list and stores a defensive copy. -
stream
Description copied from interface:MaterializedRelationReturns a lazy stream over all rows in this relation. The stream may be consumed exactly once.- Specified by:
streamin interfaceMaterializedRelation
-
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. -
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. -
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). -
schema
Returns the value of theschemarecord component.- Specified by:
schemain interfaceMaterializedRelation- Returns:
- the value of the
schemarecord component
-
rows
Returns the value of therowsrecord component.- Returns:
- the value of the
rowsrecord component
-