Record Class QueryRelationSymbol

java.lang.Object
java.lang.Record
com.darkcollective.relix.symbol.relation.QueryRelationSymbol
Record Components:
namespace - the namespace this symbol belongs to; must not be blank
declaredName - the name as written by the user; must not be blank
provenance - built-in or user-defined; must not be null
shadowPolicy - replacement policy for this symbol; must not be null
schema - the structural description of the result relation; must not be null
body - the relational algebra expression defining this relation; must not be null
All Implemented Interfaces:
RelationSymbol, Symbol

public record QueryRelationSymbol(String namespace, String declaredName, Provenance provenance, ShadowPolicy shadowPolicy, Schema schema, RelNode body) extends Record implements RelationSymbol
A named relational algebra expression — essentially a stored view.

The body is a RelNode representing the relational algebra expression that defines this relation. It is stored for later semantic analysis, optimisation, and pretty-printing; no evaluation takes place at registration time.

A QueryRelationSymbol is typically produced by the relix-lang parser when it encounters an assignment of the form:

   ActiveUsers := { σ status = "active" (Users) };
 

The Schema represents the declared output schema. If the schema cannot be determined statically from the body, callers may omit explicit typing by using ScalarType.ANY for all columns.

  • Constructor Details

    • QueryRelationSymbol

      public QueryRelationSymbol(String namespace, String declaredName, Provenance provenance, ShadowPolicy shadowPolicy, Schema schema, RelNode body)
      Creates an instance of a QueryRelationSymbol record class.
      Parameters:
      namespace - the value for the namespace record component
      declaredName - the value for the declaredName record component
      provenance - the value for the provenance record component
      shadowPolicy - the value for the shadowPolicy record component
      schema - the value for the schema record component
      body - the value for the body record component
  • Method Details

    • of

      public static QueryRelationSymbol of(String name, Schema schema, RelNode body)
      Creates a user-defined query relation in the "default" namespace with ShadowPolicy.PERMITTED.
      Parameters:
      name - the relation name; must not be blank
      schema - the declared output schema; must not be null
      body - the relational algebra expression; must not be null
      Returns:
      a new QueryRelationSymbol
    • 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.
    • namespace

      public String namespace()
      Returns the value of the namespace record component.
      Specified by:
      namespace in interface Symbol
      Returns:
      the value of the namespace record component
    • declaredName

      public String declaredName()
      Returns the value of the declaredName record component.
      Specified by:
      declaredName in interface Symbol
      Returns:
      the value of the declaredName record component
    • provenance

      public Provenance provenance()
      Returns the value of the provenance record component.
      Specified by:
      provenance in interface Symbol
      Returns:
      the value of the provenance record component
    • shadowPolicy

      public ShadowPolicy shadowPolicy()
      Returns the value of the shadowPolicy record component.
      Specified by:
      shadowPolicy in interface Symbol
      Returns:
      the value of the shadowPolicy record component
    • schema

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

      public RelNode body()
      Returns the value of the body record component.
      Returns:
      the value of the body record component