csun5285 commented on code in PR #66472:
URL: https://github.com/apache/doris/pull/66472#discussion_r3763212301


##########
be/src/storage/schema.h:
##########
@@ -37,110 +39,181 @@
 
 namespace doris {
 
-// The class is used to represent row's format in memory.  Each row contains
-// multiple columns, some of which are key-columns (the rest are 
value-columns).
-// NOTE: If both key-columns and value-columns exist, then the key-columns
-// must be placed before value-columns.
-//
-// To compare two rows whose schemas are different, but they are from the same 
origin
-// we store all column schema maybe accessed here. And default access through 
column id
-class Schema;
-using SchemaSPtr = std::shared_ptr<const Schema>;
-class Schema {
+class ReadSchema;
+class Block;
+using ReadSchemaSPtr = std::shared_ptr<ReadSchema>;
+class ReadSchema {
 public:
-    // All the columns of one table may exist in the columns param, but 
col_ids is only a subset.
-    Schema(const std::vector<TabletColumnPtr>& columns, const 
std::vector<ColumnId>& col_ids) {
-        size_t num_key_columns = 0;
-        for (int i = 0; i < columns.size(); ++i) {
-            if (columns[i]->is_key()) {
-                ++num_key_columns;
-            }
-            if (columns[i]->name() == DELETE_SIGN) {
-                _delete_sign_idx = i;
-            }
-            if (columns[i]->name() == BeConsts::ROWID_COL ||
-                columns[i]->name().starts_with(BeConsts::GLOBAL_ROWID_COL)) {
-                _rowid_col_idx = i;
-            }
-            if (columns[i]->name() == VERSION_COL) {
-                _version_col_idx = i;
-            }
-            if (columns[i]->name() == BINLOG_TSO_COL) {
-                _tso_col_idx = i;
-            }
-            if (columns[i]->name() == BINLOG_LSN_COL) {
-                _lsn_col_idx = i;
-            }
-            if (columns[i]->name() == BINLOG_OP_COL) {
-                _op_col_idx = i;
-            }
-            if (columns[i]->name() == COMMIT_TSO_COL) {
-                _commit_tso_col_idx = i;
-            }
-        }
-        _init(columns, col_ids, num_key_columns);
-    }
+    using SequenceMap = std::unordered_map<ColumnId, std::vector<ColumnId>>;
 
-    Schema(const Schema&);
-    Schema& operator=(const Schema& other);
+    explicit ReadSchema(std::vector<TabletColumnPtr> columns);
 
-    ~Schema();
+    explicit ReadSchema(const std::vector<TabletColumnPtr>& columns,

Review Comment:
   可以把后面的参数扔掉



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