public boolean checkOperandTypes( SqlCallBinding callBinding, boolean throwOnFailure) { if (!super.checkOperandTypes(callBinding, throwOnFailure)) { return false; } return SAME_SAME.checkOperandTypes(callBinding, throwOnFailure); } };
return allowedRules.get(iFormalOperand).checkSingleOperandType( callBinding, node, 0, throwOnFailure); if (!rule.checkSingleOperandType( callBinding, node, rule.checkSingleOperandType( callBinding, node,
public String getAllowedSignatures(SqlOperator op, String opName) { if (composition == Composition.SEQUENCE) { throw Util.needToImplement("must override getAllowedSignatures"); } StringBuilder ret = new StringBuilder(); for (Ord<SqlSingleOperandTypeChecker> ord : Ord.zip(allowedRules)) { if (ord.i > 0) { ret.append(SqlOperator.NL); } ret.append(ord.e.getAllowedSignatures(op, opName)); if (composition == Composition.AND) { break; } } return ret.toString(); }
break label; if (!rule.checkSingleOperandType( callBinding, callBinding.getCall().operands[ord.i], if (!rule.checkOperandTypes(callBinding, false)) { typeErrorCount++;
public SqlOperandCountRange get(int index) { return allowedRules.get(index).getOperandCountRange(); }
break label; if (!rule.checkSingleOperandType( callBinding, callBinding.getCall().operand(ord.i), if (!rule.checkOperandTypes(callBinding, false)) { typeErrorCount++; if (composition == Composition.AND) {
public SqlOperandCountRange get(int index) { return allowedRules.get(index).getOperandCountRange(); }
return allowedRules.get(iFormalOperand).checkSingleOperandType( callBinding, node, 0, throwOnFailure); if (!rule.checkSingleOperandType( callBinding, node, rule.checkSingleOperandType( callBinding, node,
public boolean checkOperandTypes( SqlCallBinding callBinding, boolean throwOnFailure) { // check that the two operands are of same type. return OperandTypes.SAME_SAME.checkOperandTypes( callBinding, throwOnFailure) && super.checkOperandTypes(callBinding, throwOnFailure); } }
public String getAllowedSignatures(SqlOperator op, String opName) { if (composition == Composition.SEQUENCE) { throw Util.needToImplement("must override getAllowedSignatures"); } StringBuilder ret = new StringBuilder(); for (Ord<SqlSingleOperandTypeChecker> ord : Ord.zip(allowedRules)) { if (ord.i > 0) { ret.append(SqlOperator.NL); } ret.append(ord.e.getAllowedSignatures(op, opName)); if (composition == Composition.AND) { break; } } return ret.toString(); }
@Override public boolean checkOperandTypes( SqlCallBinding callBinding, boolean throwOnFailure) { if (!ARRAY_OR_MAP.checkSingleOperandType( callBinding, callBinding.getCall().operands[0], 0, throwOnFailure)) { return false; } final RelDataType operandType = callBinding.getOperandType(0); final SqlSingleOperandTypeChecker checker = getChecker(operandType); return checker.checkSingleOperandType( callBinding, callBinding.getCall().operands[1], 0, throwOnFailure); }
public boolean checkOperandTypes( SqlCallBinding callBinding, boolean throwOnFailure) { // check that the two operands are of same type. return SqlTypeStrategies.otcSameX2.checkOperandTypes( callBinding, throwOnFailure) && super.checkOperandTypes(callBinding, throwOnFailure); } }
int n = operands.size(); assert (3 == n) || (2 == n); if (!OperandTypes.STRING.checkSingleOperandType( callBinding, operands.get(0), if (!OperandTypes.NUMERIC.checkSingleOperandType( callBinding, operands.get(1), if (!OperandTypes.STRING.checkSingleOperandType( callBinding, operands.get(1), return false; if (!OperandTypes.STRING.checkSingleOperandType( callBinding, operands.get(2), if (!OperandTypes.NUMERIC.checkSingleOperandType( callBinding, operands.get(1), if (!OperandTypes.NUMERIC.checkSingleOperandType( callBinding, operands.get(2),
public boolean checkOperandTypes( SqlCallBinding callBinding, boolean throwOnFailure) { if (!super.checkOperandTypes(callBinding, throwOnFailure)) { return false; } if (!otcSameX2.checkOperandTypes( callBinding, throwOnFailure)) { return false; } return true; } };
@Override public boolean checkOperandTypes( SqlCallBinding callBinding, boolean throwOnFailure) { final SqlNode left = callBinding.getCall().operand(0); final SqlNode right = callBinding.getCall().operand(1); if (!ARRAY_OR_MAP.checkSingleOperandType(callBinding, left, 0, throwOnFailure)) { return false; } final RelDataType operandType = callBinding.getOperandType(0); final SqlSingleOperandTypeChecker checker = getChecker(operandType); return checker.checkSingleOperandType(callBinding, right, 0, throwOnFailure); }
public boolean checkOperandTypes( SqlCallBinding callBinding, boolean throwOnFailure) { switch (callBinding.getOperandCount()) { case 2: if (!OperandTypes.STRING_SAME_SAME.checkOperandTypes( callBinding, throwOnFailure)) { return false; } break; case 3: if (!OperandTypes.STRING_SAME_SAME_SAME.checkOperandTypes( callBinding, throwOnFailure)) { return false; } // calc implementation should // enforce the escape character length to be 1 break; default: throw Util.newInternal( "unexpected number of args to " + callBinding.getCall()); } return SqlTypeUtil.isCharTypeComparable( callBinding, callBinding.getCall().getOperandList(), throwOnFailure); }
if (!SqlTypeStrategies.otcString.checkSingleOperandType( callBinding, call.operands[0], if (!SqlTypeStrategies.otcNumeric.checkSingleOperandType( callBinding, call.operands[1], if (!SqlTypeStrategies.otcString.checkSingleOperandType( callBinding, call.operands[1], if (!SqlTypeStrategies.otcString.checkSingleOperandType( callBinding, call.operands[2], if (!SqlTypeStrategies.otcNumeric.checkSingleOperandType( callBinding, call.operands[1], if (!SqlTypeStrategies.otcNumeric.checkSingleOperandType( callBinding, call.operands[2],
if (!SqlTypeStrategies.otcStringSameX2.checkOperandTypes( callBinding, throwOnFailure)) if (!SqlTypeStrategies.otcStringSameX3.checkOperandTypes( callBinding, throwOnFailure))
public boolean checkOperandTypes( SqlCallBinding callBinding, boolean throwOnFailure) { SqlCall call = callBinding.getCall(); for (int i = 0; i < 2; i++) { if (!SqlTypeStrategies.otcString.checkSingleOperandType( callBinding, call.operands[i], 0, throwOnFailure)) { if (throwOnFailure) { throw callBinding.newValidationSignatureError(); } return false; } } return SqlTypeUtil.isCharTypeComparable( callBinding, call.operands, throwOnFailure); } }
int iFormalOperand, boolean throwOnFailure) { if (!LITERAL.checkSingleOperandType( callBinding, node,