return (long) intOI.getWritableConstantValue().get();
} else if(SMALLINT_TYPE_NAME.equals(typeName)) {
WritableConstantShortObjectInspector shortOI = (WritableConstantShortObjectInspector) numberOI;
return (long) shortOI.getWritableConstantValue().get();
} else if(TINYINT_TYPE_NAME.equals(typeName)) {
WritableConstantByteObjectInspector byteOI = (WritableConstantByteObjectInspector) numberOI;
return (long) byteOI.getWritableConstantValue().get();
}
throw new UDFArgumentException("Unexpected argument type to cast as long: "
+ TypeInfoUtils.getTypeInfoFromObjectInspector(numberOI));
}