github-actions[bot] commented on code in PR #64413:
URL: https://github.com/apache/doris/pull/64413#discussion_r3410694010
##########
be/src/exec/scan/olap_scanner.cpp:
##########
@@ -716,17 +712,21 @@ Status OlapScanner::_init_return_columns() {
if (slot->get_virtual_column_expr()) {
ColumnId virtual_column_cid = index;
_virtual_column_exprs[virtual_column_cid] =
_slot_id_to_virtual_column_expr[slot->id()];
- size_t idx_in_block = _slot_id_to_index_in_block[slot->id()];
- _vir_cid_to_idx_in_block[virtual_column_cid] = idx_in_block;
- _vir_col_idx_to_type[idx_in_block] =
_slot_id_to_col_type[slot->id()];
-
- VLOG_DEBUG << fmt::format(
- "Virtual column, slot id: {}, cid {}, column index: {},
type: {}", slot->id(),
- virtual_column_cid,
_vir_cid_to_idx_in_block[virtual_column_cid],
- _vir_col_idx_to_type[idx_in_block]->get_name());
+
+ VLOG_DEBUG << fmt::format("Virtual column, slot id: {}, cid {},
type: {}", slot->id(),
+ virtual_column_cid,
slot->get_data_type_ptr()->get_name());
}
const auto& column = tablet_schema->column(index);
+ auto* olap_local_state =
static_cast<OlapScanLocalState*>(_local_state);
+ const auto& olap_scan_node = olap_local_state->olap_scan_node();
Review Comment:
This shortcut also applies to row-binlog readers, which is not safe.
`computeStorageAlignedScanSlots()` runs before incremental stream scans are
wrapped as `RowBinlogTableWrapper`, so an aligned-key base table stream can
mark pruned base key slots as filled. For a single-version row-binlog scan
`direct_mode` is true, which puts those key cids into `filled_columns`;
`SegmentIterator` then inserts defaults instead of reading the real key values.
MIN_DELTA/DETAIL row-binlog readers force key-ordered reads and
`_min_delta_next_block()` relies on those key columns via
`IteratorRowRef::is_same` to group changes by the real storage key. With
defaults, changes for different keys can compare as the same key and be
collapsed or ordered incorrectly. Please keep row-binlog keys real, for example:
```suggestion
if (_tablet_reader_params.direct_mode &&
_tablet_reader_params.reader_type !=
ReaderType::READER_BINLOG) {
```
--
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]