← Back to Pull requests

[SPARK-60935][SQL] Remove unused `Shim.getAllPartitions` from `HiveShim` #60136

Closed
unknown closed this pull request without merging on Nov 05, 2026 19:20 UTC
View on GitHub
unknown unknown commented on Nov 05, 2026 17:12 UTC
Author

What changes were proposed in this pull request?

This PR removes the unused Shim.getAllPartitions(hive, table) abstract method and its only implementation Shim_v2_0.getAllPartitions from HiveShim.scala.

Why are the changes needed?

Nothing calls Shim.getAllPartitions. Shim is a private[client] sealed abstract class, so it cannot be used outside the org.apache.spark.sql.hive.client package, and no test uses it either. Shim_v2_0.getPartitionsByFilter falls back to hive.getAllPartitionsOf(table) directly rather than through this method.

History of the method:

  • SPARK-22214 (08b204fd2c7, 2017-10-06, first released in v2.3.0, tagged 2018-02-22) changed HiveClientImpl.getPartitions() to call client.getPartitions instead of shim.getAllPartitions when the partition spec is empty. That removed the last caller outside the shim.

  • After that, only Shim_v0_12.getPartitionsByFilter used the method, because Hive 0.12 cannot push the filter down to the metastore (HIVE-4888) and had to fetch all partitions.

  • SPARK-45358 (122e9f8a746, 2023-09-30, first released in v4.0.0, tagged 2025-05-19) removed the Hive shims older than 2.0.0. It moved the implementation to Shim_v2_0 but dropped that only caller, so the method has had no callers since.
  • Does this PR introduce _any_ user-facing change?

    No. The removed method is internal (private[client]) and has no callers.

    How was this patch tested?

    Pass the CIs. Also verified locally:

    build/sbt -Phive hive/Test/compile
    build/sbt -Phive hive/scalastyle
    

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

    Generated-by: Claude Sonnet 5.5

    Diff: 221 lines (+165 / -56) across 2 files Reviewer: peter-toth Review duration: 127m
    All Vouch review confidence checks passed
    Residual risk 0.15 = Change Risk (0.37) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.37 · 221 lines diff across 2 files
    0.37
    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.323
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #60136"
    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: 36.8% (MEDIUM) · Higher = larger blast radius
    36.8%
    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: 14.5% · Safe to merge
    14.5%
    Repository