Add schema-bound polymorphic aggregation across query engines - #19523
Open
xiangfu0 wants to merge 1 commit into
Open
Add schema-bound polymorphic aggregation across query engines#19523xiangfu0 wants to merge 1 commit into
xiangfu0 wants to merge 1 commit into
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #19523 +/- ##
============================================
+ Coverage 67.72% 67.88% +0.15%
Complexity 1430 1430
============================================
Files 3489 3499 +10
Lines 224634 225772 +1138
Branches 35468 35747 +279
============================================
+ Hits 152130 153256 +1126
+ Misses 60485 60408 -77
- Partials 12019 12108 +89
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.
Polymorphic aggregates currently rely on fixed result types, explicit SQL type arguments, or types discovered from data blocks. This makes empty responses unreliable and can lose logical BOOLEAN/TIMESTAMP types between planning, execution, and reduction.
This change resolves argument and result types once from the input schema and carries an immutable binding through SSE requests and MSE plans. Aggregation providers are discovered through
ServiceLoader, so another declared polymorphic aggregate can supply its type rule and implementation without adding factory, planner-stage, or reducer switch branches.FIRST_WITH_TIME/LAST_WITH_TIMEand one-argumentARRAY_AGG, with an optional boolean distinct argument.MODE,ANY_VALUE, and the existing SSEEXPR_MIN/EXPR_MAXrewrite.LIMIT 0. Read older physical segment types through the bound type's conversion getters.pinot-core/README.md.Existing explicit-type FIRST/LAST and ARRAY_AGG forms remain supported. Numeric MODE keeps its DOUBLE result and AVG tie reducer; fixed numeric aggregate contracts are unchanged. Existing calls retain legacy execution when a native transform has no schema-only type rule; the new inferred overloads require resolvable input metadata. Binding fields are optional, but the new inferred overloads and logical-type semantics require upgraded brokers and execution workers. Public ExprMin/Max execution remains SSE-only through its existing configured rewrite.
Validation: 577 focused tests across 39 classes passed in the final reactor run, including both planners, all three MSE fixture execution modes, raw/dictionary segments, distributed merges, null/empty results, and broker-only responses. Spotless, Checkstyle, and license checks passed on all six affected modules. Compilation with warnings enabled used JDK 25 and a local classpath workaround for the missing JetBrains annotation dependency in unchanged compression code; no project dependency was changed. CI and maintainer review are pending.