Package org.apache.calcite.plan
Class Strong
java.lang.Object
org.apache.calcite.plan.Strong
Utilities for strong predicates.
A predicate is strong (or null-rejecting) with regard to selected subset of inputs if it is UNKNOWN if all inputs in selected subset are UNKNOWN.
By the way, UNKNOWN is just the boolean form of NULL.
Examples:
UNKNOWNis strong in [] (definitely null)c = 1is strong in [c] (definitely null if and only if c is null)c IS NULLis not strong (always returns TRUE or FALSE, never null)p1 AND p2is strong in [p1, p2] (definitely null if either p1 is null or p2 is null)p1 OR p2is strong if p1 and p2 are strong
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumHow whether an operator's operands are null affects whether a call to that operator evaluates to null. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanReturns whether all expressions in a list are strong.booleanReturns whether the analyzed expression will definitely not return true (equivalently, will definitely return null or false).static booleanisNotTrue(RexNode node, ImmutableBitSet nullColumns) Returns whether the analyzed expression will definitely not return true (equivalently, will definitely return null or false) if all of a given set of input columns are null.booleanisNull(RexFieldAccess ref) Returns whether a given field is definitely null.booleanisNull(RexInputRef ref) Returns whether a given input is definitely null.booleanReturns whether an expression is definitely null.static booleanisNull(RexNode node, ImmutableBitSet nullColumns) Returns whether the analyzed expression will definitely return null if all of a given set of input columns are null.static booleanReturns whether a given expression is strong.static Strongof(com.google.common.collect.ImmutableSet<RexFieldAccess> nullFields) Returns a checker that consults a set to find out whether particular field may be null.static Strongof(ImmutableBitSet nullColumns) Returns a checker that consults a bit set to find out whether particular inputs may be null.static Strong.PolicyReturns how to deduce whether a particularRexNodeexpression is null, given whether its arguments are null.static Strong.PolicyDeprecated.static Strong.Policypolicy(SqlOperator operator) Returns how to deduce whether a particularSqlOperatorexpression is null, given whether its arguments are null.
-
Constructor Details
-
Strong
public Strong()
-
-
Method Details
-
of
Returns a checker that consults a bit set to find out whether particular inputs may be null. -
of
Returns a checker that consults a set to find out whether particular field may be null. -
isNull
Returns whether the analyzed expression will definitely return null if all of a given set of input columns are null. -
isNotTrue
Returns whether the analyzed expression will definitely not return true (equivalently, will definitely return null or false) if all of a given set of input columns are null. -
policy
Deprecated.Returns how to deduce whether a particular kind of expression is null, given whether its arguments are null. -
policy
Returns how to deduce whether a particularRexNodeexpression is null, given whether its arguments are null. -
policy
Returns how to deduce whether a particularSqlOperatorexpression is null, given whether its arguments are null. -
isStrong
Returns whether a given expression is strong.Examples:
- Returns true for
c = 1since it returns null if and only if c is null - Returns false for
c IS NULLsince it always returns TRUE or FALSE
- Parameters:
e- Expression- Returns:
- true if the expression is strong, false otherwise
- Returns true for
-
allStrong
Returns whether all expressions in a list are strong. -
isNotTrue
Returns whether the analyzed expression will definitely not return true (equivalently, will definitely return null or false). -
isNull
Returns whether an expression is definitely null.The answer is based on calls to
isNull(org.apache.calcite.rex.RexNode, org.apache.calcite.util.ImmutableBitSet)for its constituent expressions, and you may override methods to test hypotheses such as "ifxis null, isx + ynull? -
isNull
Returns whether a given input is definitely null. -
isNull
Returns whether a given field is definitely null.
-
policy(RexNode)orpolicy(SqlOperator)