diff --git a/be/src/storage/rowset/rowset_writer.cpp b/be/src/storage/rowset/rowset_writer.cpp index ba65bc7c57d25..e083712e37b5a 100644 --- a/be/src/storage/rowset/rowset_writer.cpp +++ b/be/src/storage/rowset/rowset_writer.cpp @@ -210,6 +210,11 @@ StatusOr RowsetWriter::build() { } else { _rowset_meta_pb->set_rowset_state(VISIBLE); } + // we don't support light schema change for primary key table so far, skip it + if (_context.tablet_schema->keys_type() != KeysType::PRIMARY_KEYS) { + _context.tablet_schema->to_schema_pb(_rowset_meta_pb->mutable_tablet_schema()); + } + auto rowset_meta = std::make_shared(_rowset_meta_pb); RowsetSharedPtr rowset; RETURN_IF_ERROR( diff --git a/be/src/storage/rowset/segment.cpp b/be/src/storage/rowset/segment.cpp index c72da21f3fd84..87e494e74890c 100644 --- a/be/src/storage/rowset/segment.cpp +++ b/be/src/storage/rowset/segment.cpp @@ -236,7 +236,6 @@ StatusOr Segment::_new_iterator(const Schema& schema, const Se } if (!_column_readers.at(column_unique_id)->segment_zone_map_filter(pair.second)) { // skip segment zonemap filter when this segment has column files link to it. - const TabletColumn& tablet_column = _tablet_schema->column(column_id); if (tablet_column.is_key() || _use_segment_zone_map_filter(read_options)) { read_options.stats->segment_stats_filtered += _column_readers.at(column_unique_id)->num_rows(); return Status::EndOfFile(strings::Substitute("End of file $0, empty iterator", _fname)); diff --git a/gensrc/proto/olap_file.proto b/gensrc/proto/olap_file.proto index 130229d4ee608..b8f56448e84aa 100644 --- a/gensrc/proto/olap_file.proto +++ b/gensrc/proto/olap_file.proto @@ -144,8 +144,6 @@ message RowsetMetaPB { optional int64 num_segments = 22; // rowset id definition, it will replace required rowset id optional string rowset_id = 23; - // tablet meta pb, for compaction - optional TabletSchemaPB tablet_schema = 24; // to indicate whether the data between the segments overlap optional SegmentsOverlapPB segments_overlap_pb = 51 [default = OVERLAP_UNKNOWN]; // every segment in a rowset has an unique uint32 id @@ -168,6 +166,8 @@ message RowsetMetaPB { optional int64 total_update_row_size = 58; // true if it is generated by partial_schema_change optional bool partial_schema_change = 59; + // tablet meta pb, for compaction + optional TabletSchemaPB tablet_schema = 60; } enum DataFileType {