yiguolei commented on code in PR #66472:
URL: https://github.com/apache/doris/pull/66472#discussion_r3764188877
##########
be/src/storage/segment/segment_iterator.cpp:
##########
@@ -380,26 +376,20 @@ std::unique_ptr<AdaptiveBlockSizePredictor>
SegmentIterator::_make_block_size_pr
return nullptr;
}
- // Collect per-column raw byte metadata from the segment footer for the
columns
- // this iterator will actually output (defined by _schema, which is built
from
- // _opts.return_columns).
+ // Collect per-column raw byte metadata from the segment footer for the
visible Block
+ // columns. Delete-predicate suffix columns do not contribute to the
output byte budget.
uint32_t seg_rows = _segment->num_rows();
uint64_t total_raw_bytes = 0;
double metadata_hint_bytes_per_row = 0.0;
if (seg_rows > 0) {
- const auto& ts = _segment->tablet_schema();
- if (ts) {
- for (ColumnId cid : _schema->column_ids()) {
- if (static_cast<size_t>(cid) < ts->num_columns()) {
- int32_t uid = ts->column(cid).unique_id();
- uint64_t raw_bytes = _segment->column_raw_data_bytes(uid);
- if (uid >= 0 && raw_bytes > 0) {
- total_raw_bytes += raw_bytes;
- }
- }
+ for (size_t ordinal = 0; ordinal < _schema->num_block_columns();
++ordinal) {
+ const auto& col = _schema->columns()[ordinal];
+ int32_t uid = col->unique_id();
Review Comment:
你这里好像又假定了每个tablet column 是都有unique id的?此时这里如果read schema 中的某个列是virtual
column 或者 variant的sub column 这里的逻辑是不是不对了?
--
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]