G
YouTube TikTok Games
Skip to content

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

Merged
FrankChen021 merged 1 commit into
apache:masterfrom
akasakariko:fix/tdigest-sketch-aggregation-reuse
Nov 5, 2026
Merged

FrankChen021 merged 1 commit into
apache:masterfrom
akasakariko:fix/tdigest-sketch-aggregation-reuse

Conversation

@akasakariko

Copy link
Copy Markdown
Contributor

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

@FrankChen021 FrankChen021 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No actionable issues found in this review. The reuse path correctly references the existing T-Digest aggregator through a field-access post-aggregator, and the regression test covers quantile-first planning and serialized sketch output.

Reviewed 2 of 2 changed files.

Validation: git diff --check passed; tests and builds were not run during this static review.


This is an automated review by Codex GPT-5.6-Luna(max)

@FrankChen021 FrankChen021 added the Approval Recommended Used when AI completes a review and reports no findings label Nov 4, 2026
@FrankChen021
FrankChen021 merged commit 32de6b9 into apache:master Nov 5, 2026
27 checks passed
akasakariko added a commit to akasakariko/akasakariko that referenced this pull request Nov 5, 2026
@github-actions github-actions Bot added this to the 40.0.0 milestone Nov 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Approval Recommended Used when AI completes a review and reports no findings

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TDIGEST_GENERATE_SKETCH fails with "Duplicate field name" after TDIGEST_QUANTILE on the same input

2 participants