kishoreg commented on a change in pull request #4602: First pass of GROUP BY 
with ORDER BY support
URL: https://github.com/apache/incubator-pinot/pull/4602#discussion_r324411445
 
 

 ##########
 File path: 
pinot-core/src/main/java/org/apache/pinot/core/data/table/ConcurrentIndexedTable.java
 ##########
 @@ -101,31 +108,51 @@ public int size() {
 
   @Override
   public Iterator<Record> iterator() {
+    if (_sort && CollectionUtils.isNotEmpty(_orderBy)) {
+      List<Record> sortedList = new ArrayList<>(_lookupMap.values());
+      sortedList.sort(_orderByComparator);
+      return sortedList.iterator();
+    }
     return _lookupMap.values().iterator();
   }
 
   private void resize(int trimToSize) {
 
     if (_lookupMap.size() > trimToSize) {
 
 Review comment:
   collect some metrics in this table such as num resizes, time taken to resize 
etc that can be printed/emitted in finish method to understand the perf 
bottlenecks

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org
For additional commands, e-mail: commits-h...@pinot.apache.org

Reply via email to