anuragrai16 commented on code in PR #18475:
URL: https://github.com/apache/pinot/pull/18475#discussion_r3414781881
##########
pinot-core/src/main/java/org/apache/pinot/core/operator/query/DistinctOperator.java:
##########
@@ -60,6 +61,12 @@ protected DistinctResultsBlock getNextBlock() {
ValueBlock valueBlock;
while ((valueBlock = _projectOperator.nextBlock()) != null) {
_numDocsScanned += valueBlock.getNumDocs();
+ QueryScanCostContext scanCost = getScanCostContext();
+ if (scanCost != null) {
+ scanCost.addDocsScanned(valueBlock.getNumDocs());
+ scanCost.addEntriesScannedPostFilter(
+ (long) valueBlock.getNumDocs() *
_projectOperator.getNumColumnsProjected());
+ }
Review Comment:
This might not be extensible in the future with more and more metrics
tracked as part of the scan cost. Each operator might contribute a different
set of scan cost and we might end up with multiple overloaded functions for
each combination.
--
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]