Class Quantifier

  • All Implemented Interfaces:
    Bindable
    Direct Known Subclasses:
    Quantifier.Existential, Quantifier.ForEach, Quantifier.Physical

    public abstract class Quantifier
    extends Object
    implements Bindable
    Models the concept of quantification.

    A quantifier describes the data flow between the output of one RelationalExpression R and the consumption of that data by another RelationalExpression S. S is said to own the quantifier, while the quantifier is said to range over R. Quantifiers come in very few but very distinct flavors. All flavors are implemented by static inner final classes in order to emulate a sealed trait.

    Quantifiers separate what it means to be producing versus consuming items. The expression a quantifier ranges over produces records, the quantifier flows information (in a manner determined by the flavor) that is consumed by the expression containing or owning the quantifier. That expression can consume the data in a way independent of how the data was produced in the first place.

    A quantifier works closely with the expression that owns it. Depending on the semantics of the owning expression it becomes possible to model correlations. For example, in a logical join expression the quantifier can provide a binding of the item being currently consumed by the join's outer to other (inner) parts of the data flow that are also rooted at the owning (join) expression.

    • Constructor Detail

      • Quantifier

        public Quantifier()
    • Method Detail

      • physical

        @Nonnull
        public static Quantifier.Physical physical​(@Nonnull
                                                   RecordQueryPlan rangesOverPlan)
        Factory method to create a physical quantifier over newly created expression reference containing the given record plan.
        Parameters:
        rangesOverPlan - RecordQueryPlan the new quantifier should range over.
        Returns:
        a physical quantifier ranging over a new expression reference containing the given expression reference
      • getShorthand

        @Nonnull
        public abstract String getShorthand()
        Return a short hand string for the quantifier. As a quantifier's semantics is usually quite subtle and should not distract from expressions. For example, when a data flow is visualized the returned string should be short.
        Returns:
        a short string representing the quantifier.
      • acceptPropertyVisitor

        @Nullable
        public <U> U acceptPropertyVisitor​(@Nonnull
                                           PlannerProperty<U> visitor)
        Allow the computation of PlannerPropertys across the quantifiers in the data flow graph.
        Type Parameters:
        U - the type of the property being computed
        Parameters:
        visitor - the planner property that is being computed
        Returns:
        the property
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object