egalpin commented on PR #11886:
URL: https://github.com/apache/pinot/pull/11886#issuecomment-1797101125

   @xiangfu0 @Jackie-Jiang This can now be considered ready for review, as it's 
operationally functional.  I'll add tests, but wanted to flag that this is 
ready for review in case that helps with velocity etc.  See screen shots below 
for examples.
   
   I noticed that this feature also provides an additional enhancement: being 
able to abuse `FILTER` aggs to allow queries to solve any agg which might be 
solvable via ST index even if one of the aggs in the query must be solved 
without the ST.  This isn't currently possible; currently, all aggs must be 
solvable by the ST in order to proceed with its use.  
   
   Take for example the airlineStats example data.  The following query would 
utilize ST:
   
   ```SQL
   select
     AirlineID,
     MAX(ArrDelay) as max_delay
   FROM airlineStats
   GROUP BY AirlineID
   ```
   
   However, this would not (because `MIN` is not in the ST):
   
   ```SQL
   select
     AirlineID,
     MAX(ArrDelay) as max_delay,
     MIN(ArrDelay)
   FROM airlineStats
   GROUP BY AirlineID
   ```
   
   After this change, one could rewrite the query like so:
   
   ```SQL
   select
     AirlineID,
     MAX(ArrDelay) FILTER (WHERE AirlineID != -1) AS max_delay,
     MIN(ArrDelay)
   FROM airlineStats
   GROUP BY AirlineID
   ```
   
   This would allow the `MAX` to leverage the ST.


-- 
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: commits-unsubscr...@pinot.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org
For additional commands, e-mail: commits-h...@pinot.apache.org

Reply via email to