// if this is a range spec check and make sure the boundary type
// and order by type are compatible
if (orderTypeFam != null && !isRows) {
RelDataType bndType = validator.deriveType(scope, boundVal);
SqlTypeFamily bndTypeFam = bndType.getSqlTypeName().getFamily();
switch (orderTypeFam) {
case NUMERIC:
if (SqlTypeFamily.NUMERIC != bndTypeFam) {
throw validator.newValidationError(boundVal,
RESOURCE.orderByRangeMismatch());