Skip to content

[doc] Add Spark 4.0 compatibility warning for JVM packages#12136

Open
wbo4958 wants to merge 1 commit intodmlc:masterfrom
wbo4958:doc-spark4-compat-warning
Open

[doc] Add Spark 4.0 compatibility warning for JVM packages#12136
wbo4958 wants to merge 1 commit intodmlc:masterfrom
wbo4958:doc-spark4-compat-warning

Conversation

@wbo4958
Copy link
Copy Markdown
Contributor

@wbo4958 wbo4958 commented Apr 1, 2026

Summary

  • Add a warning to the XGBoost4J-Spark tutorial (doc/jvm/xgboost4j_spark_tutorial.rst) about Spark 4.0.0 binary incompatibility
  • Add a "Spark 4.0 Compatibility" section to the migration guide (doc/jvm/xgboost_spark_migration.rst)

Context

Apache Spark 4.0.0 introduced a breaking change to org.apache.spark.ml.param.Param constructor (SPARK-52259), which causes NoSuchMethodError when instantiating any XGBoost estimator (e.g., XGBoostClassifier, XGBoostRegressor). This affects all third-party ML libraries that use Param.

Test results:

Spark Version Result
4.0.0 FAILNoSuchMethodError on Param constructor
4.1.0 PASS — XGBoostClassifier trains and predicts correctly

The upstream fix is included in Spark 4.0.1 (released 2025-09-02) and Spark 4.1.0. XGBoost4J-Spark JARs built against Spark 3.5 work on Spark 4.0.1+ without any code changes.

This PR adds documentation warnings so users know to avoid Spark 4.0.0 and use Spark 4.0.1 or later.

Related

Made with Cursor

Spark 4.0.0 has a binary incompatibility in `org.apache.spark.ml.param.Param`
(SPARK-52259) that breaks all third-party ML libraries including XGBoost4J-Spark.
The issue is fixed in Spark 4.0.1 and 4.1.0.

Add warnings to the Spark tutorial and migration guide so users know to avoid
Spark 4.0.0 and upgrade to at least Spark 4.0.1.

Made-with: Cursor
@trivialfis
Copy link
Copy Markdown
Member

I think a simple troubleshooting note should be sufficient

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.

2 participants