private static void validateValueBoundaryExprType(ObjectInspector OI)
      throws SemanticException {
    if (!OI.getCategory().equals(Category.PRIMITIVE)) {
      throw new SemanticException(
          String.format(
              "Value Boundary expression must be of primitive type. Found: %s",
              OI.getTypeName()));
    }

    PrimitiveObjectInspector pOI = (PrimitiveObjectInspector) OI;
    PrimitiveCategory pC = pOI.getPrimitiveCategory();

    switch (pC)
    {
    case BOOLEAN:
    case BYTE:
    case DOUBLE:
    case FLOAT:
    case INT:
    case LONG:
    case SHORT:
    case DECIMAL:
    case TIMESTAMP:
    case TIMESTAMPLOCALTZ:
    case DATE:
    case STRING:
    case VARCHAR:
    case CHAR:
      break;
    default:
      throw new SemanticException(
          String.format("Primitive type %s not supported in Value Boundary expression",
              pC));
    }

  }
Collect order expressions for RANGE based windowing
@throws SemanticException
ql/src/java/org/apache/hadoop/hive/ql/parse/PTFTranslator.java