static Object convertPrimitive(Object val, PrimitiveObjectInspector poi) {
    switch (poi.getPrimitiveCategory()) {
    // Save char/varchar as string
    case CHAR:
      return ((HiveChar) poi.getPrimitiveJavaObject(val)).getPaddedValue();
    case VARCHAR:
      return ((HiveVarchar) poi.getPrimitiveJavaObject(val)).toString();
    case DECIMAL:
      return ((HiveDecimal) poi.getPrimitiveJavaObject(val)).bigDecimalValue();
    default:
      return poi.getPrimitiveJavaObject(val);
    }
  }
Row-based record reader for LLAP.
llap-client/src/java/org/apache/hadoop/hive/llap/LlapRowRecordReader.java