yiguolei commented on code in PR #66472:
URL: https://github.com/apache/doris/pull/66472#discussion_r3764222438
##########
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) {
Review Comment:
你这里应该没有包含delete 谓词的column,好像就跟之前的逻辑不一样了。 我觉得这个也没问题,但是你得写一个注释说明一下
##########
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();
+ if (uid >= 0) {
+ total_raw_bytes += _segment->column_raw_data_bytes(uid);
Review Comment:
variant 是咋算的?
--
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]