richardstartin commented on a change in pull request #7450:
URL: https://github.com/apache/pinot/pull/7450#discussion_r712465217



##########
File path: 
pinot-core/src/main/java/org/apache/pinot/core/operator/combine/GroupByOrderByCombineOperator.java
##########
@@ -125,43 +123,44 @@ public String getOperatorName() {
    */
   @Override
   protected void processSegments(int threadIndex) {
-    try {
-      IntermediateResultsBlock intermediateResultsBlock =
-          (IntermediateResultsBlock) _operators.get(threadIndex).nextBlock();
-
-      _initLock.lock();
-      try {
-        if (_dataSchema == null) {
-          _dataSchema = intermediateResultsBlock.getDataSchema();
-          // NOTE: Use trimSize as resultSize on server size.
-          if (_trimThreshold >= MAX_TRIM_THRESHOLD) {
-            // special case of trim threshold where it is set to max value.
-            // there won't be any trimming during upsert in this case.
-            // thus we can avoid the overhead of read-lock and write-lock
-            // in the upsert method.
-            _indexedTable = new UnboundedConcurrentIndexedTable(_dataSchema, 
_queryContext, _trimSize);
-          } else {
-            _indexedTable =
-                new ConcurrentIndexedTable(_dataSchema, _queryContext, 
_trimSize, _trimSize, _trimThreshold);
+    for (int operatorIndex = threadIndex; operatorIndex < _numOperators; 
operatorIndex += _numThreads) {
+      IntermediateResultsBlock resultsBlock = (IntermediateResultsBlock) 
_operators.get(operatorIndex).nextBlock();
+
+      if (_indexedTable == null) {
+        _initLock.lock();
+        try {
+          if (_indexedTable == null) {

Review comment:
       Having said that, `IndexedTable` is _mostly_ immutable so it might be ok 
in practice 
https://github.com/apache/pinot/blob/f3068bc93165e359cc3d846c40f62312ecc98af3/pinot-core/src/main/java/org/apache/pinot/core/data/table/IndexedTable.java#L39L46
   
   (I think this can be resolved)




-- 
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-unsubscr...@pinot.apache.org

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