private static ObjectInspector createObjectInspector(Schema schema) throws SerDeException {
    Preconditions.checkNotNull(schema);
    List<String> fieldNames = new ArrayList<>();
    List<ObjectInspector> fieldInspectors = new ArrayList<>();
    List<String> fieldComments = new ArrayList<>();
    for (int i = 0; i < schema.getColumnCount(); i++) {
      ColumnSchema col = schema.getColumnByIndex(i);
      PrimitiveTypeInfo typeInfo = toHiveType(col.getType(), col.getTypeAttributes());
      fieldNames.add(col.getName());
      fieldInspectors.add(
          PrimitiveObjectInspectorFactory.getPrimitiveWritableObjectInspector(typeInfo));
      fieldComments.add(col.getComment());
    }
    return ObjectInspectorFactory.getStandardStructObjectInspector(fieldNames, fieldInspectors,
        fieldComments);
  }
A Kudu serializer and deserializer to support reading and writing Kudu data from Hive.
kudu-handler/src/java/org/apache/hadoop/hive/kudu/KuduSerDe.java