+ arguments.length);
}
try {
argumentOI = (PrimitiveObjectInspector) arguments[0];
} catch (ClassCastException e) {
throw new UDFArgumentException(
"The function BINARY takes only primitive types");
}
if (!((argumentOI instanceof BinaryObjectInspector)
|| (argumentOI instanceof StringObjectInspector)
|| (argumentOI instanceof VoidObjectInspector))){
throw new UDFArgumentException("Only string or binary data can be cast into binary " +
"data types.");
}
baConverter = new BinaryConverter(argumentOI,
PrimitiveObjectInspectorFactory.writableBinaryObjectInspector);
return PrimitiveObjectInspectorFactory.writableBinaryObjectInspector;