private CloseableIterable<Record> openFile(
      DataFile dataFile, Schema fileProjection, Map<Integer, ?> idToConstant) {
    EncryptedInputFile encryptedInput =
        EncryptedFiles.encryptedInput(
            fileIO.newInputFile(dataFile.path().toString()), dataFile.keyMetadata());
    InputFile input = encryptionManager.decrypt(encryptedInput);

    switch (dataFile.format()) {
      case AVRO:
        Avro.ReadBuilder avro =
            Avro.read(input)
                .project(fileProjection)
                .createReaderFunc(
                    avroSchema -> DataReader.create(fileProjection, avroSchema, idToConstant));

        if (reuseContainer) {
          avro.reuseContainers();
        }

        return avro.build();

      case PARQUET:
        Parquet.ReadBuilder parquet =
            Parquet.read(input)
                .project(fileProjection)
                .createReaderFunc(
                    fileSchema ->
                        GenericParquetReaders.buildReader(
                            fileProjection, fileSchema, idToConstant));

        if (reuseContainer) {
          parquet.reuseContainers();
        }

        return parquet.build();

      case ORC:
        Schema projectionWithoutConstantAndMetadataFields =
            TypeUtil.selectNot(
                fileProjection,
                Sets.union(idToConstant.keySet(), MetadataColumns.metadataFieldIds()));
        org.apache.iceberg.orc.ORC.ReadBuilder orc =
            org.apache
                .iceberg
                .orc
                .ORC
                .read(input)
                .project(projectionWithoutConstantAndMetadataFields)
                .createReaderFunc(
                    fileSchema ->
                        GenericOrcReader.buildReader(fileProjection, fileSchema, idToConstant));
        return orc.build();

      default:
        throw new UnsupportedOperationException(
            String.format("Cannot read %s file: %s", dataFile.format().name(), dataFile.path()));
    }
  }
Read data by {@link CombinedIcebergScanTask} for optimizer of native iceberg. During the
execution of readData and readDeleteData, delete data is read only once, thereby improving
performance.
amoro-format-iceberg/src/main/java/org/apache/amoro/io/reader/GenericCombinedIcebergDataReader.java