Jackie-Jiang commented on code in PR #14700:
URL: https://github.com/apache/pinot/pull/14700#discussion_r1898191014


##########
pinot-core/src/main/java/org/apache/pinot/core/common/BlockDocIdSet.java:
##########
@@ -78,4 +85,10 @@ default BlockDocIdSet toNonScanDocIdSet() {
 
     return this;
   }
+
+  enum CardinalityEstimate {

Review Comment:
   Consider changing it to `isAlwaysTrue()` and `isAlwaysFalse()`, which is 
similar to `PredicateEvaluator`



##########
pinot-core/src/main/java/org/apache/pinot/core/operator/docidsets/BitmapDocIdSet.java:
##########
@@ -43,4 +46,13 @@ public BitmapDocIdIterator iterator() {
   public long getNumEntriesScannedInFilter() {
     return 0L;
   }
+
+  @Override
+  public CardinalityEstimate getCardinalityEstimate() {
+    if (_bitmap == null) {
+      return CardinalityEstimate.UNKNOWN;
+    }
+    // If cardinality exceeds 0, return unknown, because we don't want to 
inspect each highLowContainer.
+    return _bitmap.cardinalityExceeds(0L) ? CardinalityEstimate.UNKNOWN : 
CardinalityEstimate.MATCHES_NONE;

Review Comment:
   `_bitmap.isEmpty()` should be faster



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to