richardstartin commented on a change in pull request #8411:
URL: https://github.com/apache/pinot/pull/8411#discussion_r837779005
##########
File path:
pinot-core/src/main/java/org/apache/pinot/core/operator/filter/AndFilterOperator.java
##########
@@ -45,6 +47,39 @@ protected FilterBlock getNextBlock() {
return new FilterBlock(new AndDocIdSet(filterBlockDocIdSets));
}
+ @Override
+ public boolean canOptimizeCount() {
+ boolean allChildrenCanProduceBitmaps = true;
+ for (BaseFilterOperator child : _filterOperators) {
+ allChildrenCanProduceBitmaps &= (child.isResultMatchingAll() |
child.canProduceBitmaps());
+ }
+ return allChildrenCanProduceBitmaps;
+ }
+
+ @Override
+ public int getNumMatchingDocs() {
+ List<BitmapCollection> children = new ArrayList<>(_filterOperators.size());
+ for (BaseFilterOperator child : _filterOperators) {
+ if (!child.isResultMatchingAll()) {
+ children.add(child.getBitmaps());
+ }
+ }
+ switch (children.size()) {
+ case 0:
+ return _filterOperators.get(0).getNumMatchingDocs();
+ case 1:
+ return children.get(0).cardinality();
Review comment:
They are impossible to reach at present.
--
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]