Skip to content

[902] Build on Java 17, Spark 3.5 and Iceberg 1.12 by default, with a Spark 4.1 profile - #1050

Draft
yihua wants to merge 2 commits into
apache:mainfrom
yihua:xt-902-build-upgrade
Draft

yihua wants to merge 2 commits into
apache:mainfrom
yihua:xt-902-build-upgrade

Conversation

@yihua

@yihua yihua commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Important Read

Part of #902: the Java 17 and Spark 3.5 steps, with Spark 4.1 as a profile rather than the default.

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, and keeps an explicit spark3.5 profile. 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. Hudi stays at 1.2.1.

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.
  • HoodieAvroWriteSupportWithFieldIds in the Hudi extensions sets Parquet field ids over Parquet's own schema classes instead of Iceberg's ParquetSchemaUtil: Iceberg 1.10 and later call a Parquet 1.16 method that the Parquet of Spark 3.5 and Hudi's Spark 3.5 bundle lacks, and a newer Parquet breaks Hudi's bundle. iceberg-parquet leaves the extensions bundle.
  • 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.

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.
  • 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.

Verify this pull request

This pull request is already covered by existing tests, run locally:

  • On JDK 17, every module's tests pass: 596 xtable-core unit tests (3 skipped), all 226 xtable-core ITs, the Iceberg table format's 26 unit tests and 46 ITs (1 skipped), and the extensions, Spark extensions, AWS, HMS, utilities (including ITRunSync) and service tests. ITXTableSparkRuntimeBundle passes with a Spark 3.5.9 distribution as SPARK_HOME.
  • TestHoodieAvroWriteSupportWithFieldIds covers the field 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 whole reactor builds with -DskipTests; -Pspark4.1 builds xtable-core and the Iceberg table format with their tests.
  • 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.

xtable-core runs at most four test cases at once: with one per core, the
concurrent cases of ITConversionController outgrow the 1.5 GB test heap
on Spark 3.5 on a machine with many cores.
…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.

This branch has not been deployed

No deployments
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