code: @Nullable
    Object convertRootField(OrcStruct struct, String fieldName)
    {
      // this cache is only valid for the root level, to skip the indexOf on fieldNames to get the fieldIndex.
      TypeDescription schema = struct.getSchema();
      final List<String> fields = schema.getFieldNames();
      if (fieldIndexCache == null) {
        fieldIndexCache = new Object2IntOpenHashMap<>(fields.size());
        for (int i = 0; i < fields.size(); i++) {
          fieldIndexCache.put(fields.get(i), i);
        }
      }
      WritableComparable wc = struct.getFieldValue(fieldName);
  
      int fieldIndex = fieldIndexCache.getOrDefault(fieldName, -1);
  
      return convertField(struct, fieldIndex);
    }
docs: Convert a orc struct field of the "root" {@link OrcStruct} that represents the "row". This method has a cache of
  field names to field index that is ONLY valid for this {@link OrcStruct}, and should not be used for
  nested {@link OrcStruct} fields of the row. Looks up field index by field name, and delegates to
  {@link OrcStructConverter#convertField(OrcStruct, int)}.