Enum RelOp
- All Implemented Interfaces:
Serializable
,Comparable<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 Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
argCount()
Returns the number of arguments for the relop.invert()
Return the result of flipping the sides of an expression:a op b
→b op.invert() a
double
Poor-man's guess at selectivity of each operator.static RelOp
Returns the enum constant of this type with the specified name.static RelOp[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
EQ
-
NE
-
LT
-
LE
-
GE
-
GT
-
IS_NULL
-
IS_NOT_NULL
-
-
Method Details
-
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
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 nameNullPointerException
- if the argument is null
-
invert
Return the result of flipping the sides of an expression:a op b
→b 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
-