You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iceberg.apache.org by et...@apache.org on 2025/03/19 14:22:59 UTC

(iceberg) 01/01: Core: Use InternalData when reading manifests in FileCleanupStrategy

This is an automated email from the ASF dual-hosted git repository.

etudenhoefner pushed a commit to branch internal-data-usage
in repository https://gitbox.apache.org/repos/asf/iceberg.git

commit 07d92530a7b2d94871cc730df4d1e4df0208362d
Author: Eduard Tudenhoefner <et...@gmail.com>
AuthorDate: Wed Mar 19 15:22:49 2025 +0100

    Core: Use InternalData when reading manifests in FileCleanupStrategy
---
 core/src/main/java/org/apache/iceberg/FileCleanupStrategy.java | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/core/src/main/java/org/apache/iceberg/FileCleanupStrategy.java b/core/src/main/java/org/apache/iceberg/FileCleanupStrategy.java
index dae99c572c..9cf12cb943 100644
--- a/core/src/main/java/org/apache/iceberg/FileCleanupStrategy.java
+++ b/core/src/main/java/org/apache/iceberg/FileCleanupStrategy.java
@@ -21,7 +21,6 @@ package org.apache.iceberg;
 import java.util.Set;
 import java.util.concurrent.ExecutorService;
 import java.util.function.Consumer;
-import org.apache.iceberg.avro.Avro;
 import org.apache.iceberg.exceptions.NotFoundException;
 import org.apache.iceberg.io.CloseableIterable;
 import org.apache.iceberg.io.FileIO;
@@ -63,11 +62,11 @@ abstract class FileCleanupStrategy {
 
   protected CloseableIterable<ManifestFile> readManifests(Snapshot snapshot) {
     if (snapshot.manifestListLocation() != null) {
-      return Avro.read(fileIO.newInputFile(snapshot.manifestListLocation()))
-          .rename("manifest_file", GenericManifestFile.class.getName())
-          .classLoader(GenericManifestFile.class.getClassLoader())
+      return InternalData.read(
+              FileFormat.AVRO, fileIO.newInputFile(snapshot.manifestListLocation()))
+          .setRootType(GenericManifestFile.class)
           .project(MANIFEST_PROJECTION)
-          .reuseContainers(true)
+          .reuseContainers()
           .build();
     } else {
       return CloseableIterable.withNoopClose(snapshot.allManifests(fileIO));