eldenmoon commented on code in PR #34925: URL: https://github.com/apache/doris/pull/34925#discussion_r1618882079
########## be/src/olap/tablet.cpp: ########## @@ -1816,7 +1816,8 @@ Result<std::unique_ptr<RowsetWriter>> Tablet::create_transient_rowset_writer( context.rowset_state = PREPARED; context.segments_overlap = OVERLAPPING; context.tablet_schema = std::make_shared<TabletSchema>(); - context.tablet_schema->copy_from(*(rowset.tablet_schema())); + // context.tablet_schema->copy_from(*(rowset.tablet_schema())); Review Comment: done ########## be/src/olap/rowset_builder.cpp: ########## @@ -300,14 +300,18 @@ Status RowsetBuilder::commit_txn() { } std::lock_guard<std::mutex> l(_lock); SCOPED_TIMER(_commit_txn_timer); - if (tablet()->tablet_schema()->num_variant_columns() > 0) { + + const RowsetWriterContext& rw_ctx = _rowset_writer->context(); + if (rw_ctx.tablet_schema->num_variant_columns() > 0) { // update tablet schema when meet variant columns, before commit_txn // Eg. rowset schema: A(int), B(float), C(int), D(int) // _tabelt->tablet_schema: A(bigint), B(double) // => update_schema: A(bigint), B(double), C(int), D(int) - const RowsetWriterContext& rw_ctx = _rowset_writer->context(); RETURN_IF_ERROR(tablet()->update_by_least_common_schema(rw_ctx.tablet_schema)); } + if (rw_ctx.merged_tablet_schema != nullptr) { + RETURN_IF_ERROR(tablet()->update_by_least_common_schema(rw_ctx.merged_tablet_schema)); Review Comment: done -- 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