private static Map<Integer, Integer> idToPos(Types.StructType struct) {
    Map<Integer, Integer> idToPos = Maps.newHashMap();

    if (struct != null) {
      List<Types.NestedField> fields = struct.fields();
      for (int pos = 0; pos < fields.size(); pos += 1) {
        Types.NestedField field = fields.get(pos);
        idToPos.put(field.fieldId(), pos);
      }
    }

    return idToPos;
  }
Builds a read plan for record classes that use planned reads instead of a ResolvingDecoder.

@param expected expected StructType
@param record Avro record schema
@param fieldReaders list of readers for each field in the Avro record schema
@param idToConstant a map of field ID to constants values
@param convert function to convert from internal classes to the target object model
@return a read plan that is a list of (position, reader) pairs
iceberg/patched-iceberg-core/src/main/java/org/apache/iceberg/avro/ValueReaders.java