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)

_field_name_to_index and _field_id_to_index is unnecessary for variant
subcolumns, since they use column path as identifier
  • Loading branch information
eldenmoon committed Nov 26, 2024
1 parent 5eb433e commit dcb70e0
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 @@ -993,9 +993,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 dcb70e0

Please sign in to comment.