eldenmoon commented on code in PR #28736:
URL: https://github.com/apache/doris/pull/28736#discussion_r1432535522


##########
be/src/olap/rowset/rowset_meta.cpp:
##########
@@ -94,7 +97,29 @@ void RowsetMeta::set_fs(io::FileSystemSPtr fs) {
 void RowsetMeta::to_rowset_pb(RowsetMetaPB* rs_meta_pb) const {
     *rs_meta_pb = _rowset_meta_pb;
     if (_schema) {
-        _schema->to_schema_pb(rs_meta_pb->mutable_tablet_schema());
+        std::string schema_pb_key;
+        std::shared_ptr<TabletSchemaPB> cached_schema_pb;
+        // we cannot use schema_pb cache in variant schema or schema_version 
not set
+        if (_schema->num_variant_columns() == 0 && _schema->schema_version() > 
0) {

Review Comment:
   maybe we could capsulate the logical whether to use schema cache or not in a 
schema_cache function



##########
be/src/olap/tablet_meta.cpp:
##########
@@ -633,7 +638,30 @@ void TabletMeta::to_meta_pb(TabletMetaPB* tablet_meta_pb) {
     for (auto rs : _stale_rs_metas) {
         rs->to_rowset_pb(tablet_meta_pb->add_stale_rs_metas());
     }
-    _schema->to_schema_pb(tablet_meta_pb->mutable_schema());
+
+    std::string schema_pb_key;
+    std::shared_ptr<TabletSchemaPB> cached_schema_pb;
+    // we cannot use schema_pb cache in variant schema or schema_version not 
set
+    if (_schema->num_variant_columns() == 0 && _schema->schema_version() > 0) {

Review Comment:
   diplicated logic?



-- 
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]

Reply via email to