throw new UDFArgumentException("argument must be a constant value: "
+ TypeInfoUtils.getTypeInfoFromObjectInspector(numberOI));
}
String typeName = numberOI.getTypeName();
if(BIGINT_TYPE_NAME.equals(typeName)) {
WritableConstantLongObjectInspector longOI = (WritableConstantLongObjectInspector) numberOI;
return longOI.getWritableConstantValue().get();
} else if(INT_TYPE_NAME.equals(typeName)) {
WritableConstantIntObjectInspector intOI = (WritableConstantIntObjectInspector) numberOI;
return (long) intOI.getWritableConstantValue().get();
} else if(SMALLINT_TYPE_NAME.equals(typeName)) {
WritableConstantShortObjectInspector shortOI = (WritableConstantShortObjectInspector) numberOI;