private List<RelDataType> collectOperandTypes( SqlValidator validator, SqlValidatorScope scope, SqlCall call) { List<RelDataType> argTypes = SqlTypeUtil.deriveAndCollectTypes( validator, scope, call.getOperandList()); return ImmutableNullableList.of( argTypes.get(VALUE_OPERAND), argTypes.get(LOWER_OPERAND), argTypes.get(UPPER_OPERAND)); }
private List<RelDataType> collectOperandTypes( SqlValidator validator, SqlValidatorScope scope, SqlCall call) { List<RelDataType> argTypes = SqlTypeUtil.deriveAndCollectTypes( validator, scope, call.getOperandList()); return ImmutableNullableList.of( argTypes.get(VALUE_OPERAND), argTypes.get(LOWER_OPERAND), argTypes.get(UPPER_OPERAND)); }
deriveAndCollectTypes(validator, scope, operands))) { if (throwOnFailure) { String msg = "";
deriveAndCollectTypes(validator, scope, operands))) { if (throwOnFailure) { String msg = "";
deriveAndCollectTypes(validator, scope, operands))) { if (throwOnFailure) { String msg = "";
public boolean checkOperandTypes( SqlCallBinding callBinding, boolean throwOnFailure) { final List<RelDataType> argTypes = SqlTypeUtil.deriveAndCollectTypes( callBinding.getValidator(), callBinding.getScope(), callBinding.operands()); if (argTypes.size() == 0) { throw callBinding.newValidationError(RESOURCE.mapRequiresTwoOrMoreArgs()); } if (argTypes.size() % 2 > 0) { throw callBinding.newValidationError(RESOURCE.mapRequiresEvenArgCount()); } final Pair<RelDataType, RelDataType> componentType = getComponentTypes( callBinding.getTypeFactory(), argTypes); if (null == componentType.left || null == componentType.right) { if (throwOnFailure) { throw callBinding.newValidationError(RESOURCE.needSameTypeParameter()); } return false; } return true; }
public boolean checkOperandTypes( SqlCallBinding callBinding, boolean throwOnFailure) { final List<RelDataType> argTypes = SqlTypeUtil.deriveAndCollectTypes( callBinding.getValidator(), callBinding.getScope(), callBinding.operands()); if (argTypes.size() == 0) { throw callBinding.newValidationError(RESOURCE.requireAtLeastOneArg()); } final RelDataType componentType = getComponentType( callBinding.getTypeFactory(), argTypes); if (null == componentType) { if (throwOnFailure) { throw callBinding.newValidationError(RESOURCE.needSameTypeParameter()); } return false; } return true; }
public boolean checkOperandTypes( SqlCallBinding callBinding, boolean throwOnFailure) { final List<RelDataType> argTypes = SqlTypeUtil.deriveAndCollectTypes( callBinding.getValidator(), callBinding.getScope(), callBinding.operands()); if (argTypes.size() == 0) { throw callBinding.newValidationError(RESOURCE.mapRequiresTwoOrMoreArgs()); } if (argTypes.size() % 2 > 0) { throw callBinding.newValidationError(RESOURCE.mapRequiresEvenArgCount()); } final Pair<RelDataType, RelDataType> componentType = getComponentTypes( callBinding.getTypeFactory(), argTypes); if (null == componentType.left || null == componentType.right) { if (throwOnFailure) { throw callBinding.newValidationError(RESOURCE.needSameTypeParameter()); } return false; } return true; }
public boolean checkOperandTypes( SqlCallBinding callBinding, boolean throwOnFailure) { final List<RelDataType> argTypes = SqlTypeUtil.deriveAndCollectTypes( callBinding.getValidator(), callBinding.getScope(), callBinding.operands()); if (argTypes.size() == 0) { throw callBinding.newValidationError(RESOURCE.requireAtLeastOneArg()); } final RelDataType componentType = getComponentType( callBinding.getTypeFactory(), argTypes); if (null == componentType) { if (throwOnFailure) { throw callBinding.newValidationError(RESOURCE.needSameTypeParameter()); } return false; } return true; }
public boolean checkOperandTypes( SqlCallBinding callBinding, boolean throwOnFailure) { final List<RelDataType> argTypes = SqlTypeUtil.deriveAndCollectTypes( callBinding.getValidator(), callBinding.getScope(), callBinding.operands()); final RelDataType componentType = getComponentType( callBinding.getTypeFactory(), argTypes); if (null == componentType) { if (throwOnFailure) { throw callBinding.newValidationError(RESOURCE.needSameTypeParameter()); } return false; } return true; }
public boolean checkOperandTypes( SqlCallBinding callBinding, boolean throwOnFailure) { final List<RelDataType> argTypes = SqlTypeUtil.deriveAndCollectTypes( callBinding.getValidator(), callBinding.getScope(), callBinding.operands()); final RelDataType componentType = getComponentType( callBinding.getTypeFactory(), argTypes); if (null == componentType) { if (throwOnFailure) { throw callBinding.newValidationError(RESOURCE.needSameTypeParameter()); } return false; } return true; }