xiangfu0 commented on code in PR #18662:
URL: https://github.com/apache/pinot/pull/18662#discussion_r3348371166


##########
pinot-core/src/main/java/org/apache/pinot/core/data/table/TableResizer.java:
##########
@@ -163,7 +170,7 @@ private OrderByValueExtractor 
getOrderByValueExtractor(ExpressionContext express
 
     int index = _filteredAggregationIndexMap.get(Pair.of(aggregation, filter));
     // For final aggregate result, we can handle it the same way as group key
-    return _hasFinalInput ? new 
GroupByExpressionExtractor(_numGroupByExpressions + index)
+    return _hasFinalInput ? new GroupByExpressionExtractor(_numKeyColumns + 
index)

Review Comment:
   GROUPING()/GROUPING_ID() are still broken in ORDER BY. 
PostAggregationHandler special-cases those functions, but TableResizer still 
sends any non-aggregation transform through PostAggregationFunctionExtractor, 
and there is no dedicated extractor here for grouping-set functions. A query 
like `... GROUP BY ROLLUP(d1, d2) ORDER BY GROUPING(d2)` can still fail when 
the indexed-table trim path builds its ORDER BY extractors. Please mirror the 
dedicated extractor here and add a regression test for ORDER BY 
GROUPING()/GROUPING_ID().



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