/** * Returns whether a node represents the NULL value or a series of nested CAST(NULL as <TYPE>) * calls<br> * For Example:<br> * isNull(CAST(CAST(NULL as INTEGER) AS VARCHAR(1))) returns true */ public static boolean isNull(RexNode node) { /* Checks to see if the RexNode is null */ return RexLiteral.isNullLiteral(node) || ((node.getKind() == RexKind.Cast) && isNull(((RexCall) node).operands[0])); }