Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion be/src/olap/rowset/segment_v2/segment_iterator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,8 @@ Status SegmentIterator::_get_row_ranges_by_column_conditions() {
RETURN_IF_ERROR(_apply_bitmap_index());
{
if (_opts.runtime_state &&
_opts.runtime_state->query_options().enable_inverted_index_query) {
_opts.runtime_state->query_options().enable_inverted_index_query &&
has_inverted_index_in_iterators()) {
SCOPED_RAW_TIMER(&_opts.stats->inverted_index_filter_timer);
size_t input_rows = _row_bitmap.cardinality();
RETURN_IF_ERROR(_apply_inverted_index());
Expand Down
5 changes: 5 additions & 0 deletions be/src/olap/rowset/segment_v2/segment_iterator.h
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,11 @@ class SegmentIterator : public RowwiseIterator {
return _inverted_index_iterators;
}

bool has_inverted_index_in_iterators() const {
return std::any_of(_inverted_index_iterators.begin(), _inverted_index_iterators.end(),
[](const auto& iterator) { return iterator != nullptr; });
}

private:
Status _next_batch_internal(vectorized::Block* block);

Expand Down