static ManifestFile writeDataFiles(
            OutputFile outputFile, PartitionSpec spec, List<DataFile> dataFiles) throws IOException {
        ManifestWriter<DataFile> writer =
                ManifestFiles.write(FORMAT_V2, spec, outputFile, DUMMY_SNAPSHOT_ID);

        try (ManifestWriter<DataFile> closeableWriter = writer) {
            closeableWriter.addAll(dataFiles);
        }

        return writer.toManifestFile();
    }
Copy from iceberg-flink:iceberg-flink-1.15:1.3.1
inlong-sort/sort-flink/sort-flink-v1.15/sort-connectors/iceberg/src/main/java/org/apache/inlong/sort/iceberg/sink/FlinkManifestUtil.java