MCPcopy Create free account
hub / github.com/apache/calcite / isNull

Method isNull

core/src/main/java/org/apache/calcite/rex/RexUtil.java:214–223  ·  view source on GitHub ↗

Returns whether a node represents the NULL value or a series of nested CAST(NULL AS type) calls. For example: isNull(CAST(CAST(NULL as INTEGER) AS VARCHAR(1))) returns true.

(RexNode expr)

Source from the content-addressed store, hash-verified

212 * returns {@code true}.
213 */
214 public static boolean isNull(RexNode expr) {
215 switch (expr.getKind()) {
216 case LITERAL:
217 return ((RexLiteral) expr).getValue2() == null;
218 case CAST:
219 return isNull(((RexCall) expr).operands.get(0));
220 default:
221 return false;
222 }
223 }
224
225 /**
226 * Returns whether a node represents a {@link SqlTypeName#SYMBOL} literal.

Callers 12

checkUnknownAsMethod · 0.95
visitLiteralMethod · 0.95
simplifyIsNullMethod · 0.95
simplifyCoalesceMethod · 0.95
getPredicatesMethod · 0.95
simplifyMethod · 0.45
simplifyIsNotNullMethod · 0.45
makeAbstractCastMethod · 0.45
rewriteSomeMethod · 0.45
rewriteInMethod · 0.45
isStrongMethod · 0.45

Calls 3

getValue2Method · 0.80
getMethod · 0.65
getKindMethod · 0.45

Tested by 1

checkUnknownAsMethod · 0.76