private static CloseableIterable<StructLike> dataReader(Schema schema, InputFile inputFile) {
    FileFormat fileFormat = fileFormat(inputFile.location());
    switch (fileFormat) {
      case AVRO:
        return Avro.read(inputFile)
            .project(schema)
            .createReaderFunc(fileSchema -> InternalReader.create(schema))
            .build();
      case PARQUET:
      case ORC:
        // Internal readers are not supported for PARQUET & ORC yet.
      default:
        throw new UnsupportedOperationException("Unsupported file format:" + fileFormat.name());
    }
  }
Reads partition statistics from the specified {@link InputFile} using given schema.

@param schema The {@link Schema} of the partition statistics file.
@param inputFile An {@link InputFile} pointing to the partition stats file.
iceberg/iceberg-handler/src/main/java/org/apache/iceberg/data/PartitionStatsHandler.java