Interface MaterializedRelation

All Known Implementing Classes:
BagRelation, IndexedRelation, SetRelation, SortedBagRelation

public sealed interface MaterializedRelation permits BagRelation, SetRelation, SortedBagRelation, IndexedRelation
A relation that has been fully materialised into an in-memory collection.

This sealed hierarchy maps the IBM collection taxonomy to the collection types produced by the relational algebra operators that require full materialisation:

  • BagRelation — unordered, allows duplicates (join output, UNION ALL).
  • SetRelation — unordered, unique rows by value equality (DISTINCT, UNION, INTERSECTION, DIFFERENCE).
  • SortedBagRelation — sorted, allows duplicates (SORT).
  • IndexedRelation — rows partitioned by a group key; primary build structure for aggregation and hash joins.

Callers obtain a lazy Stream<Row> view via stream(); the stream may be consumed exactly once and need not be closed (the underlying collection holds the data).

  • Method Summary

    Modifier and Type
    Method
    Description
    The schema shared by every row in this relation.
    Returns a lazy stream over all rows in this relation.
  • Method Details

    • schema

      Schema schema()
      The schema shared by every row in this relation.
    • stream

      Stream<Row> stream()
      Returns a lazy stream over all rows in this relation. The stream may be consumed exactly once.