kishoreg commented on issue #6028:
URL: 
https://github.com/apache/incubator-pinot/issues/6028#issuecomment-694310325


   ```
    private void setGroupByResults(BrokerResponseNative brokerResponseNative, 
Collection<DataTable> dataTables) {
   
       // Merge results from all data tables.
       String[] columnNames = new String[_numAggregationFunctions];
       Map<String, Object>[] intermediateResultMaps = new 
Map[_numAggregationFunctions];
       if (_numGroupByExpressions == 1) {
         for (DataTable dataTable : dataTables) {
           for (int i = 0; i < _numAggregationFunctions; i++) {
             if (columnNames[i] == null) {
               columnNames[i] = dataTable.getString(i, 0);
               intermediateResultMaps[i] = dataTable.getObject(i, 1);
             } else {
               mergeResultMap(intermediateResultMaps[i], dataTable.getObject(i, 
1), _aggregationFunctions[i]);
             }
           }
         }
       } else {
         for (DataTable dataTable : dataTables) {
           for (int i = 0; i < _numAggregationFunctions; i++) {
             if (columnNames[i] == null) {
               columnNames[i] = dataTable.getString(i, 0);
               intermediateResultMaps[i] = 
convertLegacyGroupKeyDelimiter(dataTable.getObject(i, 1));
             } else {
               mergeResultMap(intermediateResultMaps[i], 
convertLegacyGroupKeyDelimiter(dataTable.getObject(i, 1)),
                   _aggregationFunctions[i]);
             }
           }
         }
       }
   ```
   
   Yes, it is single threaded. It's fine in most cases but we can definitely 
make it multi-threaded for the group by queries since the work done by the 
broker can be substantial 


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



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

Reply via email to