csun5285 commented on code in PR #67642:
URL: https://github.com/apache/doris/pull/67642#discussion_r3999758319
##########
be/src/storage/segment/segment.cpp:
##########
@@ -143,11 +143,22 @@ Status build_segment_zonemap_context(Segment* segment,
const ReadSchema& schema,
return Status::OK();
}
-// The statistics iterator answers pushed-down aggregates from the segment
zone maps alone. An
-// invalid zone map has no min/max to answer with, so the caller has to read
the data instead.
+// Statistics collection reads the zone map as it is, even when its min/max is
not a value the data
+// holds right now: the bound may have been cut, or it may still cover rows a
delete predicate
+// removed. An approximation is all it needs, and reading the rows instead
would scan the whole
+// table. Every other query needs the real value. Without a runtime state,
keep what the segment
+// did before.
+bool accepts_inexact_min_max(const StorageReadOptions& read_options) {
+ return read_options.runtime_state == nullptr ||
Review Comment:
这个是防御性代码
--
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]