public void inferOperandTypes(
            SqlCallBinding callBinding,
            RelDataType returnType,
            RelDataType[] operandTypes) {
          final RelDataType unknownType =
              callBinding.getValidator().getUnknownType();
          RelDataType knownType = unknownType;
          for (int i = 1; i < callBinding.getCall().getOperandList().size(); i++) {
            SqlNode operand = callBinding.getCall().getOperandList().get(i);
            knownType = callBinding.getValidator().deriveType(
                callBinding.getScope(), operand);
            if (!knownType.equals(unknownType)) {
              break;
            }
          }

          RelDataTypeFactory typeFactory = callBinding.getTypeFactory();
          operandTypes[0] = typeFactory.createSqlType(SqlTypeName.BOOLEAN);
          for (int i = 1; i < operandTypes.length; ++i) {
            operandTypes[i] = knownType;
          }
        }
Operand type-inference strategy where an unknown operand type is derived
from the first operand with a known type, but the first operand is a boolean.
ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/reloperators/HiveBetween.java