← Back to Pull requests

[SPARK-62387][R] Drop SparkR support #60913

Closed
unknown closed this pull request without merging on Nov 30, 2026 06:36 UTC
View on GitHub
unknown unknown commented on Nov 26, 2026 17:15 UTC
Author

What changes were proposed in this pull request?

This PR removes SparkR from Apache Spark 5.0.0: the R package, bin/sparkR, the JVM-side R backend and ML wrappers, the R paths in spark-submit, YARN and Kubernetes, and related build, CI and docs.

These parts are not plain deletions:

  • spark-submit rejects .R/.r files, sparkr-shell and sparkr-shell-main (sent by the 4.x bin/sparkR) with an error instead of treating them as jars. docker-image-tool.sh -R also fails.

  • RMainAppResource and Constants.APP_RESOURCE_TYPE_R (Kubernetes, @Stable @DeveloperApi) are kept as @deprecated, and KubernetesDriverBuilder rejects an RMainAppResource before any feature step runs. apache/spark-kubernetes-operator creates RMainAppResource for the sparkRFiles field, so deleting the class would break the operator's build on Spark 5.0.

  • The release scripts skip their R steps for 5.0 and later. spark-rm/Dockerfile.base keeps R, because the release workflow uses master's copy of it for branch-4.x, which still ships SparkR.

  • spark.sql.execution.arrow.sparkr.enabled is not added to removedSQLConfigs, so a leftover true does not fail jobs.
  • Why are the changes needed?

    The [VOTE] "Deprecate SparkR" called on 2024-08-21 asked to "deprecate the SparkR module in Apache Spark with the upcoming Spark 4 release and remove it in the next major release Spark 5". It passed on 2024-08-26 with 19 +1 votes (12 binding), no 0 and no -1.

  • DISCUSS thread: https://lists.apache.org/thread/qjgsgxklvpvyvbzsx1qr8o533j4zjlm5

  • VOTE thread: https://lists.apache.org/thread/3c8qxks26kqflsjh0gtjo3nldk686vtq
  • SPARK-49347 deprecated SparkR in 4.0.0, and this PR does the removal for Spark 5. sparklyr is the recommended way to use Spark from R.

    Does this PR introduce _any_ user-facing change?

    Yes, compared to Spark 4.x. There is no SparkR package, bin/sparkR, or R API docs. spark-submit app.R fails with R applications are not supported: SparkR was removed in Apache Spark 5.0.0. Spark K8s operator apps that use sparkRFiles fail at submission once the operator runs on Spark 5.0. The core migration guide has a new 5.0 entry.

    This PR is for master (5.0.0) only. It should not be backported to branch-4.x, where SparkR is deprecated but still supported.

    How was this patch tested?

    New tests:

  • SparkSubmitSuite "SPARK-62387: reject R applications": app.R, app.r, sparkr-shell and sparkr-shell-main are rejected.

  • DriverCommandFeatureStepSuite "SPARK-62387: reject R resource" and KubernetesDriverBuilderSuite "SPARK-62387: reject R applications before any feature step uploads files": the second also checks that no local file is uploaded, with and without DriverCommandFeatureStep excluded.
  • PR CI does not run the release scripts. Their changes were checked with bash -n and sample version strings. After merge, the scheduled release dry run on master runs the tag and package steps, but not the upload step that holds the cp SparkR guard.

    Was this patch authored or co-authored using generative AI tooling?

    Generated-by: Claude Code (Opus 5.5)

    Diff: 399 lines (+299 / -100) across 4 files Reviewer: spark-test Review duration: 5120m
    All Vouch review confidence checks passed
    Residual risk 0.17 = Change Risk (0.43) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.43 · 399 lines diff across 4 files
    0.43
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.358
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #60913"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 43.2% (MEDIUM) · Higher = larger blast radius
    43.2%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 17.1% · Safe to merge
    17.1%
    Repository