Enum RelOptUtil.Logic

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<RelOptUtil.Logic>
    Enclosing class:
    RelOptUtil

    public static enum RelOptUtil.Logic
    extends java.lang.Enum<RelOptUtil.Logic>
    Policies for handling two- and three-valued boolean logic.
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      FALSE
      An anti-semi-join will have been applied, so that only rows for which the value is FALSE will have been returned.
      TRUE
      A semi-join will have been applied, so that only rows for which the value is TRUE will have been returned.
      TRUE_FALSE
      Nulls are not possible.
      TRUE_FALSE_UNKNOWN
      Three-valued boolean logic.
      UNKNOWN_AS_FALSE
      Two-valued logic where UNKNOWN is treated as FALSE.
      UNKNOWN_AS_TRUE
      Two-valued logic where UNKNOWN is treated as TRUE.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private Logic()  
    • Enum Constant Detail

      • TRUE_FALSE_UNKNOWN

        public static final RelOptUtil.Logic TRUE_FALSE_UNKNOWN
        Three-valued boolean logic.
      • TRUE_FALSE

        public static final RelOptUtil.Logic TRUE_FALSE
        Nulls are not possible.
      • UNKNOWN_AS_FALSE

        public static final RelOptUtil.Logic UNKNOWN_AS_FALSE
        Two-valued logic where UNKNOWN is treated as FALSE.

        "x IS TRUE" produces the same result, and "WHERE x", "JOIN ... ON x" and "HAVING x" have the same effect.

      • UNKNOWN_AS_TRUE

        public static final RelOptUtil.Logic UNKNOWN_AS_TRUE
        Two-valued logic where UNKNOWN is treated as TRUE.

        "x IS FALSE" produces the same result, as does "WHERE NOT x", etc.

        In particular, this is the mode used by "WHERE k NOT IN q". If "k IN q" produces TRUE or UNKNOWN, "NOT k IN q" produces FALSE or UNKNOWN and the row is eliminated; if "k IN q" it returns FALSE, the row is retained by the WHERE clause.

      • TRUE

        public static final RelOptUtil.Logic TRUE
        A semi-join will have been applied, so that only rows for which the value is TRUE will have been returned.
      • FALSE

        public static final RelOptUtil.Logic FALSE
        An anti-semi-join will have been applied, so that only rows for which the value is FALSE will have been returned.

        Currently only used within LogicVisitor, to ensure that 'NOT (NOT EXISTS (q))' behaves the same as 'EXISTS (q)')

    • Constructor Detail

      • Logic

        private Logic()
    • Method Detail

      • values

        public static RelOptUtil.Logic[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (RelOptUtil.Logic c : RelOptUtil.Logic.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static RelOptUtil.Logic valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null