validator.setValidatedNodeType( list, multisetType.getComponentType());
public RelDataType deriveType( SqlValidator validator, SqlValidatorScope scope, SqlCall call) { // Override SqlFunction.deriveType, because function-resolution is // not relevant to a JDBC function call. // REVIEW: jhyde, 2006/4/18: Should SqlJdbcFunctionCall even be a // subclass of SqlFunction? for (SqlNode operand : call.operands) { RelDataType nodeType = validator.deriveType(scope, operand); validator.setValidatedNodeType(operand, nodeType); } return validateOperands(validator, scope, call); }
public RelDataType deriveType( SqlValidator validator, SqlValidatorScope scope, SqlCall call) { // Override SqlFunction.deriveType, because function-resolution is // not relevant to a JDBC function call. // REVIEW: jhyde, 2006/4/18: Should SqlJdbcFunctionCall even be a // subclass of SqlFunction? for (SqlNode operand : call.getOperandList()) { RelDataType nodeType = validator.deriveType(scope, operand); validator.setValidatedNodeType(operand, nodeType); } return validateOperands(validator, scope, call); }
validator.setValidatedNodeType(call, ret); validator.setValidatedNodeType(agg, ret); return ret;
validator.setValidatedNodeType( list, multisetType.getComponentType());
validator.setValidatedNodeType( list, multisetType.getComponentType());
/** * Validates the operands of a call, inferring the return type in the * process. * * @param validator active validator * @param scope validation scope * @param call call to be validated * @return inferred type */ public final RelDataType validateOperands( SqlValidator validator, SqlValidatorScope scope, SqlCall call) { // Let subclasses know what's up. preValidateCall(validator, scope, call); // Check the number of operands checkOperandCount(validator, operandTypeChecker, call); SqlCallBinding opBinding = new SqlCallBinding(validator, scope, call); checkOperandTypes( opBinding, true); // Now infer the result type. RelDataType ret = inferReturnType(opBinding); validator.setValidatedNodeType(call, ret); return ret; }
/** * Validates the operands of a call, inferring the return type in the * process. * * @param validator active validator * @param scope validation scope * @param call call to be validated * * @return inferred type */ public final RelDataType validateOperands( SqlValidator validator, SqlValidatorScope scope, SqlCall call) { // Let subclasses know what's up. preValidateCall(validator, scope, call); // Check the number of operands checkOperandCount(validator, operandTypeChecker, call); SqlCallBinding opBinding = new SqlCallBinding(validator, scope, call); checkOperandTypes( opBinding, true); // Now infer the result type. RelDataType ret = inferReturnType(opBinding); validator.setValidatedNodeType(call, ret); return ret; }
callBinding.getValidator().setValidatedNodeType(node, ret);
callBinding.getValidator().setValidatedNodeType(node, ret);
public RelDataType inferReturnType( SqlOperatorBinding opBinding) { assert (opBinding.getOperandCount() == 2); RelDataType ret = opBinding.getOperandType(1); RelDataType firstType = opBinding.getOperandType(0); ret = opBinding.getTypeFactory().createTypeWithNullability( ret, firstType.isNullable()); if (opBinding instanceof SqlCallBinding) { SqlCallBinding callBinding = (SqlCallBinding) opBinding; SqlNode operand0 = callBinding.getCall().operands[0]; // dynamic parameters and null constants need their types assigned // to them using the type they are casted to. if (((operand0 instanceof SqlLiteral) && (((SqlLiteral) operand0).getValue() == null)) || (operand0 instanceof SqlDynamicParam)) { callBinding.getValidator().setValidatedNodeType( operand0, ret); } } return ret; }
validator.setValidatedNodeType( nodeList, rightType);
public RelDataType inferReturnType( SqlOperatorBinding opBinding) { assert opBinding.getOperandCount() == 2; RelDataType ret = opBinding.getOperandType(1); RelDataType firstType = opBinding.getOperandType(0); ret = opBinding.getTypeFactory().createTypeWithNullability( ret, firstType.isNullable()); if (opBinding instanceof SqlCallBinding) { SqlCallBinding callBinding = (SqlCallBinding) opBinding; SqlNode operand0 = callBinding.getCall().operand(0); // dynamic parameters and null constants need their types assigned // to them using the type they are casted to. if (((operand0 instanceof SqlLiteral) && (((SqlLiteral) operand0).getValue() == null)) || (operand0 instanceof SqlDynamicParam)) { callBinding.getValidator().setValidatedNodeType( operand0, ret); } } return ret; }
validator.setValidatedNodeType( nodeList, rightType);
nodeType = validator.deriveType(operandScope, operand); validator.setValidatedNodeType(operand, nodeType); argTypeBuilder.add(nodeType);
nodeType = validator.deriveType(operandScope, operands[i]); validator.setValidatedNodeType(operands[i], nodeType); argTypes[i] = nodeType;