← Back to Pull requests

[SPARK-60895][SQL] Remove the Java 21 guard for the Hive 4.2 metastore #60110

Closed
unknown closed this pull request without merging on Nov 05, 2026 03:48 UTC
View on GitHub
unknown unknown commented on Nov 04, 2026 21:32 UTC
Author

What changes were proposed in this pull request?

This PR removes the "Hive 4.2 requires Java 21 or later" guard that SPARK-57263 added together with the Hive 4.2 metastore support, and everything that existed only for it:

  • IsolatedClientLoader: remove the constructor check that threw unsupportedHiveMetastoreVersionForJavaError when version == hive.v4_2 and !Utils.isJavaVersionAtLeast21.

  • QueryExecutionErrors: remove unsupportedHiveMetastoreVersionForJavaError.

  • error-conditions.json: remove the UNSUPPORTED_HIVE_METASTORE_VERSION_FOR_JAVA error condition.

  • HiveUtils and docs/sql-data-sources-hive-tables.md: remove "Note: Hive 4.2 requires Java 21 or later." from the description of spark.sql.hive.metastore.version.

  • HiveClientVersions (test): remove the filter that dropped 4.2 from versions on Java < 21. versions is now the SPARK_TEST_HIVE_CLIENT_VERSIONS list, or the default list that includes 4.2.
  • Why are the changes needed?

    SPARK-60669 dropped Java 17 support and made Java 21 the minimum, so Utils.isJavaVersionAtLeast21 is always true and the guard can never fire. Spark is compiled with --release 21 (class file major version 65), so a JVM older than Java 21 cannot even load IsolatedClientLoader. What is left is a dead branch, an error condition that nothing can raise, and a documentation note that now applies to all of Spark rather than to Hive 4.2 only.

    Does this PR introduce _any_ user-facing change?

    No. UNSUPPORTED_HIVE_METASTORE_VERSION_FOR_JAVA was added by SPARK-57263 on master and has not been released: it does not exist in branch-4.x, branch-4.3, or the v4.3.0 tag (tagged commit dated 2026-10-27). The removed guard could only fire on a JVM older than Java 21, which master no longer runs on.

    How was this patch tested?

    On JDK 21:

    build/sbt -Phive catalyst/Test/compile hive/Test/compile
    build/sbt -Phive 'core/testOnly org.apache.spark.SparkThrowableSuite'
    build/sbt -Phive 'hive/testOnly org.apache.spark.sql.hive.HiveUtilsSuite'
    

    Also checked that nothing references the removed code, and that the error condition is not in any release:

    git grep -n -e UNSUPPORTED_HIVE_METASTORE_VERSION_FOR_JAVA -e unsupportedHiveMetastoreVersionForJava
    git grep -n isJavaVersionAtLeast21 -- sql/hive
    git grep -n UNSUPPORTED_HIVE_METASTORE_VERSION_FOR_JAVA v4.3.0 -- common/utils/src/main/resources/error/error-conditions.json
    

    All three print nothing. The same check on branch-4.x and branch-4.3 also prints nothing.

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

    Generated-by: Claude Sonnet 5.5

    Diff: 331 lines (+248 / -83) across 4 files Reviewer: spark-test Review duration: 376m
    All Vouch review confidence checks passed
    Residual risk 0.17 = Change Risk (0.42) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.42 · 331 lines diff across 4 files
    0.42
    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.347
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #60110"
    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: 42.1% (MEDIUM) · Higher = larger blast radius
    42.1%
    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: 16.6% · Safe to merge
    16.6%
    Repository