@Override
  public Object getTransformedWritable(DeferredObject object) throws HiveException {
    Short value = (Short)columnType.getPrimitiveJavaObject(object.get());

    if(value != null) {
      Short transformedValue = transformer.transform(value);

      if(transformedValue != null) {
        writable.set(transformedValue);

        return writable;
      }
    }

    return null;
  }
Interface to be implemented by datatype specific adapters that handle necessary conversion of the transformed value
into appropriate Writable object, which GenericUDF.evaluate() is expected to return.
ql/src/java/org/apache/hadoop/hive/ql/udf/generic/BaseMaskUDF.java