java.lang.Object
java.lang.Record
com.darkcollective.relix.processor.exec.BagRelation
Record Components:
schema - the schema shared by all rows; never null
rows - 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

    Constructors
    Constructor
    Description
    BagRelation(Schema schema, List<Row> rows)
    Creates an instance of a BagRelation record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    of(Schema schema, List<Row> rows)
    Factory that accepts a mutable list and stores a defensive copy.
    Returns the value of the rows record component.
    Returns the value of the schema record component.
    Returns a lazy stream over all rows in this relation.
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • BagRelation

      public BagRelation(Schema schema, List<Row> rows)
      Creates an instance of a BagRelation record class.
      Parameters:
      schema - the value for the schema record component
      rows - the value for the rows record component
  • Method Details

    • of

      public static BagRelation of(Schema schema, List<Row> rows)
      Factory that accepts a mutable list and stores a defensive copy.
    • stream

      public Stream<Row> stream()
      Description copied from interface: MaterializedRelation
      Returns a lazy stream over all rows in this relation. The stream may be consumed exactly once.
      Specified by:
      stream in interface MaterializedRelation
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • schema

      public Schema schema()
      Returns the value of the schema record component.
      Specified by:
      schema in interface MaterializedRelation
      Returns:
      the value of the schema record component
    • rows

      public List<Row> rows()
      Returns the value of the rows record component.
      Returns:
      the value of the rows record component