gianm commented on code in PR #19726:
URL: https://github.com/apache/druid/pull/19726#discussion_r3636519918


##########
processing/src/main/java/org/apache/druid/segment/QueryableIndexCursorFactory.java:
##########
@@ -251,6 +286,19 @@ private CursorHolder makeMultiGroupClusteredCursorHolder(
       );
     }
 
+    // Time-ordered merge path: when the query asks for __time ordering AND 
__time is the first non-clustering column
+    // (so each group, whose clustering prefix is constant, is individually 
__time-sorted), present a globally
+    // __time-ordered cursor via a k-way merge across the groups instead of 
the (clustering-first) concatenation. The
+    // per-group build spec carries the query's preferred ordering through 
rebuildCursorBuildSpec, so each group cursor
+    // independently honors the requested direction (ascending, or descending 
via a reversed offset).

Review Comment:
   IMO a comment is not needed. The code is self-explanatory, and will be even 
more so if the remainder of the method is moved to 
`makeConcatenatedClusteredCursorHolder`. If you want a comment, try:
   
   ```java
   // Use k-way merged group cursors for time ordering, or concatenated cursors 
otherwise.
   ```



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