mrhhsg commented on code in PR #68125:
URL: https://github.com/apache/doris/pull/68125#discussion_r4260601808
##########
be/src/storage/segment/segment_iterator.cpp:
##########
@@ -1802,6 +1804,12 @@ Status SegmentIterator::_init_index_iterators() {
// Inverted index iterators
Review Comment:
Addressed the remaining part in 7150f5a25af: already-built placeholder
indexes are now recognized and ignored at read time.
The index content is the provenance. A single-version rowset serves
`VERSION`/`COMMIT_TSO` through the `ConstantColumnReader` and opens no physical
index, so a physical index iterator on these columns belongs to a multi-version
rowset, whose column storage holds the values compaction materialized: the
first load publishes version 2 and a commit TSO is positive, so no materialized
row is 0. A build that read with the default options indexed the placeholder 0
for every row instead. `SegmentIterator::_drop_placeholder_hidden_column_index`
therefore probes such an index once with `= 0` when `_init_index_iterators`
opens it; an index that reports every row of the segment is dropped with a
warning naming the rowset, and the predicates evaluate the stored values (both
the column-predicate and the expression paths share `_index_iterators`). The
only correct index that is also all zeros covers a rowset whose stored values
are all 0 (a never-assigned `COMMIT_TSO`), where reading the column
gives the same answer. Ordinary columns and single-version rowsets are
untouched.
Tests:
`SegmentIteratorExprZonemapTest.RangeVersionIgnoresPlaceholderInvertedIndex`
writes a segment whose column holds versions 2/3 and whose inverted index holds
0 for every row; reading `[2-3]` with `VERSION = 3` returns the 4096 version-3
rows with `rows_inverted_index_filtered == 0`, while
`RangeVersionUsesMaterializedInvertedIndex` keeps a correct index in use
(`rows_inverted_index_filtered == 4096`).
`test_build_index_read_time_hidden_column` rebuilds the index under a new
`IndexBuilder` debug point that keeps the default read options (the legacy
build), then checks exact results for `= 3` / `in (2, 6)` and
`RowsInvertedIndexFiltered == 0` in the profile.
--
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]