code: @Nullable
    Object convertField(OrcStruct struct, int fieldIndex)
    {
      if (fieldIndex < 0) {
        return null;
      }
  
      TypeDescription schema = struct.getSchema();
      TypeDescription fieldDescription = schema.getChildren().get(fieldIndex);
      WritableComparable fieldValue = struct.getFieldValue(fieldIndex);
  
      if (fieldValue == null) {
        return null;
      }
  
      if (fieldDescription.getCategory().isPrimitive()) {
        return convertPrimitive(fieldDescription, fieldValue, binaryAsString);
      } else {
        // handle complex column types
        /*
            ORC TYPE    WRITABLE TYPE
            array       org.apache.orc.mapred.OrcList
            map         org.apache.orc.mapred.OrcMap
            struct      org.apache.orc.mapred.OrcStruct
            uniontype   org.apache.orc.mapred.OrcUnion
         */
        switch (fieldDescription.getCategory()) {
          case LIST:
            OrcList orcList = (OrcList) fieldValue;
            return convertList(fieldDescription, orcList, binaryAsString);
          case MAP:
            OrcMap map = (OrcMap) fieldValue;
            return convertMap(fieldDescription, map, binaryAsString);
          case STRUCT:
            OrcStruct structMap = (OrcStruct) fieldValue;
            return convertStructToMap(structMap);
          case UNION:
            // sorry union types :(
          default:
            return null;
        }
      }
    }
docs: Convert a orc struct field as though it were a map, by fieldIndex. Complex types will be transformed
  into java lists and maps when possible ({@link OrcStructConverter#convertList} and
  {@link OrcStructConverter#convertMap}), and
  primitive types will be extracted into an ingestion friendly state (e.g. 'int' and 'long'). Finally,
  if a field is not present, this method will return null.
  
  Note: "Union" types are not currently supported and will be returned as null