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)
| 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. |