protected void validateWhereOrOn( SqlValidatorScope scope, SqlNode condition, String clause) { validateNoAggs(aggOrOverOrGroupFinder, condition, clause); inferUnknownTypes( booleanType, scope, condition); condition.validate(this, scope); final RelDataType type = deriveType(scope, condition); if (!SqlTypeUtil.inBooleanFamily(type)) { throw newValidationError(condition, RESOURCE.condMustBeBoolean(clause)); } }
throw newValidationError(expand, RESOURCE.condMustBeBoolean("DEFINE"));
protected void validateWhereOrOn( SqlValidatorScope scope, SqlNode condition, String clause) { validateNoAggs(aggOrOverOrGroupFinder, condition, clause); inferUnknownTypes( booleanType, scope, condition); condition.validate(this, scope); final RelDataType type = deriveType(scope, condition); if (!SqlTypeUtil.inBooleanFamily(type)) { throw newValidationError(condition, RESOURCE.condMustBeBoolean(clause)); } }
protected void validateWhereOrOn( SqlValidatorScope scope, SqlNode condition, String clause) { validateNoAggs(aggOrOverOrGroupFinder, condition, clause); inferUnknownTypes( booleanType, scope, condition); condition.validate(this, scope); final RelDataType type = deriveType(scope, condition); if (!SqlTypeUtil.inBooleanFamily(type)) { throw newValidationError(condition, RESOURCE.condMustBeBoolean(clause)); } }
public void validateCall( SqlCall call, SqlValidator validator, SqlValidatorScope scope, SqlValidatorScope operandScope) { assert call.getOperator() == this; assert call.operandCount() == 2; SqlCall aggCall = call.operand(0); if (!aggCall.getOperator().isAggregator()) { throw validator.newValidationError(aggCall, RESOURCE.filterNonAggregate()); } final SqlNode condition = call.operand(1); validator.validateAggregateParams(aggCall, condition, scope); final RelDataType type = validator.deriveType(scope, condition); if (!SqlTypeUtil.inBooleanFamily(type)) { throw validator.newValidationError(condition, RESOURCE.condMustBeBoolean("FILTER")); } }
throw newValidationError(expand, RESOURCE.condMustBeBoolean("DEFINE"));
throw newValidationError(expand, RESOURCE.condMustBeBoolean("DEFINE"));
public void validateCall( SqlCall call, SqlValidator validator, SqlValidatorScope scope, SqlValidatorScope operandScope) { assert call.getOperator() == this; assert call.operandCount() == 2; SqlCall aggCall = getAggCall(call); if (!aggCall.getOperator().isAggregator()) { throw validator.newValidationError(aggCall, RESOURCE.filterNonAggregate()); } final SqlNode condition = call.operand(1); SqlNodeList orderList = null; if (hasWithinGroupCall(call)) { SqlCall withinGroupCall = getWithinGroupCall(call); orderList = withinGroupCall.operand(1); } validator.validateAggregateParams(aggCall, condition, orderList, scope); final RelDataType type = validator.deriveType(scope, condition); if (!SqlTypeUtil.inBooleanFamily(type)) { throw validator.newValidationError(condition, RESOURCE.condMustBeBoolean("FILTER")); } }