diff --git a/be/src/olap/rowset/segment_v2/segment.cpp b/be/src/olap/rowset/segment_v2/segment.cpp index 90a8f9b447efcf..b56d607c855edd 100644 --- a/be/src/olap/rowset/segment_v2/segment.cpp +++ b/be/src/olap/rowset/segment_v2/segment.cpp @@ -229,6 +229,8 @@ Status Segment::load_index() { } Status Segment::_create_column_readers() { + std::unordered_map _column_id_to_footer_ordinal; + for (uint32_t ordinal = 0; ordinal < _footer.columns().size(); ++ordinal) { auto& column_pb = _footer.columns(ordinal); _column_id_to_footer_ordinal.emplace(column_pb.unique_id(), ordinal); diff --git a/be/src/olap/rowset/segment_v2/segment.h b/be/src/olap/rowset/segment_v2/segment.h index 461c3ba94516c1..00d3b906bb5f12 100644 --- a/be/src/olap/rowset/segment_v2/segment.h +++ b/be/src/olap/rowset/segment_v2/segment.h @@ -133,11 +133,6 @@ class Segment : public std::enable_shared_from_this { int64_t _meta_mem_usage; SegmentFooterPB _footer; - // Map from column unique id to column ordinal in footer's ColumnMetaPB - // If we can't find unique id from it, it means this segment is created - // with an old schema. - std::unordered_map _column_id_to_footer_ordinal; - // map column unique id ---> column reader // ColumnReader for each column in TabletSchema. If ColumnReader is nullptr, // This means that this segment has no data for that column, which may be added