static AbstractTransformerAdapter getTransformerAdapter(PrimitiveObjectInspector columnType, AbstractTransformer transformer) {
    final AbstractTransformerAdapter ret;

    switch(columnType.getPrimitiveCategory()) {
      case STRING:
        ret = new StringTransformerAdapter((StringObjectInspector)columnType, transformer);
        break;

      case CHAR:
        ret = new HiveCharTransformerAdapter((HiveCharObjectInspector)columnType, transformer);
        break;

      case VARCHAR:
        ret = new HiveVarcharTransformerAdapter((HiveVarcharObjectInspector)columnType, transformer);
        break;

      case BYTE:
        ret = new ByteTransformerAdapter((ByteObjectInspector)columnType, transformer);
        break;

      case SHORT:
        ret = new ShortTransformerAdapter((ShortObjectInspector)columnType, transformer);
        break;

      case INT:
        ret = new IntegerTransformerAdapter((IntObjectInspector)columnType, transformer);
        break;

      case LONG:
        ret = new LongTransformerAdapter((LongObjectInspector)columnType, transformer);
        break;

      case DATE:
        ret = new DateTransformerAdapter((DateObjectInspector)columnType, transformer);
        break;

      default:
        ret = new UnsupportedDatatypeTransformAdapter(columnType, transformer);
        break;
    }

    return ret;
  }
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