Jackie-Jiang commented on code in PR #14177:
URL: https://github.com/apache/pinot/pull/14177#discussion_r1794261371


##########
pinot-core/src/main/java/org/apache/pinot/core/startree/StarTreeUtils.java:
##########
@@ -363,15 +367,57 @@ public static BaseProjectOperator<?> 
createStarTreeBasedProjectOperator(IndexSeg
     if (aggregationFunctionColumnPairs == null) {
       return null;
     }
+
     Map<String, List<CompositePredicateEvaluator>> predicateEvaluatorsMap =
         extractPredicateEvaluatorsMap(indexSegment, filter, 
predicateEvaluators);
     if (predicateEvaluatorsMap == null) {
       return null;
     }
+
     ExpressionContext[] groupByExpressions =
         queryContext.getGroupByExpressions() != null ? 
queryContext.getGroupByExpressions()
             .toArray(new ExpressionContext[0]) : null;
 
+    if (queryContext.isNullHandlingEnabled()) {
+      // We can still use the star-tree index if there aren't actually any 
null values in this segment for all the
+      // metrics being aggregated, all the dimensions being filtered on / 
grouped by.
+      for (AggregationFunctionColumnPair aggregationFunctionColumnPair : 
aggregationFunctionColumnPairs) {
+        String column = aggregationFunctionColumnPair.getColumn();
+        if (column.equals(AggregationFunctionColumnPair.STAR)) {
+          // Null handling is irrelevant for COUNT(*)
+          continue;
+        }
+
+        DataSource dataSource = indexSegment.getDataSource(column);

Review Comment:
   ```suggestion
           if (aggregationFunctionColumnPair == 
AggregationFunctionColumnPair.COUNT_STAR) {
             // Null handling is irrelevant for COUNT(*)
             continue;
           }
   
           String column = aggregationFunctionColumnPair.getColumn();
           DataSource dataSource = indexSegment.getDataSource(column);
   ```



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