public static void validateValueBoundaryExprType(ObjectInspector OI)
throws WindowingException
{
if (!OI.getCategory().equals(Category.PRIMITIVE))
{
throw new WindowingException(
"Value Boundary expression must be of primitve type");
}
PrimitiveObjectInspector pOI = (PrimitiveObjectInspector) OI;
PrimitiveCategory pC = pOI.getPrimitiveCategory();
switch (pC)
{
case BYTE:
case DOUBLE:
case FLOAT:
case INT:
case LONG:
case SHORT:
case TIMESTAMP:
break;
default:
throw new WindowingException(
sprintf("Primitve type %s not supported in Value Boundary expression",
pC));
}
}