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


##########
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:
   That doesn't seem to be a safe rewrite. It should be rather :
   ```java
     public boolean isTrimmed() {
       if (_topRecords == null || !_hasOrderBy) {
         return _numResizes > 0;
       }
       return _numResizes > 1;
     }
   ```
   because table could've been trimmed even if there's no order by, and method 
is executed before finish().  
   
   I don't feel one is visibly better than the other, so feel free to commit 
the suggestion (after fixing the return). 



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