github-actions[bot] commented on code in PR #68125:
URL: https://github.com/apache/doris/pull/68125#discussion_r4048040978
##########
be/src/storage/segment/segment.cpp:
##########
@@ -149,11 +160,13 @@ Status segment_zone_maps_can_answer_agg(Segment* segment,
const ReadSchema& sche
const StorageReadOptions&
read_options, bool* usable) {
*usable = true;
for (size_t ordinal = 0; ordinal < schema.num_block_columns(); ++ordinal) {
- // The commit-tso column is only served correctly once its reader is
created with the
- // rowset's commit_tso as a const value. Creating it here without one
would cache a reader
- // that hands every later read the on-disk placeholder instead.
- if (static_cast<int32_t>(ordinal) == schema.commit_tso_ordinal()) {
- continue;
+ // VStatisticsIterator reads physical segment ZoneMaps. Read-time
hidden columns contain
+ // placeholders there, so let SegmentIterator materialize their
logical values instead.
+ if
(segment->get_read_time_constant_value(static_cast<int32_t>(ordinal), schema,
+ read_options)
Review Comment:
This PR makes option-bearing logical readers bypass the UID cache, so
`VStatisticsIterator` can now reliably obtain a fresh `ConstantColumnReader`
for an assigned singleton COMMIT_TSO and answer MIN/MAX with two logical rows.
This blanket branch immediately disables that path: the default DUP-table query
`MAX(__DORIS_COMMIT_TSO_COL__)` used to obtain time-travel snapshots falls back
to `SegmentIterator`, which materializes the constant once per selected row
across every rowset—O(rows) work instead of metadata-only work. Please preserve
the statistics iterator for COMMIT_TSO (or make it consume the shared logical
constant for every supported hidden type) while retaining the fallback for
values it cannot synthesize, and add an iterator-selection/row-count test.
--
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]