Support string and timestamp MODE aggregations - #19489
Open
xiangfu0 wants to merge 8 commits into
Open
Conversation
xiangfu0
marked this pull request as ready for review
September 7, 2026 09:54
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #19489 +/- ##
=============================================
+ Coverage 39.44% 67.75% +28.31%
- Complexity 1429 1430 +1
=============================================
Files 3488 3489 +1
Lines 224424 224831 +407
Branches 35429 35524 +95
=============================================
+ Hits 88528 152341 +63813
+ Misses 127912 60435 -67477
- Partials 7984 12055 +4071
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Extend the existing
ModeAggregationFunctionto support STRING and TIMESTAMP automatically with ordinaryMODE(value)syntax.AggregationFunctionType.inferArgumentssupplies inferred arguments through the existing single-stage aggregate optimizer and multi-stage aggregate conversion paths. No function-specific optimizer or planner rule is needed. Complete frequency maps survive distributed stages, and timestamp milliseconds remain exact. Numeric MODE retains DOUBLE results and its existing reducers.STRING and TIMESTAMP support MIN (default) or MAX ties; AVG is rejected. With null handling enabled, nulls are skipped and empty/all-null typed aggregates return null. Scope is grouped/global MODE, shared argument inference, and focused regression tests.
Validation: 79 OSS JVM tests pass: 56 MODE aggregation cases, eight single-stage inference cases, five planner cases, nine distributed query cases, and the existing explain-plan integration test. Coverage includes both physical planners, direct aggregation, grouping sets, and unchanged legacy rewrite options. Formatting, Checkstyle, and license checks pass on affected modules. The extra compiler-warning build could not complete because an unchanged compression dependency references an unavailable
org.jetbrains.annotations.NotNull; the standard source build and tests pass.