code: private static Map<String, Object> convertLogicalMap(Group g, boolean binaryAsString)
    {
      /*
        // Map<String, Integer> (nullable map, non-null values)
        optional group my_map (MAP) {
          repeated group map {
            required binary str (UTF8);
            required int32 num;
          }
        }
  
        // Map<String, Integer> (nullable map, nullable values)
        optional group my_map (MAP_KEY_VALUE) {(
          repeated group map {
            required binary key (UTF8);
            optional int32 value;
          }
        }
       */
      assert isLogicalMapType(g.getType());
      int mapEntries = g.getFieldRepetitionCount(0);
      Map<String, Object> converted = new HashMap<>();
      for (int i = 0; i < mapEntries; i++) {
        Group mapEntry = g.getGroup(0, i);
        String key = convertPrimitiveField(mapEntry, 0, binaryAsString).toString();
        Object value = convertField(mapEntry, "value", binaryAsString);
        converted.put(key, value);
      }
      return converted;
    }
docs: Convert a parquet 'map' logical type {@link Group} to a java map of string keys to groups/lists/primitive values