private static Converter getConverterForPrimitiveOutput(ObjectInspector inputOI, 
                                                          PrimitiveObjectInspector outputOI) {
    switch (inputOI.getCategory()) {
      case PRIMITIVE:
        return getConverter((PrimitiveObjectInspector) inputOI, outputOI);
      case STRUCT:
      case LIST:
      case MAP:
      case UNION:
        return new TextConverterForComplexTypes(inputOI);
      default:
        throw new RuntimeException("Hive internal error: conversion of "
            + inputOI.getTypeName() + " to " + outputOI.getTypeName()
            + " not supported yet.");
    }
  }
Returns a converter that converts objects from one OI to another OI. The
returned (converted) object belongs to this converter, so that it can be
reused across different calls.
serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/ObjectInspectorConverters.java