You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2022/05/18 03:09:21 UTC

[GitHub] [incubator-doris] HappenLee commented on a diff in pull request #9520: [Bug][Vectorized] fix vcast expr input wrong row number

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: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org