Skip to content

Commit

Permalink
[Fix](Variant) variant fallthrough with inverted index
Browse files Browse the repository at this point in the history
When reading from segment, the schema type is variant, if we check type valid in `get_inverted_index`, the result should always return nullptr(since variant type it self does not support inverted index), but the actual storage could be `string` or etc.So we should ignore the type check and return the correct inverted index iterators
  • Loading branch information
eldenmoon committed Aug 28, 2024
1 parent b5269f7 commit 9c29378
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 3 deletions.
7 changes: 6 additions & 1 deletion be/src/olap/rowset/segment_v2/segment_iterator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1488,10 +1488,15 @@ Status SegmentIterator::_init_inverted_index_iterators() {
}
for (auto cid : _schema->column_ids()) {
if (_inverted_index_iterators[cid] == nullptr) {
// Not check type valid, since we need to get inverted index for related variant type when reading the segment.
// If check type valid, we can not get inverted index for variant type, and result nullptr.The result for calling
// get_inverted_index with variant suffix should return corresponding inverted index meta.
bool check_inverted_index_by_type = false;
// Use segment’s own index_meta, for compatibility with future indexing needs to default to lowercase.
RETURN_IF_ERROR(_segment->new_inverted_index_iterator(
_opts.tablet_schema->column(cid),
_segment->_tablet_schema->get_inverted_index(_opts.tablet_schema->column(cid)),
_segment->_tablet_schema->get_inverted_index(_opts.tablet_schema->column(cid),
check_inverted_index_by_type),
_opts, &_inverted_index_iterators[cid]));
}
}
Expand Down
Loading

0 comments on commit 9c29378

Please sign in to comment.