You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by "gortiz (via GitHub)" <gi...@apache.org> on 2025/06/30 07:50:23 UTC

Re: [PR] Set groupsTrimmed result flag when data is trimmed. [pinot]

gortiz commented on code in PR #16220:
URL: https://github.com/apache/pinot/pull/16220#discussion_r2174446816


##########
pinot-core/src/main/java/org/apache/pinot/core/data/table/IndexedTable.java:
##########
@@ -270,6 +270,13 @@ public int getNumResizes() {
     return _numResizes;
   }
 
+  public boolean isTrimmed() {
+    // single resize occurs on finish() if there's orderBy
+    // all other re-sizes are triggered by trim size and threshold
+    int min = _topRecords != null && _hasOrderBy ? 1 : 0;
+    return _numResizes > min;
+  }

Review Comment:
   Don't you find easier to read something like
   
   ```suggestion
     public boolean isTrimmed() {
       if (_topRecords == null || !_hasOrderBy) {
         return false;
       }
       return _numResizes > 1;
     }
   ```



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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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