java.lang.Object
java.lang.Enum<RelOp>
org.apache.drill.exec.store.base.filter.RelOp
All Implemented Interfaces:
Serializable, Comparable<RelOp>

public enum RelOp extends Enum<RelOp>
Fixed set of Drill relational operators, using well-defined names. Distilled from the more general string function names used in the query plan tree.
  • Enum Constant Details

    • EQ

      public static final RelOp EQ
    • NE

      public static final RelOp NE
    • LT

      public static final RelOp LT
    • LE

      public static final RelOp LE
    • GE

      public static final RelOp GE
    • GT

      public static final RelOp GT
    • IS_NULL

      public static final RelOp IS_NULL
    • IS_NOT_NULL

      public static final RelOp IS_NOT_NULL
  • Method Details

    • values

      public static RelOp[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static RelOp valueOf(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:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null
    • invert

      public RelOp invert()
      Return the result of flipping the sides of an expression:
      a op bb op.invert() a
      Returns:
      a new relop resulting from flipping the sides of the expression, or this relop if the operation is symmetric.
    • argCount

      public int argCount()
      Returns the number of arguments for the relop.
      Returns:
      1 for IS (NOT) NULL, 2 otherwise
    • selectivity

      public double selectivity()
      Poor-man's guess at selectivity of each operator. Should match Calcite's built-in defaults. The Calcite estimates are not great, but we need to match them.

      If a query has access to metadata, then each predicates should have a computed selectivity based on that metadata. This mechanism should be extended to include that selectivity as a field, and pass it back from this method.

      Returns:
      crude estimate of operator selectivity