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

   Pinot supports max and min for numbers, but not for other comparable types 
like Strings. The main reason is that aggregate functions are not polymorphic, 
and SSE doesn't keep types at runtime. This is why, for example, functions like 
`last_with_time` require an extra argument indicating the type of the projected 
column.
   
   Here I'm using the same technique, adding two new aggregate functions: min2 
and max2, which expect 2 arguments:
   1. The first argument is the expression to minimize/maximize (same as used 
by min and max)
   2. The second is the type of that expression. Right now, only number type 
literals (`'int'`, `'double'`, etc) and `'string'` are accepted. In case of a 
number, we use the same code used in min and max. In case `'string'` is used, a 
newly introduced aggregation function is used.
   
   This is a hack. It is not great to force clients to specify a type Pinot 
should know. In the future, we should modify aggregate functions to be 
polymorphic, similar to what we did with scalar functions.


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