eldenmoon commented on code in PR #48613: URL: https://github.com/apache/doris/pull/48613#discussion_r1980595786
########## be/src/vec/columns/column_object.cpp: ########## @@ -2511,4 +2514,28 @@ void ColumnObject::fill_path_column_from_sparse_data(Subcolumn& subcolumn, NullM } } +MutableColumnPtr ColumnObject::clone() const { + auto res = ColumnObject::create(_max_subcolumns_count); + Subcolumns new_subcolumns; + for (const auto& subcolumn : subcolumns) { + auto new_subcolumn = subcolumn->data; + if (subcolumn->data.is_root) { + new_subcolumns.create_root(std::move(new_subcolumn)); + } else if (!new_subcolumns.add(subcolumn->path, std::move(new_subcolumn))) { + throw doris::Exception(ErrorCode::INTERNAL_ERROR, "add path {} is error in clone()", + subcolumn->path.get_path()); + } + } + if (!new_subcolumns.get_root()) { + throw doris::Exception(ErrorCode::INTERNAL_ERROR, "root is nullptr in clone()"); + } + res->subcolumns = std::move(new_subcolumns); + auto&& column = serialized_sparse_column->get_ptr(); + auto sparse_column = std::move(*column).mutate(); + res->serialized_sparse_column = sparse_column->assume_mutable(); + res->set_num_rows(num_rows); + res->check_consistency(); Review Comment: ENABLE_XX -- 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