← Back to Pull requests

Size Iceberg scan splits from scan split history #17173

Open
unknown opened this pull request with 409 lines diff across 5 files
View on GitHub
unknown unknown commented on Nov 27, 2026 22:42 UTC
Author

Fixes #17172.

Stacked on #17123; until it merges, this PR also shows its three commits. This PR's own commits are the four after c9e31d31e (#17123's head):

  • 7268673c5 Key Iceberg scans by their pushed and runtime filters

  • 3b9a05797 Size Iceberg scan splits from scan split history

  • a51a61a08 Test GPU reads of Iceberg scans sized from history against the CPU

  • a024fd644 Document Iceberg scans in the scan split heuristic README
  • Description

    Scan split history sizes v1, Hive and DSv2 file scan splits from recorded decode-expansion ratios. This applies it to Iceberg scans, under the same configs (spark.rapids.sql.history.scanSplit.enabled stays false). No new configs.

  • Key: IcebergPlanKey hashes a scan's table, columns read, and each pushed or runtime filter's operators and columns into the plan hash, and the filter values into the literals hash. Conjuncts and IN values may come in any order.

  • Sizing: each planning looks up a split for its key. If one is found, the planned tasks are regrouped with Iceberg's TableScanUtil.planTaskGroups and Iceberg's batch is rebuilt over the new groups, so partitions keep Iceberg's locality, broadcast table and delete-file handling. The lookup falls back to the split Iceberg grouped by after its adaptive sizing, so with no history Iceberg's groups are unchanged. Each split records its decoded and data bytes (delete files excluded) when read to the end; only the newest planning of a scan is recorded.

  • Not regrouped: metadata tables, scans grouped by partition key, scans with a split-size read option, and scans with delete files (the GPU reader disables coalescing and combining for any partition containing one). Failures keep Iceberg's groups and log one warning.

  • SparkBatch is rebuilt reflectively, because its constructor differs between Iceberg 1.6–1.10 and 1.11.
  • Tests: IcebergPlanKeySuite (5), GpuSparkBatchRegroupSuite (6), and GpuIcebergScanSplitHistorySuite (2), which runs a GPU session with history on and checks that a regrouped GPU read returns the CPU's rows and that a scan with delete files is not regrouped. The Iceberg source suites pass on Spark 3.5.6 (21, Iceberg 1.9/1.10) and Spark 4.0.2 (13, Iceberg 1.10). Scalastyle clean. Not compiled for Iceberg 1.6 or Databricks.

    Written with AI assistance and reviewed by the author.

    Checklists

    Documentation

  • Updated for new or modified user-facing features or behaviors

  • No user-facing change
  • Testing

  • Added or modified tests to cover new code paths

  • Covered by existing tests

  • (Please provide the names of the existing tests in the PR description.)
  • Not required
  • Performance

  • Tests ran and results are added in the PR description

  • Issue filed with a link in the PR description

  • Not required
  • Performance

    Four Iceberg ETL jobs, Spark 4.0.2, Iceberg 1.11, 6 GPU executors; 5 runs per arm after one recording run, best run of each arm:

    | Job | Scan tasks, off / on | Time, off / on | Change |
    |---|---|---|---|
    | A | 11,138 / 5,396 | 53.6 s / 46.9 s | -13% |
    | B | 1,504 / 682 | 45.6 s / 39.5 s | -13% |
    | C | 9,750 / 614 | 305 s / 328 s | +8% |
    | D | 720 / 720 | unchanged | split below the 64 MB floor |

    Diff: 409 lines (+306 / -103) across 5 files Reviewer: gerashegalov Review duration: 5265m
    All Vouch review confidence checks passed
    Residual risk 0.24 = Change Risk (0.45) × (1 − Review Confidence (0.47)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.45 · 409 lines diff across 5 files
    0.45
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    46%
    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.360
    Shallow Review Depth shallow_review_depth
    0.344
    Real PR Conversation Timeline
    1 comments
    "Review active on #17173"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 46.7% 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: 44.9% (MEDIUM) · Higher = larger blast radius
    44.9%
    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: 46.7% · Lower = rushed or shallow review
    46.7%
    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: 23.9% · Safe to merge
    23.9%