← Back to Pull requests

test: Add end to end tests for quantile digest functions #27582

Closed
unknown closed this pull request without merging on Jun 25, 2026 18:18 UTC
View on GitHub
unknown unknown commented on Apr 14, 2026 05:40 UTC
Author

Description


Add end-to-end tests for the quantile digest (qdigest) functions on the native worker: qdigest_agg (all
three variants), merge, value_at_quantile, values_at_quantiles, and scale_qdigest.

Motivation and Context


Closes https://github.com/prestodb/presto/issues/26939. The qdigest functions are registered in Velox
but had no e2e coverage comparing Java vs native worker results.

Impact


Tests only. No user-facing or API changes.

Test Plan


<!---Please fill in how you tested your change-->

Contributor checklist

  • Please make sure your submission complies with our contributing guide, in particular code style and commit standards.

  • PR description addresses the issue accurately and concisely. If the change is non-trivial, a GitHub Issue is referenced.

  • Documented new properties (with its default value), SQL syntax, functions, or other functionality.

  • If release notes are required, they follow the release notes guidelines.

  • Adequate tests were added if applicable.

  • CI passed.

  • If adding new dependencies, verified they have an OpenSSF Scorecard score of 5.0 or higher (or obtained explicit TSC approval for lower scores).
  • Release Notes


    Please follow release notes guidelines and fill in the release notes below.

    == NO RELEASE NOTE ==
    

    Summary by Sourcery

    Add end-to-end native worker coverage for qdigest aggregation and related functions to ensure consistency with Java execution.

    Tests:

  • Add native worker tests covering qdigest_agg for bigint, double, and real inputs, including weighted and accuracy-parameter variants.

  • Add tests for qdigest merge, value_at_quantile, values_at_quantiles, and scale_qdigest behavior on the nation dataset, including null-handling cases.
  • Diff: 276 lines (+207 / -69) across 3 files Reviewer: pramodsatya Review duration: 104438m
    All Vouch review confidence checks passed
    Residual risk 0.17 = Change Risk (0.40) × (1 − Review Confidence (0.57)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.40 · 276 lines diff across 3 files
    0.40
    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%
    56%
    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.336
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #27582"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 56.8% 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: 39.6% (MEDIUM) · Higher = larger blast radius
    39.6%
    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: 56.8% · Lower = rushed or shallow review
    56.8%
    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.1% · Safe to merge
    17.1%