private ObjectInspector createStructObjectInspector(Descriptor descriptor,
      Map<Descriptor, ObjectInspector> cache) throws SerDeException {
    if (cache.containsKey(descriptor)) {
      return cache.get(descriptor);
    }
    List<String> columnNames = new ArrayList<>();
    List<ObjectInspector> columnOI = new ArrayList<>();
    for (FieldDescriptor field : descriptor.getFields()) {
      columnNames.add(field.getName());
      columnOI.add(createObjectInspector(field, cache));
    }
    ObjectInspector oi = ObjectInspectorFactory.getStandardStructObjectInspector(
        columnNames, columnOI);
    cache.put(descriptor, oi);
    return oi;
  }
Convert the given writable to a message.
@param writable The writable object containing the message.
@return The converted message object.
@throws SerDeException
ql/src/java/org/apache/hadoop/hive/ql/io/protobuf/ProtobufSerDe.java