Enum Class Boundedness

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

public enum Boundedness extends Enum<Boundedness>
Whether a relation is guaranteed finite — a logical property propagated bottom-up over a RelNode tree.

The three values form a lattice ordered by "how unbounded":

 BOUNDED  <  UNKNOWN  <  UNBOUNDED 
  • BOUNDED — provably finite (files, database tables, inline and catalog relations, finite generators).
  • UNKNOWN — finiteness cannot be proven either way. The safety check does not reject UNKNOWN — only what is provably UNBOUNDED.
  • UNBOUNDED — provably infinite (an unbounded generator such as Naturals or Primes, or a streaming source). No operator or default ever produces UNBOUNDED; it originates only at a leaf and propagates upward (the "contagious-only" invariant), so a tree whose leaves are all bounded is itself provably bounded.

This boundedness property is distinct from cardinality: an honestly unknown row count (a JDBC table without statistics) is still BOUNDED, not UNKNOWN.

  • Enum Constant Details

    • BOUNDED

      public static final Boundedness BOUNDED
      Provably finite.
    • UNKNOWN

      public static final Boundedness UNKNOWN
      Finiteness cannot be proven; conservatively allowed (not rejected).
    • UNBOUNDED

      public static final Boundedness UNBOUNDED
      Provably infinite.
  • Method Details

    • values

      public static Boundedness[] 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 Boundedness 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
    • lub

      public Boundedness lub(Boundedness other)
      The least upper bound of this and other — the boundedness of an operator combining inputs of these boundednesses. Because the lattice is a total order, this is the more-unbounded of the two (so any unbounded input makes the combination unbounded; the contagious-only invariant).
      Parameters:
      other - the other boundedness; must not be null
      Returns:
      the more-unbounded of the two