← Back to Pull requests

fix: Avoid duplicate aggregators when reusing T-Digest sketches #20837

Closed
unknown closed this pull request without merging on Nov 05, 2026 03:23 UTC
View on GitHub
unknown unknown commented on Nov 04, 2026 11:52 UTC
Author

Fixes #20819

Description

Return a FieldAccessPostAggregator when TDIGEST_GENERATE_SKETCH reuses an existing sketch, so selecting TDIGEST_QUANTILE first no longer registers the same aggregator twice

Add a SQL regression that checks the quantile and serialized sketch results and verifies that both outputs share one native sketch aggregator

Release note

Fixed SQL planning failures when TDIGEST_GENERATE_SKETCH follows TDIGEST_QUANTILE with the same input and compression

Validation

Tested with Temurin 25.0.5 and Maven 3.9.11

  • The new SQL regression fails before the fix with Duplicate field name: a0:agg and passes after the fix

  • mvn -B -ntp test -pl extensions-contrib/tdigestsketch -Dsurefire.rerunFailingTestsCount=0 -Pskip-static-checks -Dweb.console.skip=true: 57 tests passed, no failures or skips

  • mvn -B -ntp verify -pl extensions-contrib/tdigestsketch -DskipTests -Dweb.console.skip=true -Dmaven.javadoc.skip=true -Dcyclonedx.skip=true: passed with static checks enabled

  • mvn -B -ntp -pl extensions-contrib/tdigestsketch -Prat apache-rat:check dependency:analyze-only spotbugs:check -DoutputXML=true -DignoreNonCompile=true -DfailOnWarning=true: passed

  • javap -public confirms unchanged public signatures for TDigestGenerateSketchSqlAggregator
  • This PR has:

  • been self-reviewed

  • a release note entry in the PR description

  • added a regression test
  • Diff: 177 lines (+132 / -45) across 2 files Reviewer: FrankChen021 Review duration: 931m
    All Vouch review confidence checks passed
    Residual risk 0.14 = Change Risk (0.35) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.35 · 177 lines diff across 2 files
    0.35
    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.310
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #20837"
    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: 35.4% (MEDIUM) · Higher = larger blast radius
    35.4%
    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% · Safe to merge
    14%
    Repository