xiangfu0 opened a new pull request, #19523:
URL: https://github.com/apache/pinot/pull/19523

   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.
   
   - Support inferred two-argument `FIRST_WITH_TIME`/`LAST_WITH_TIME` and 
one-argument `ARRAY_AGG`, with an optional boolean distinct argument.
   - Preserve logical types for nonnumeric `MODE`, `ANY_VALUE`, and the 
existing SSE `EXPR_MIN`/`EXPR_MAX` rewrite.
   - Keep bindings through expression overrides, gapfill, grouping, 
post-aggregation, broker-pruned responses, and `LIMIT 0`. Read older physical 
segment types through the bound type's conversion getters.
   - Preserve null projections and all tied rows in serialized ExprMin/Max 
merges; add the extension guide in `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.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to