Record Class UniversalNode

java.lang.Object
java.lang.Record
com.darkcollective.relix.ast.UniversalNode
Record Components:
groupingAttributes - the attributes to group by; empty for the whole-relation truth form
predicate - the condition every row of a group must satisfy; never null
input - the source relation; never null
location - the source location of this node; never null
All Implemented Interfaces:
RelNode

public record UniversalNode(List<String> groupingAttributes, Predicate predicate, RelNode input, SourceLocation location) extends Record implements RelNode
Group-wise universal quantification (∀) — partitions input by the groupingAttributes and keeps the grouping-key tuple of each group in which every row satisfies predicate.

This is the "every row of the group satisfies P" operation that SQL forces into the NOT EXISTS (… NOT P) double-negation — for example, "customers all of whose orders are completed":

∀ customer_id : status = "completed" (Orders)

Strict NULL semantics: a row whose predicate evaluates to UNKNOWN counts as not-satisfied and disqualifies its group (the NOT EXISTS reading, not bool_and).

The output schema is the grouping-key columns only (member rows are recovered with a semi-join back). With no grouping attributes the operator is the whole-relation form ∀ : P (R) — "does every row of R satisfy P?" — whose output is the nullary truth relation (the empty schema, Schema.empty() — relix-symbol, which this module deliberately does not depend on, hence no link): one empty tuple when every row satisfies P (vacuously true on an empty input), no tuple otherwise.

  • Constructor Details

  • Method Details

    • accept

      public <R> R accept(RelNodeVisitor<R> visitor)
      Specified by:
      accept in interface RelNode
    • 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.
    • groupingAttributes

      public List<String> groupingAttributes()
      Returns the value of the groupingAttributes record component.
      Returns:
      the value of the groupingAttributes record component
    • predicate

      public Predicate predicate()
      Returns the value of the predicate record component.
      Returns:
      the value of the predicate record component
    • input

      public RelNode input()
      Returns the value of the input record component.
      Returns:
      the value of the input record component
    • location

      public SourceLocation location()
      Returns the value of the location record component.
      Specified by:
      location in interface RelNode
      Returns:
      the value of the location record component