← Back to Pull requests

[FEA] Add Iceberg dictionary filter timing metric [reduced-it] #16792

Closed
unknown closed this pull request without merging on Nov 12, 2026 03:21 UTC
View on GitHub
unknown unknown commented on Nov 09, 2026 09:08 UTC
Author

Fixes #16790.

Description

GPU Iceberg scans do not expose the time spent on dictionary filtering. Add icebergDictFilterTime to the SQL UI at MODERATE and DEBUG levels. It measures dictionary predicate evaluation and dictionary-reader access, excluding statistics and Bloom filtering. Each file uses its own local timer. The reader trait publishes elapsed time through addTimeByMetric(metricName, value) using +=. The multithreaded reader overrides this hook to accumulate elapsed time in lazily created AtomicLong entries in pendingTimers; the task thread publishes the totals when advancing or closing the reader. This avoids sharing mutable timer state or synchronizing metric updates, and records time even when dictionary filtering rejects every row group.

Validation:

  • Package builds passed on the combined tree with current main (3fdbf6d759) for Spark 3.5.9 / Iceberg 1.9.x and 1.10.x, and Spark 4.1.1 / Iceberg 1.11.x, covering Scala 2.12 and 2.13.

  • Scala style and whitespace checks passed. Static shim compatibility passed for all 32 configured profiles.

  • Local GPU experiment: Spark 3.5.9, Iceberg 1.9.2 Hadoop catalog, warehouse under /tmp, 800,000 rows in 16 Parquet files, MULTITHREADED reader with 8 workers. Matching and dictionary-rejected predicates produced the same results as CPU execution.

  • Inspected the completed Spark event log: the metric appears on GpuBatchScan in SQL execution plans, and task accumulator updates match the collected plan metric values. At ESSENTIAL level, the dictionary timing metric is absent from both collected plans and event-log plans.
  • | Metrics level | Predicate | Matching rows | Event-log dictionary filter time |
    | --- | --- | ---: | ---: |
    | MODERATE | id = 1 | 0 | 17.58 ms |
    | MODERATE | id = 2 | 400,000 | 9.61 ms |
    | DEBUG | id = 1 | 0 | 6.98 ms |
    | DEBUG | id = 2 | 400,000 | 6.39 ms |

    No new unit tests; validation uses the local CPU/GPU experiment above. Only the primary timer is updated; the shared metric factory's DEBUG companion remains zero.

    Performance: a standalone CPU microbenchmark on Spark 3.5.9 / Iceberg 1.9.2 repeatedly filtered one local dictionary-encoded row group through the multithread reader, including atomic accumulation and publication on the calling task thread. Seven paired samples of 5,000 calls, after warmup and with alternating order, measured median times of 4.16 microseconds with timing disabled and 4.79 microseconds enabled. The sample ranges overlap; this does not establish an end-to-end performance difference.

    The related-PR advisory found no new static interactions in completed joint checks. Checks involving #16735 and #16738 are incomplete because those branches conflict with current main; peers beyond the five-peer budget were not jointly checked. #15624 replaces the same filtering method and will need to preserve this timing metric when combined.

    Authored with AI.

    Checklists

    Documentation

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

  • No user-facing change
  • Documentation omitted for this timing metric.

    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
  • Diff: 429 lines (+321 / -108) across 5 files Reviewer: res-life Review duration: 3972m
    All Vouch review confidence checks passed
    Residual risk 0.18 = Change Risk (0.45) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.45 · 429 lines diff across 5 files
    0.45
    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.363
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #16792"
    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: 45.1% (MEDIUM) · Higher = larger blast radius
    45.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: 17.8% · Safe to merge
    17.8%