Skip to content

chore: bump spark-4.2 profile to the released 4.2.0#4960

Merged
andygrove merged 4 commits into
apache:mainfrom
andygrove:spark-4.2-final-bump
Jul 17, 2026
Merged

chore: bump spark-4.2 profile to the released 4.2.0#4960
andygrove merged 4 commits into
apache:mainfrom
andygrove:spark-4.2-final-bump

Conversation

@andygrove

@andygrove andygrove commented Jul 17, 2026

Copy link
Copy Markdown
Member

Which issue does this PR close?

Part of #4142.

Rationale for this change

Spark 4.2.0 is now available in Maven Central, so the spark-4.2 profile no longer has to target a preview. This PR moves the profile onto the released version and makes the main sources compile against it, without yet wiring up Spark's own SQL tests for 4.2. It is a smaller slice of the larger bring-up in #4950, intended to land the version bump on its own.

Spark 4.2.0 is not simply 4.2.0-preview4 with the qualifier dropped: it changes SpecializedGetters and repackages a dependency, so a couple of real reconciliations are needed to compile.

What changes are included in this PR?

Build

  • spark.version moves from 4.2.0-preview4 to 4.2.0, and the WIP compile-only comment on the spark-4.2 profile is dropped.
  • Spark 4.2.0 bundles its own copy of org.apache.datasketches.memory.internal.ResourceImpl inside spark-catalyst, colliding with the transitive datasketches-memory jar and failing the BanDuplicateClasses enforcer rule. That class is now ignored.
  • The stale Jetty comment that claimed the test-scope pin matched preview4's Jetty version is corrected. The pin itself is unchanged.

Shims

  • Spark 4.2 removes GeographyVal / GeometryVal and replaces getGeography / getGeometry on SpecializedGetters with a single getBinaryView returning BinaryView. CometInternalRowShim can no longer be shared from the spark-4.1+ source root, because the major, minor-plus and minor shim directories are all compile source roots (a spark-4.2 copy would be a duplicate class, not an override). It is split into per-version spark-4.1 and spark-4.2 copies.

Plan stability

  • Regenerated with dev/regenerate-golden-files.sh --spark-version 4.2 against the released 4.2.0. The q2, q5, q54 (v1_4) and q5a (v2_7) goldens are pruned because their plans now match the shared fallback on 4.2.0, and q77a (v2_7) is added to record a degraded plan.

This PR intentionally does not enable the Spark SQL tests or add CI jobs for 4.2; that work is tracked separately in #4950.

How are these changes tested?

./mvnw -Pspark-4.2 -DskipTests test-compile builds the main and test sources against the released Spark 4.2.0. ./mvnw -Pspark-4.1 -DskipTests test-compile still passes, confirming the shim split did not regress the 4.1 profile. The plan-stability suites (CometTPCDSV1_4_PlanStabilitySuite and CometTPCDSV2_7_PlanStabilitySuite) pass on the regenerated goldens.

Spark 4.2.0 is now in Maven Central, so the spark-4.2 profile no longer
needs to target a preview. Point spark.version at 4.2.0 and make the
main sources compile against it.

- Drop the WIP compile-only comment on the spark-4.2 profile.
- Spark 4.2.0 bundles its own copy of
  org.apache.datasketches.memory.internal.ResourceImpl inside
  spark-catalyst, colliding with the transitive datasketches-memory jar
  and failing the BanDuplicateClasses enforcer rule; ignore that class.
- Spark 4.2 removes GeographyVal / GeometryVal and replaces
  getGeography / getGeometry on SpecializedGetters with a single
  getBinaryView returning BinaryView. CometInternalRowShim can no longer
  be shared from the spark-4.1+ source root, so split it into per-version
  spark-4.1 and spark-4.2 copies.
- Correct the stale Jetty comment that referenced preview4.

This does not wire up the Spark SQL tests for 4.2; it only moves the
profile onto the released version and keeps it compiling.
Regenerated with dev/regenerate-golden-files.sh --spark-version 4.2
against the released 4.2.0. The q2, q5, q54 (v1_4) and q5a (v2_7)
goldens are pruned because their plans now match the shared fallback on
4.2.0, and q77a (v2_7) is added to record a degraded plan.

@parthchandra parthchandra left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm. Thanks @andygrove

Two Spark 4.2.0 changes surfaced by moving the profile off preview4:

Iceberg scans job: Spark 4.2.0 turned `connector.catalog.View` from an
interface into a class. No Iceberg spark-runtime is published for 4.2, so
the build reuses the 4.0 runtime, whose `SparkView implements View` now
throws IncompatibleClassChangeError at class-load and aborts the Iceberg
suites. Report Iceberg as unavailable on Spark 4.2 in the shared probes so
the suites skip. Guard the fuzz suite's beforeAll with an early return
(cancelling from beforeAll aborts the suite) and add the missing
`assume(icebergAvailable)` to one native-scan test.

Expressions job: Spark 4.2 normalizes NaN / -0.0 for array_distinct and
the array set operations by wrapping their inputs as
`KnownFloatingPointNormalized(ArrayTransform(arr, x -> NormalizeNaNAndZero(x)))`.
The serde only handled a scalar `NormalizeNaNAndZero` child and fell back.
Since `KnownFloatingPointNormalized` is a runtime no-op tag, serialize any
other child directly and let its serde (the ArrayTransform codegen
dispatcher) carry the normalization, keeping these operations native.
# Conflicts:
#	spark/src/main/scala/org/apache/comet/serde/contraintExpressions.scala
@mbutrovich

Copy link
Copy Markdown
Contributor

Great to see!

@andygrove
andygrove merged commit 884e0a6 into apache:main Jul 17, 2026
72 checks passed
@andygrove
andygrove deleted the spark-4.2-final-bump branch July 17, 2026 19:24
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.

3 participants