Skip to content

[CORE] Fix Delta 4.0 Spark 4.1 package build#12078

Open
malinjawi wants to merge 7 commits into
apache:mainfrom
malinjawi:fix/delta40-nightly-package
Open

[CORE] Fix Delta 4.0 Spark 4.1 package build#12078
malinjawi wants to merge 7 commits into
apache:mainfrom
malinjawi:fix/delta40-nightly-package

Conversation

@malinjawi
Copy link
Copy Markdown
Contributor

@malinjawi malinjawi commented May 12, 2026

What changes were proposed in this pull request?

This PR fixes the nightly package failure for the Spark 4.1 + Delta Velox build path.

Changes:

  • Use Spark Logging plus explicit SparkMDC.of(...) calls in Delta 4.0 logging code so the code compiles across Spark 4.0, Spark 4.1, Delta 4.0, and Delta 4.1.
  • Add Spark 4.1 compatibility shims for Delta 4.0 references to the old streaming CheckpointFileManager and MemoryStream packages.
  • Use the Spark 4.1 Delta artifact, delta-spark_4.1_2.13:4.1.0, from the Spark 4.1 Maven profile. Delta 4.0.0 still references Spark TimeAdd, which is absent in Spark 4.1.
  • Align Delta 4.0 test shims with Spark 4.1 / Delta 4.1 error classes for default-column and temp-view insert checks.
  • Add Spark 4.1 -Pdelta test-compile coverage inside the regular spark-test-spark41 workflow before running the existing Spark 4.1 unit tests.

Why are the changes needed?

The nightly package build compiles Spark 4.1 with -Pdelta, but PR CI did not enable Delta on the Spark 4.1 Velox path. Spark 4.1 changed the logging MDC shape and moved streaming APIs used by Delta 4.0, so the original issue only surfaced in nightly packaging.

After enabling Spark 4.1 Delta coverage in PR CI, two more Spark 4.1 issues surfaced: Delta 4.0.0 references org.apache.spark.sql.catalyst.expressions.TimeAdd, which is not present in Spark 4.1, and the reused Delta 4.0 tests need Spark 4.1-specific error expectations. The Spark 4.1 profile now resolves Delta 4.1.0 using the Spark-specific Delta artifact, and the tests select the Spark 4.1 expectations using org.apache.spark.SPARK_VERSION.

How was this patch tested?

  • ./build/mvn -ntp -pl shims/spark41 clean install -Pspark-4.1 -Pscala-2.13 -Pjava-21 -DskipTests -Dmaven.source.skip
  • ./build/mvn -ntp -pl backends-velox -am clean install -Pspark-4.1 -Pscala-2.13 -Pjava-21 -Pbackends-velox -Pceleborn -Puniffle -Pdelta -DskipTests -Dmaven.source.skip
  • ./build/mvn -ntp -pl backends-velox -am clean install -Pspark-4.0 -Pscala-2.13 -Pjava-21 -Pbackends-velox -Pceleborn -Puniffle -Piceberg -Phudi -Pdelta -Ppaimon -DskipTests -Dmaven.source.skip
  • ./build/mvn -ntp -pl backends-velox -am clean test-compile -Pspark-4.1 -Pscala-2.13 -Pjava-21 -Pbackends-velox -Pceleborn -Puniffle -Pdelta -Ddelta.package.name=delta-spark_4.1 -Ddelta.version=4.1.0 -Ddelta.binary.version=40 -DskipTests -Dmaven.source.skip
  • ./build/mvn -ntp -pl backends-velox -am clean test-compile -Pspark-4.1 -Pscala-2.13 -Pjava-21 -Pbackends-velox -Pceleborn -Puniffle -Pdelta -DskipTests -Dmaven.source.skip
  • ./build/mvn -ntp -pl backends-velox -am clean test-compile -Pspark-4.0 -Pscala-2.13 -Pjava-21 -Pbackends-velox -Pceleborn -Puniffle -Pdelta -DskipTests -Dmaven.source.skip
  • ./build/mvn -ntp -pl backends-velox -am clean test-compile -Pspark-4.1 -Pscala-2.13 -Pjava-17 -Pbackends-velox -Pspark-ut -Pdelta -DskipTests -Dmaven.source.skip
  • ./build/mvn -ntp -q help:evaluate -Dexpression=delta.package.name -DforceStdout -Pspark-4.1 -Pscala-2.13 -Pjava-17 -Pdelta
  • ./build/mvn -ntp -q help:evaluate -Dexpression=delta.version -DforceStdout -Pspark-4.1 -Pscala-2.13 -Pjava-17 -Pdelta
  • zipgrep -n TimeAdd ~/.m2/repository/io/delta/delta-spark_4.1_2.13/4.1.0/delta-spark_4.1_2.13-4.1.0.jar
  • git diff --check

@github-actions github-actions Bot added CORE works for Gluten Core VELOX INFRA labels May 12, 2026
@malinjawi malinjawi force-pushed the fix/delta40-nightly-package branch from 0560d84 to f8e7c1f Compare May 12, 2026 13:58
@malinjawi malinjawi changed the title [GLUTEN] Fix Delta 4.0 Spark 4.1 package build [CORE] Fix Delta 4.0 Spark 4.1 package build May 12, 2026
@malinjawi malinjawi marked this pull request as ready for review May 12, 2026 16:34
Comment thread .github/workflows/velox_backend_x86.yml Outdated
run: |
cd $GITHUB_WORKSPACE/
$MVN_CMD clean test-compile -Pspark-4.0 -Pscala-2.13 -Pbackends-velox -Pspark-ut -Piceberg,iceberg-test,delta,paimon -Pfast-build
$MVN_CMD clean test-compile -Pspark-4.1 -Pscala-2.13 -Pjava-17 -Pbackends-velox -Pspark-ut -Pdelta -Pfast-build
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

the fast-fail test is designed for AI tool
could we enable -Pdelta for Spark-4.1 test?
https://github.com/apache/gluten/blob/main/.github/workflows/velox_backend_x86.yml#L1378

Copy link
Copy Markdown
Contributor Author

@malinjawi malinjawi May 13, 2026

Choose a reason for hiding this comment

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

Thanks @zhouyuan. Got it, I moved the coverage from the fast-build job to the regular Spark 4.1 Velox test command, so spark-test-spark41 now runs with -Pdelta.

@malinjawi malinjawi force-pushed the fix/delta40-nightly-package branch from f8e7c1f to 8cb01ca Compare May 13, 2026 09:31
@malinjawi malinjawi marked this pull request as draft May 13, 2026 09:33
@github-actions
Copy link
Copy Markdown

Run Gluten Clickhouse CI on x86

@github-actions
Copy link
Copy Markdown

Run Gluten Clickhouse CI on x86

@github-actions
Copy link
Copy Markdown

Run Gluten Clickhouse CI on x86

@malinjawi malinjawi marked this pull request as ready for review May 13, 2026 17:35
@github-actions
Copy link
Copy Markdown

Run Gluten Clickhouse CI on x86

@malinjawi malinjawi requested a review from zhouyuan May 13, 2026 21:39
@github-actions
Copy link
Copy Markdown

Run Gluten Clickhouse CI on x86

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CORE works for Gluten Core INFRA VELOX

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants