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

   - Fixes https://github.com/apache/pinot/issues/17105.
   - The issue is that the star-tree index is selected 
[here](https://github.com/apache/pinot/blob/563d8c621a86960ff427aa5c466346e77dc144f6/pinot-core/src/main/java/org/apache/pinot/core/startree/StarTreeUtils.java#L385-L435)
 (regardless of whether the column has null values or not), but then the 
aggregation function itself uses the non star-tree index count path 
[here](https://github.com/apache/pinot/blob/563d8c621a86960ff427aa5c466346e77dc144f6/pinot-core/src/main/java/org/apache/pinot/core/query/aggregation/function/CountAggregationFunction.java#L84-L107).
   - The fix here is two-fold: the most important one is to make sure the 
aggregation function always uses the star-tree index count path when the block 
val set map contains `STAR_TREE_COUNT_STAR_EXPRESSION`. The other fix is to 
make sure that the star-tree index isn't used when the aggregation function is 
`COUNT(col)` and the column actually contains null values. This check was being 
skipped earlier because [this code 
path](https://github.com/apache/pinot/blob/563d8c621a86960ff427aa5c466346e77dc144f6/pinot-segment-spi/src/main/java/org/apache/pinot/segment/spi/index/startree/AggregationFunctionColumnPair.java#L114-L116)
 always returns `COUNT(*)` regardless of the actual input expression.


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