Enum Class MaterializationMode

java.lang.Object
java.lang.Enum<MaterializationMode>
com.darkcollective.relix.ast.MaterializationMode
All Implemented Interfaces:
Serializable, Comparable<MaterializationMode>, Constable

public enum MaterializationMode extends Enum<MaterializationMode>
Describes the output materialisation strategy of a relational algebra node.

Most operators produce a lazy Stream<Row> pipeline with no intermediate collection (STREAM). A subset must accumulate all output rows before the first result can be emitted; these are annotated with one of the three materialising modes.

  • STREAM — lazy pipeline; no intermediate collection required. This is the default for selection, projection, rename, limit, distinct, and all join variants.
  • BAG — all rows are collected into an ordered bag before output. Used by: aggregation (γ), union-all (⊎), division (÷), and full outer join (⟗).
  • SET — all rows are collected and deduplicated before output. Used by: union (∪), intersection (∩), and difference (−).
  • SORTED — all rows are collected then sorted before output. Used by: sort (τ).

The mode is surfaced in the IR report as a bracketed tag appended to the node label — [bag], [set], or [sort] — so that potentially expensive materialisation steps are immediately visible when inspecting an expression tree. STREAM nodes carry no tag.

See Also:
  • Enum Constant Details

    • STREAM

      public static final MaterializationMode STREAM
      Lazy pipeline — no intermediate collection. The node's output is a Java Stream that pulls rows on demand.
    • BAG

      public static final MaterializationMode BAG
      Materialised bag — all output rows are collected into an ordered list before the first row is returned. Allows duplicates.
    • SET

      public static final MaterializationMode SET
      Materialised set — all output rows are collected and deduplicated before the first row is returned.
    • SORTED

      public static final MaterializationMode SORTED
      Materialised sorted bag — all output rows are collected and then sorted before the first row is returned.
  • Method Details

    • values

      public static MaterializationMode[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static MaterializationMode valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null