zhannngchen commented on code in PR #25147: URL: https://github.com/apache/doris/pull/25147#discussion_r1356975453
########## be/src/olap/memtable.cpp: ########## @@ -428,11 +431,6 @@ bool MemTable::need_flush() const { bool MemTable::need_agg() const { if (_keys_type == KeysType::AGG_KEYS) { auto max_size = config::write_buffer_size_for_agg; - if (_tablet_schema->is_partial_update()) { Review Comment: Why remove this part of code? ########## be/src/olap/delta_writer_v2.cpp: ########## @@ -221,8 +223,10 @@ void DeltaWriterV2::_build_current_tablet_schema(int64_t index_id, _tablet_schema->set_table_id(table_schema_param->table_id()); // set partial update columns info - _tablet_schema->set_partial_update_info(table_schema_param->is_partial_update(), - table_schema_param->partial_update_input_columns()); + _partial_update_info = std::make_shared<PartialUpdateInfo>(); + _partial_update_info->init(*_tablet_schema, table_schema_param->is_partial_update(), Review Comment: It's better to use a `shared_ptr<TabletSchema>` as it's first parameter, rather than a const reference. Can you guarentee that the life cycle of `_tablet_schema` will be longger than `_partial_update_info`, even after several times copy of `_partial_update_info`? ########## be/src/olap/tablet_schema.h: ########## @@ -402,20 +389,42 @@ class TabletSchema { int64_t _mem_size = 0; bool _store_row_column = false; bool _skip_write_index_on_load = false; - - bool _is_partial_update; - std::set<std::string> _partial_update_input_columns; - std::vector<uint32_t> _missing_cids; - std::vector<uint32_t> _update_cids; - // if key not exist in old rowset, use default value or null value for the unmentioned cols - // to generate a new row, only available in non-strict mode - bool _can_insert_new_rows_in_partial_update = true; - bool _is_strict_mode = false; }; bool operator==(const TabletSchema& a, const TabletSchema& b); bool operator!=(const TabletSchema& a, const TabletSchema& b); using TabletSchemaSPtr = std::shared_ptr<TabletSchema>; +struct PartialUpdateInfo { Review Comment: it's better to use a separate header file for this new struct -- 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: commits-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org