github-actions[bot] commented on code in PR #67341:
URL: https://github.com/apache/doris/pull/67341#discussion_r3893915383


##########
be/src/storage/segment/segment.cpp:
##########
@@ -143,6 +143,34 @@ 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.
+Status segment_zone_maps_can_answer_agg(Segment* segment, const ReadSchema& 
schema,
+                                        const StorageReadOptions& 
read_options, bool* usable) {
+    *usable = true;
+    for (size_t ordinal = 0; ordinal < schema.num_block_columns(); ++ordinal) {
+        std::shared_ptr<ColumnReader> reader;
+        Status st = segment->get_column_reader(*schema.column(ordinal), 
&reader, read_options.stats,

Review Comment:
   This lookup now runs before `VStatisticsIterator::init`, but it omits the 
read-time constant that `new_column_iterator` supplies for 
`__DORIS_COMMIT_TSO_COL__`. Because `ColumnReaderCache` is keyed only by 
UID/path, a cold predicate-free `SELECT MAX(__DORIS_COMMIT_TSO_COL__)` (the 
existing time-travel regression issues this with hidden columns enabled) caches 
the physical `[0,0]` placeholder here; the later statistics iterator hits that 
entry and returns `0` instead of the rowset commit TSO. The same poisoned entry 
also survives a normal-iterator fallback. Please make this preflight use the 
same context-aware reader construction, or inspect validity without populating 
the context-free cache, and add a cold-cache `Segment::new_iterator` regression 
for this ordering.



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