Skip to content

fix: read native-written Iceberg manifests through the 3-arg ManifestFiles.read - #7507

Draft
tlfua wants to merge 1 commit into
apache:mainfrom
tlfua:tlfua/fix/7240-iceberg-1.12-manifest-read
Draft

tlfua wants to merge 1 commit into
apache:mainfrom
tlfua:tlfua/fix/7240-iceberg-1.12-manifest-read

Conversation

@tlfua

@tlfua tlfua commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Closes #7240.

Rationale for this change

Iceberg 1.12 removed the 2-arg ManifestFiles.read(ManifestFile, FileIO). IcebergReflection resolves that overload in the executor-side reflection probe and in readDataFilesFromManifest. On 1.12 the probe now fails with NoSuchMethodException, so every native Iceberg write falls back to the JVM writer.

In every release that has it (1.5.2 through 1.11), the 2-arg overload just delegates to read(ManifestFile, FileIO, Map<Integer, PartitionSpec>) with a null map. The 3-arg overload is present in all supported versions, 1.5.2 through 1.12.0.

What changes are included in this PR?

  • IcebergReflection adds a private manifestFilesReadMethod() that resolves the 3-arg ManifestFiles.read. The probe and readDataFilesFromManifest both use it. The decode passes null for the specs map, the same call the 2-arg overload made, so behavior on every currently pinned Iceberg version (1.5.2, 1.8.1, 1.10.0, 1.11.0) is unchanged.
  • The scaladoc records why the map is null: the reader must use the spec embedded in the manifest, which manifest_partition_spec in iceberg_write.rs writes and which for a void-only V1 spec has no fields. It also records that the null path is deprecated upstream and slated for removal in Iceberg 2.0.
  • Two IcebergReflectionSuite tests write a manifest with Iceberg's own ManifestFiles.write and decode it through decodeManifestToDataFiles. The first uses a partitioned spec with a non-zero spec id; the second uses a spec with no fields. Both run in every existing profile.

On the deprecation warning: with a null map, Iceberg 1.11 already logs ManifestReader "...deprecated and will be removed in the 1.12.0 release". 1.12 logs the same warning but names 2.0.0. The default 1.11 profile hits this path today, so this PR adds no new warning on the pinned versions.

Follow-ups, not in this PR:

  • Before Iceberg 2.0, pass a specs map that agrees with the spec the native writer embeds, instead of null.
  • Add Iceberg 1.12 CI coverage. Today no profile pins 1.12, and Comet's test sources do not compile against it (CometIcebergWriteDetectionSuite getConf override and RESTCatalogAdapter REST API changes), so that needs its own PR.

How are these changes tested?

Unit tests. The local command below runs on Spark 4.1 with Iceberg 1.11:

./mvnw -B -Pspark-4.1 test -Dtest=none -Dsuites="org.apache.comet.iceberg.IcebergReflectionSuite"

Result: 33 tests succeeded, 0 failed. spotless:check passes.

Pinned versions unchanged, fork CI. All jobs passed in both runs:

Run Coverage Result
PR tier Default ci.yml PR tier success
Iceberg verification 12 Comet Iceberg suites on Spark 3.4, 3.5, 4.0, 4.1, 4.2 (Iceberg 1.5.2–1.11.0) success
same run Iceberg Spark SQL tests on Iceberg 1.8, 1.9, 1.10, 1.11 (iceberg_spark_test_reusable.yml) success (32/32 jobs)

The verification workflow lives only on a fork branch and is not part of this PR.

Iceberg 1.12, end to end, fork CI. The same run has a job per leg. Each leg pins Iceberg 1.12.0 (javap-checked on the runtime jar), compiles Comet main sources, and runs a Spark 4.1 session with Comet native Iceberg writes enabled. It inserts into two tables:

  • a V2 table evolved to partition spec 1;
  • a V1 table whose spec 1 is void-only.

It then checks the plan, rows, a pruned read, and the files metadata (spec_id, partitions). The base leg runs the same check on main (b82f5ea) without this change.

fix base (without this PR)
executor probe None NoSuchMethodException: ManifestFiles.read(ManifestFile,FileIO)
V2 evolved spec insert native (CometIcebergWrite) falls back to JVM
V1 void-only spec insert native falls back to JVM
rows / pruned read / spec_id / partitions correct correct

javap on iceberg-spark-runtime-4.1_2.13-1.12.0.jar lists only:

public static ManifestReader<DataFile> read(ManifestFile, FileIO, Map<Integer, PartitionSpec>);
static ManifestReader<DataFile> read(ManifestFile, FileIO, Map<Integer, PartitionSpec>, boolean);

The issue comment linked from #7240 has the original reproduction.

…Files.read

Iceberg 1.12 removed ManifestFiles.read(ManifestFile, FileIO). The executor
reflection probe looked that overload up, so on 1.12 every native Iceberg write
fell back to the JVM writer, and the decode of the task manifest would have
failed the same way.

Look up read(ManifestFile, FileIO, Map) instead, which every supported Iceberg
release has, and pass a null specs map. That is what the removed overload did,
so the reader keeps using the partition spec embedded in the manifest.

Closes apache#7240.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: f90e170c-37ea-4416-a3e7-c86bef8814ca
@github-actions github-actions Bot added bug Something isn't working area:Iceberg labels Nov 5, 2026
@tlfua
tlfua force-pushed the tlfua/fix/7240-iceberg-1.12-manifest-read branch from 592bc44 to b348a47 Compare November 7, 2026 09:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:Iceberg bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Native Iceberg write silently falls back on Iceberg 1.12: ManifestFiles.read(ManifestFile, FileIO) was removed

1 participant