scope = newScope; boolean isNullLiteral = SqlUtil.isNullLiteral(node, false); if ((node instanceof SqlDynamicParam) || isNullLiteral) { if (inferredType.equals(unknownType)) { if (!SqlUtil.isNullLiteral(caseCall.getElseOperand(), false)) { inferUnknownTypes( returnType,
targetRowType.getFieldList())) { if (!pair.right.getType().isNullable() && SqlUtil.isNullLiteral(pair.left, false)) { throw newValidationError(node, RESOURCE.columnNotNullable(pair.right.getName()));
@Override public boolean isOperandNull(int ordinal, boolean allowCast) { return SqlUtil.isNullLiteral(call.operand(ordinal), allowCast); }
@Override public boolean isOperandNull(int ordinal, boolean allowCast) { return SqlUtil.isNullLiteral(call.operand(ordinal), allowCast); }
/** * Returns whether a node represents the NULL value or a series of nested * <code>CAST(NULL AS type)</code> calls. For example: * <code>isNull(CAST(CAST(NULL as INTEGER) AS VARCHAR(1)))</code> * returns {@code true}. */ public static boolean isNull(SqlNode node) { return isNullLiteral(node, false) || node.getKind() == SqlKind.CAST && isNull(((SqlCall) node).operand(0)); }
/** * Returns whether a node represents the NULL value or a series of nested * <code>CAST(NULL AS type)</code> calls. For example: * <code>isNull(CAST(CAST(NULL as INTEGER) AS VARCHAR(1)))</code> * returns {@code true}. */ public static boolean isNull(SqlNode node) { return isNullLiteral(node, false) || node.getKind() == SqlKind.CAST && isNull(((SqlCall) node).operand(0)); }
if (SqlUtil.isNullLiteral(right, true)) { return null;
if (SqlUtil.isNullLiteral(right, true)) { return null;
final List<RexNode> exprList = new ArrayList<>(); for (int i = 0; i < whenList.size(); i++) { if (SqlUtil.isNullLiteral(whenList.get(i), false)) { exprList.add(rexBuilder.constantNull()); } else { exprList.add(cx.convertExpression(whenList.get(i))); if (SqlUtil.isNullLiteral(thenList.get(i), false)) { exprList.add(rexBuilder.constantNull()); } else { if (SqlUtil.isNullLiteral(call.getElseOperand(), false)) { exprList.add(rexBuilder.constantNull()); } else {
final List<RexNode> exprList = new ArrayList<>(); for (int i = 0; i < whenList.size(); i++) { if (SqlUtil.isNullLiteral(whenList.get(i), false)) { exprList.add(rexBuilder.constantNull()); } else { exprList.add(cx.convertExpression(whenList.get(i))); if (SqlUtil.isNullLiteral(thenList.get(i), false)) { exprList.add(rexBuilder.constantNull()); } else { if (SqlUtil.isNullLiteral(call.getElseOperand(), false)) { exprList.add(rexBuilder.constantNull()); } else {
callBinding.getValidator().deriveType( callBinding.getScope(), node)); if (SqlUtil.isNullLiteral(node, false)) { nullList.add(node); callBinding.getValidator().deriveType( callBinding.getScope(), caseCall.getElseOperand())); if (SqlUtil.isNullLiteral(elseOp, false)) { nullList.add(elseOp);
callBinding.getValidator().deriveType( callBinding.getScope(), node)); if (SqlUtil.isNullLiteral(node, false)) { nullList.add(node); callBinding.getValidator().deriveType( callBinding.getScope(), caseCall.getElseOperand())); if (SqlUtil.isNullLiteral(elseOp, false)) { nullList.add(elseOp);
if (SqlUtil.isNullLiteral(node, false)) { if (throwOnFailure) { throw callBinding.getValidator().newValidationError(node,
if (SqlUtil.isNullLiteral(node, false)) { if (throwOnFailure) { throw callBinding.getValidator().newValidationError(node,
public boolean checkSingleOperandType( SqlCallBinding callBinding, SqlNode node, boolean throwOnFailure) { if (SqlUtil.isNullLiteral(node, false)) { if (throwOnFailure) { throw callBinding.getValidator().newValidationError(node, RESOURCE.nullIllegal()); } else { return false; } } RelDataType type = callBinding.getValidator().deriveType( callBinding.getScope(), node); SqlTypeName typeName = type.getSqlTypeName(); // Pass type checking for operators if it's of type 'ANY'. if (typeName.getFamily() == SqlTypeFamily.ANY) { return true; } if (!family.getTypeNames().contains(typeName)) { if (throwOnFailure) { throw callBinding.newValidationSignatureError(); } return false; } return true; }
if (!SqlUtil.isNullLiteral(node, false)) { foundNotNull = true; if (!SqlUtil.isNullLiteral( caseCall.getElseOperand(), false)) {
if (!SqlUtil.isNullLiteral(node, false)) { foundNotNull = true; if (!SqlUtil.isNullLiteral( caseCall.getElseOperand(), false)) {
public boolean checkSingleOperandType( SqlCallBinding callBinding, SqlNode node, int iFormalOperand, boolean throwOnFailure) { Util.discard(iFormalOperand); if (SqlUtil.isNullLiteral(node, true)) { if (allowNull) { return true; } if (throwOnFailure) { throw callBinding.newError( RESOURCE.argumentMustNotBeNull( callBinding.getOperator().getName())); } return false; } if (!SqlUtil.isLiteral(node) && !SqlUtil.isLiteralChain(node)) { if (throwOnFailure) { throw callBinding.newError( RESOURCE.argumentMustBeLiteral( callBinding.getOperator().getName())); } return false; } return true; }
public boolean checkSingleOperandType( SqlCallBinding callBinding, SqlNode node, int iFormalOperand, boolean throwOnFailure) { Util.discard(iFormalOperand); if (SqlUtil.isNullLiteral(node, true)) { if (allowNull) { return true; } if (throwOnFailure) { throw callBinding.newError( RESOURCE.argumentMustNotBeNull( callBinding.getOperator().getName())); } return false; } if (!SqlUtil.isLiteral(node) && !SqlUtil.isLiteralChain(node)) { if (throwOnFailure) { throw callBinding.newError( RESOURCE.argumentMustBeLiteral( callBinding.getOperator().getName())); } return false; } return true; }
final SqlNode left = callBinding.operand(0); final SqlNode right = callBinding.operand(1); if (SqlUtil.isNullLiteral(left, false) || left instanceof SqlDynamicParam) { return true;