Skip to content

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

Merged
trivialfis merged 1 commit into
dmlc:masterfrom
wbo4958:doc-spark4-compat-warning
Apr 21, 2026
Merged

[doc] Add Spark 4.0 compatibility warning for JVM packages#12136
trivialfis merged 1 commit into
dmlc:masterfrom
wbo4958:doc-spark4-compat-warning

Conversation

@wbo4958

@wbo4958 wbo4958 commented Apr 1, 2026

Copy link
Copy Markdown
Contributor

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

@wbo4958

wbo4958 commented Apr 17, 2026

Copy link
Copy Markdown
Contributor Author

Hi @trivialfis, I didn't see there's a troubleshooting section, where do you suggest to add?

@trivialfis trivialfis merged commit 9d6d5ef into dmlc:master Apr 21, 2026
78 checks passed
@wbo4958 wbo4958 deleted the doc-spark4-compat-warning branch April 22, 2026 02:59
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