Skip to content

Commit

Permalink
[opt](Variant) avoid unnecessary mem for variant extracted columns (#…
Browse files Browse the repository at this point in the history
…43567) (#43620)

(#43567)

Co-authored-by: eldenmoon <[email protected]>
  • Loading branch information
lihangyu and eldenmoon authored Nov 11, 2024
1 parent a78b722 commit ff6ec6c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions be/src/olap/tablet_schema.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1000,9 +1000,12 @@ void TabletSchema::init_from_pb(const TabletSchemaPB& schema, bool ignore_extrac
if (column->is_variant_type()) {
++_num_variant_columns;
}

_cols.emplace_back(std::move(column));
_field_name_to_index.emplace(StringRef(_cols.back()->name()), _num_columns);
_field_id_to_index[_cols.back()->unique_id()] = _num_columns;
if (!_cols.back()->is_extracted_column()) {
_field_name_to_index.emplace(StringRef(_cols.back()->name()), _num_columns);
_field_id_to_index[_cols.back()->unique_id()] = _num_columns;
}
_num_columns++;
}
for (auto& index_pb : schema.index()) {
Expand Down

0 comments on commit ff6ec6c

Please sign in to comment.