Skip to content

[902] Build on Java 17, Spark 3.5, Iceberg 1.12 and Hudi 1.3.0-SNAPSHOT, with a Spark 4.1 profile - #8

Draft
yihua wants to merge 6 commits into
ptf-review-basefrom
ptf-review-build-upgrade
Draft

yihua wants to merge 6 commits into
ptf-review-basefrom
ptf-review-build-upgrade

Conversation

@yihua

@yihua yihua commented Nov 24, 2026 •

Copy link
Copy Markdown
Owner

Important Read

Issue: apache#902. Based on ptf-review-base, the upstream commit e91662f that iceberg-v3-ptf-poc branches from. New code: it is not on iceberg-v3-ptf-poc yet.

What is the purpose of the pull request

Moves the default build to Java 17, Spark 3.5.9, Iceberg 1.12.0 and delta-spark 3.3.2, adds a spark4.1 profile, keeps an explicit spark3.5 profile, and builds against Hudi 1.3.0-SNAPSHOT. Iceberg 1.11 and later need Java 17, and Iceberg 1.12 publishes no Spark 3.4 runtime, so the Spark 3.5 default comes with the Iceberg upgrade. The other PRs of the pluggable table format are based on this one.

Brief change log

  • DeltaSparkShim, under src/main/delta3 and src/main/delta4, holds the few DeltaLog calls whose signatures differ between Delta 3 and 4; the build adds the one delta.shim.dir names.
  • Root pom and workflows: Java 17, the module opens the test JVMs need, and a spark4.1 profile (Scala 2.13, Delta 4.1, Paimon's Spark 4.0 module, and the Netty, Parquet and ORC versions Spark 4.1 is built with). xtable-utilities shades the modules Spark 3.5 adds.
  • Tests: Spark sessions stop with stop(), the Iceberg time travel IT uses timestampAsOf, ITDeltaConversionSource counts log listings against getChanges, and the Delta tests follow Delta 3: column-mapping tables enable IcebergCompatV2, and ITDeltaDeleteVectorConvert reloads its table handle and expects the deletion vectors Delta 3's MERGE writes.
  • Second commit: Hudi 1.3.0-SNAPSHOT, import moves only.
  • Self-review commit: HoodieAvroWriteSupportWithFieldIds sets Parquet field ids over Parquet's own schema classes instead of Iceberg's ParquetSchemaUtil, which on Iceberg 1.10 and later needs a newer Parquet than Spark 3.5 and Hudi's Spark 3.5 bundle provide; iceberg-parquet leaves the extensions bundle. Found by upstream CI on the matching [902] Build on Java 17, Spark 3.5 and Iceberg 1.12 by default, with a Spark 4.1 profile apache/incubator-xtable#1050.
  • Last commit (self-review): the Hudi test table sets hoodie.meta.fields.mode=NONE for tables written with field ids, since Hudi 1.3 reads the meta fields mode from that key; ITRunSync in xtable-utilities failed without it.
  • Earlier commits (self-review): xtable-core runs at most four test cases at once. With one per core, the concurrent cases of ITConversionController outgrew the 1.5 GB test heap on Spark 3.5 and Hudi 1.3 on a machine with many cores.

Known limitations:

  • regression: xtable-spark-runtime on Spark 3.4 with delta-core 2.4 can no longer use the Delta (non-Kernel) source, since the shim calls Delta 3 APIs; the Spark 3.4 leg of the runtime validation is dropped.
  • never supported, newly reachable: a Delta table with column mapping, written by Delta 3, without IcebergCompatV2 and with a map or a list of primitives syncs to an Iceberg table Iceberg cannot read. Delta 3 writes Parquet field ids but none for map keys, values and list elements, and Iceberg resolves a file with field ids by id, ignoring the name mapping.
  • Hudi 1.3.0-SNAPSHOT is not published, so CI on a clean runner cannot resolve it until Hudi 1.3 is released.
  • spark4.1 builds xtable-core and the Iceberg table format only, leaves ITDeltaConversionSource and TestDeltaSync out of its test compile, and has no CI job.
  • The xtable-utilities include list still lacks the native libraries Hudi 1.3 brings (Lance, Vortex, Arrow dataset, Calcite). The module is unpublished and the license validator skips it.

Verify this pull request

This pull request is already covered by existing tests, run locally on JDK 17 against Hudi 1.3.0-SNAPSHOT built from the PTF branch, since the fork has no CI for these branches:

  • At this PR's head, on the default 1.5 GB test heap: 581 xtable-core unit tests pass (3 skipped), and ITConversionController (80 cases), the xtable-core Iceberg ITs and the Delta ITs pass, including ITDeltaDeleteVectorConvert and the late column-mapping rename cases after the Delta 3 test changes above. The other xtable-core ITs and the Iceberg table format's 26 unit tests and 46 ITs (1 skipped) pass at the commit before the parallelism change, which touches only the xtable-core test config.
  • The whole reactor builds with -DskipTests; -Pspark4.1 builds xtable-core and the Iceberg table format with their tests.
  • With every PR of this set merged on top, 632 xtable-core unit tests and the Iceberg table format's unit tests and ITs pass.
  • spotless:check, apache-rat:check and release/scripts/validate_shaded_license_coverage.sh pass.

… Spark 4.1 profile

Iceberg 1.11 and later are compiled for Java 17, and Iceberg 1.12 publishes
no Spark 3.4 runtime, so the default build moves to Java 17, Spark 3.5.9,
Iceberg 1.12.0 and delta-spark 3.3.2. The test JVMs get the module opens
that Spark and Hadoop need on Java 17, and the workflows build on JDK 17.

Delta 3 and Delta 4 changed the signatures of a few DeltaLog calls.
DeltaSparkShim holds those calls once per Delta major version, under
src/main/delta3 and src/main/delta4, and the build adds the one that
delta.shim.dir names. The AddFile constructor and the log directory call
are the same in both, so the code calls them directly.

The spark3.5 profile names the default explicitly. The spark4.1 profile
builds on Spark 4.1.1 with Scala 2.13, Delta 4.1.0 and Paimon's Spark 4.0
module, and pins the Netty, Parquet and ORC versions Spark 4.1 is built
with. Under it, two Delta test classes that use APIs Delta 4 and Scala 2.13
removed are left out of the test compile.

Spark sessions in the tests stop with stop(), since close() declares an
IOException in Spark 4. The Iceberg time travel in ITIcebergTableFormat
uses Spark's timestampAsOf option, which Iceberg's Spark 4 reader keeps.
HudiTableExtractor drops an unused @singleton, since javax.inject is not
on the Spark 4.1 classpath.

The README, setup docs, AGENTS.md and the Jupyter demo move to Java 17
and delta-spark. The shaded xtable-utilities jar includes the Spark 3.5
modules spark-common-utils, spark-sql-api and datasketches, and the
spark-runtime validation drops its Spark 3.4 leg, since the bundle now
calls Delta 3 APIs that delta-core 2.4 lacks. The bundled license
metadata of xtable-hudi-support-extensions is regenerated for
iceberg-parquet 1.12.0.

ITDeltaConversionSource counts the log listings XTable makes against the
getChanges calls, since Delta 3's getChanges lists the log through
getChangeLogFiles itself.

The column mapping tables of the Delta test helper enable
IcebergCompatV2, since Delta 3 writes Parquet field ids for the key,
value and element of maps and lists only under it, and Iceberg reads a
file that has field ids by id.

Two Delta tests follow Delta 3 behavior: ITDeltaDeleteVectorConvert
reloads its DeltaTable handle after enabling deletion vectors, since the
handle keeps the file format of the snapshot before the feature, and
expects the deletion vectors that Delta 3's MERGE writes by default.
testLateColumnMappingRenameDeltaToIceberg enables IcebergCompatV2 after
its partition renames, which IcebergCompatV2 forbids.
hudi.version moves from 1.2.1 to 1.3.0-SNAPSHOT. Hudi master moved
HoodieColumnRangeMetadata, ValueMetadata and ValueType from
org.apache.hudi.stats to org.apache.hudi.metadata.stats, and
HoodieAvroUtils from org.apache.hudi.avro to org.apache.hudi.common.avro,
so the imports follow. XTableValueMetadata and its test move to
org.apache.hudi.metadata.stats as well, since they rely on package-private
members of ValueMetadata.

No behavior change is intended. The snapshot is not published, so it has
to be installed locally with the Spark 3.5 profile before this builds.
JUnit ran the test cases of xtable-core with one thread per core. On
Spark 3.5 and Hudi 1.3 the concurrent cases of ITConversionController
outgrow the 1.5 GB test heap on a machine with many cores and fail with
an OutOfMemoryError while reading Hudi's metadata table. A fixed
parallelism of four, about what a CI runner gives, keeps them within it.
The parallelism settings were appended to junit-platform.properties without a line break after its last line, which turned the class parallel mode into an invalid value.
…t support

HoodieAvroWriteSupportWithFieldIds applied its field ids through
Iceberg's ParquetSchemaUtil.applyNameMapping. Iceberg 1.10 and later
build their Parquet support against Parquet 1.16 or later and call
LogicalTypeAnnotation.variantType, which the Parquet of Spark 3.5 and of
Hudi's Spark 3.5 bundle lacks, so every write with this write support
failed with a NoSuchMethodError, as ITRunSync in xtable-utilities showed.
Moving the build to a newer Parquet instead breaks Spark jobs that load
Hudi's bundle, which carries an older copy of Parquet's shaded fastutil.

The write support now sets the ids itself over Parquet's own schema
classes, matching fields by name at each level, the element of a list as
element in both list layouts and the entries of a map as key and value,
as Iceberg's name mapping does. iceberg-parquet leaves the extensions
module and its bundle, and the bundled license metadata follows. A new
test checks the ids for flat, nested, list and map schemas; run once
against Iceberg's applyNameMapping on Parquet 1.17.1, it gave the same
schemas for every case.
The Hudi test table writes tables with field ids without meta fields,
setting populateMetaFields on the table and the writer. Hudi 1.3 reads
the writer's choice from hoodie.meta.fields.mode, which defaults to ALL,
so the first write to such a table failed with a meta fields mode
mismatch, as ITRunSync in xtable-utilities showed. The writer now sets
the mode to NONE for these tables.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant