Skip to content
Closed
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
2 changes: 2 additions & 0 deletions be/src/olap/iterators.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ class StorageReadOptions {
int block_row_max = 4096 - 32; // see https://github.com/apache/doris/pull/11816

TabletSchemaSPtr tablet_schema = nullptr;
// for unique key merge on write
bool enable_unique_key_merge_on_write = false;
bool record_rowids = false;
// flag for enable topn opt
bool use_topn_opt = false;
Expand Down
2 changes: 2 additions & 0 deletions be/src/olap/rowset/beta_rowset_reader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,8 @@ Status BetaRowsetReader::get_segment_iterators(RowsetReaderContext* read_context
}
_read_options.use_page_cache = _read_context->use_page_cache;
_read_options.tablet_schema = _read_context->tablet_schema;
_read_options.enable_unique_key_merge_on_write =
_read_context->enable_unique_key_merge_on_write;
_read_options.record_rowids = _read_context->record_rowids;
_read_options.use_topn_opt = _read_context->use_topn_opt;
_read_options.read_orderby_key_reverse = _read_context->read_orderby_key_reverse;
Expand Down
6 changes: 4 additions & 2 deletions be/src/olap/rowset/segment_v2/segment_iterator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1042,10 +1042,12 @@ Status SegmentIterator::_apply_inverted_index_on_block_column_predicate(
}

bool SegmentIterator::_need_read_data(ColumnId cid) {
// for safety reason, only support DUP_KEYS
if (_opts.tablet_schema->keys_type() != KeysType::DUP_KEYS) {
if (_opts.tablet_schema->keys_type() != KeysType::DUP_KEYS &&
!(_opts.tablet_schema->keys_type() == UNIQUE_KEYS &&
_opts.enable_unique_key_merge_on_write)) {
return true;
}

if (_output_columns.count(-1)) {
// if _output_columns contains -1, it means that the light
// weight schema change may not be enabled or other reasons
Expand Down