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

   - Currently, Pinot's `MIN` / `MAX` aggregation functions only support 
numeric values using double based compute.
   - We want to start supporting polymorphic aggregations - i.e., `MIN` / `MAX` 
should also be able to support string columns, `MIN` on a `LONG` column 
shouldn't lose precision due to conversion to double etc.
   - https://github.com/apache/pinot/pull/16497 added `MINSTRING` / `MAXSTRING` 
aggregation functions but they need to be explicitly used which is clunky and 
not user friendly.
   - This patch adds a Calcite rule for MSE to automatically rewrite `MIN` / 
`MAX` on a string typed operand to `MINSTRING` / `MAXSTRING`. The patch also 
adds an optimizer rule to SSE that can rewrite `MIN` / `MAX` on a string type 
column - for now, complex expressions aren't supported for SSE because we don't 
have type information for the compiled query. This can be added as a future 
enhancement.
   - Future patches will also add optional rewrite rules for more type specific 
variants. For things like `SUM(intCol)` -> `SUMINT(intCol)` 
(https://github.com/apache/pinot/pull/16704) though, the rewrite will need to 
be gated behind a query option since it would break star-tree index support and 
could make existing queries run much slower. Similarly, `MIN(longCol)` -> 
`MINLONG` (not yet added) can't be done automatically by default since that 
would cause existing queries to stop using star-tree indexes.
   - The `MINSTRING` / `MAXSTRING` rewrites are safe to do automatically 
because `MIN` / `MAX` currently doesn't support `STRING` values.


-- 
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