HappenLee commented on code in PR #9520:
URL: https://github.com/apache/incubator-doris/pull/9520#discussion_r875426915
##########
be/src/vec/core/block.cpp:
##########
@@ -151,6 +151,13 @@ void Block::insert(ColumnWithTypeAndName&& elem) {
data.emplace_back(std::move(elem));
}
+void Block::insert_and_resize(ColumnWithTypeAndName&& elem) {
+ index_by_name.emplace(elem.name, data.size());
+ // usualy elem.column always is const column, so we just clone it.
+ elem.column = elem.column->clone_resized(std::max(rows(), size_t(1)));
Review Comment:
1. `clone_resized` will cause some data loss
2. `clone_resized` will cause the `memcpy, new, delete`.
I don't think it should be a member function
--
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]