Record Class SortedBagRelation
java.lang.Object
java.lang.Record
com.darkcollective.relix.processor.exec.SortedBagRelation
- Record Components:
schema- the schema shared by all rows; never nullrows- the sorted list of rows; a defensive copy is stored; never null
- All Implemented Interfaces:
MaterializedRelation
public record SortedBagRelation(Schema schema, List<Row> rows)
extends Record
implements MaterializedRelation
A materialised relation whose rows are kept in a stable sorted order and
may contain duplicates — the
Sorted bag type in the IBM
flat-collection taxonomy (No Key, No Element Equality required, Sorted,
Multiple).
The sort order is determined externally by the SortNode executor,
which collects the input rows, applies a Comparator, and
stores the result here. The list is immutable after construction.
This is the natural output type for the SORT (τ) operator.
Downstream operators that consume a sorted relation (e.g. a LIMIT
applied after a SORT) receive a stream in the correct order without
any additional sorting.
-
Constructor Summary
ConstructorsConstructorDescriptionSortedBagRelation(Schema schema, List<Row> rows) Creates an instance of aSortedBagRelationrecord 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 SortedBagRelationFactory 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
-