Skip to content

ci: add Spark 4.0 / JDK 21 profile#4060

Open
james-willis wants to merge 1 commit intoapache:mainfrom
james-willis:jameswillis/ci-jdk-21-spark-4
Open

ci: add Spark 4.0 / JDK 21 profile#4060
james-willis wants to merge 1 commit intoapache:mainfrom
james-willis:jameswillis/ci-jdk-21-spark-4

Conversation

@james-willis
Copy link
Copy Markdown

@james-willis james-willis commented Apr 24, 2026

Which issue does this PR close?

Closes #4059

Rationale for this change

Spark 4 officially supports both Java 17 and 21 (ref). The current Comet CI and compatibility docs only cover Java 17 for Spark 4.0, which leaves Java 21 — an LTS release, widely adopted across the Spark / Arrow / Netty / Iceberg / Delta stack — without official validation.

This PR adds Java 21 as a supported runtime for the experimental Spark 4.0 tier so downstream consumers can adopt it with an upstream signal.

What changes are included in this PR?

  • .github/workflows/pr_build_linux.yml: add a Spark 4.0, JDK 21 profile next to the existing Spark 4.0, JDK 17 profile in both matrix sections. Extend the conditional JAVA_TOOL_OPTIONS so the existing --add-opens / --add-exports flags also apply under JDK 21 (they remain valid — same as Spark 4's own launcher scripts set for both JDK versions).
  • .github/workflows/spark_sql_test.yml: add {spark-short: '4.0', spark-full: '4.0.1', java: 21, scan-impl: 'auto'} to the config: matrix. Mirror the existing sql_hive-1 exclude (tracked under Spark 4.0.x hive-1 jdk17 tests failing consistently in multiple PRs #2946) for the new JDK 21 row.
  • docs/source/user-guide/latest/installation.md: update the Spark 4.0.1 row of the experimental compatibility table from 17 to 17/21.

Skipped because they have no Spark 4 rows to mirror:

  • spark_sql_test_native_iceberg_compat.yml (Spark 3.4/3.5 × Java 11 only)
  • iceberg_spark_test.yml (Spark 3.4/3.5 × Java 11/17 only)

How are these changes tested?

By the CI itself — this PR's purpose is to add the test profile. The new matrix rows exercise the existing full test suite under a JDK 21 runtime; any genuine incompatibility surfaces as a row-specific failure. If the JDK 21 rows go green, Comet can legitimately claim JDK 21 support for Spark 4 in the compatibility matrix.

The --add-opens / --add-exports flag set is the same one Spark 4 ships in its launcher scripts for both JDK 17 and 21, so no flag divergence is expected.

Additionally, I've run comet a bit in JDK 21 successfully, but not extensively.

Spark 4 officially supports both Java 17 and 21. This adds a JDK 21
profile next to the existing JDK 17 profile in the Spark 4 matrix
across pr_build_linux.yml and spark_sql_test.yml, extends the
conditional JAVA_TOOL_OPTIONS to apply the existing --add-opens /
--add-exports flags on JDK 21, mirrors the known sql_hive-1 exclude
(issue apache#2946) for the new JDK 21 row, and updates the Spark 4 entry
in the installation compatibility table.

Closes apache#4059
@james-willis james-willis marked this pull request as ready for review April 24, 2026 07:08
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.

Add Java 21 to the supported version matrix (particularly for Spark 4.0)

1 participant