You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by "Jackie-Jiang (via GitHub)" <gi...@apache.org> on 2024/10/09 21:39:04 UTC
Re: [PR] Allow usage of star-tree index with null handling enabled when no null values in segment columns [pinot]
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-unsubscribe@pinot.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org