You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by "mrhhsg (via GitHub)" <gi...@apache.org> on 2023/06/30 02:19:16 UTC

[GitHub] [doris] mrhhsg opened a new pull request, #21360: [improvement](join) avoid unnecessary copying in _build_output_block

mrhhsg opened a new pull request, #21360:
URL: https://github.com/apache/doris/pull/21360

   ## Proposed changes
   
   If the source columns are mutually exclusive within a temporary block, there is no need to duplicate the data.
   
   ## Further comments
   
   If this is a relatively large or complex change, kick off the discussion at [dev@doris.apache.org](mailto:dev@doris.apache.org) by explaining why you chose the solution you did and what alternatives you considered, etc...
   
   


-- 
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


[GitHub] [doris] github-actions[bot] commented on pull request #21360: [improvement](join) avoid unnecessary copying in _build_output_block

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #21360:
URL: https://github.com/apache/doris/pull/21360#issuecomment-1614025810

   clang-tidy review says "All clean, LGTM! :+1:"


-- 
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


[GitHub] [doris] mrhhsg commented on pull request #21360: [improvement](join) avoid unnecessary copying in _build_output_block

Posted by "mrhhsg (via GitHub)" <gi...@apache.org>.
mrhhsg commented on PR #21360:
URL: https://github.com/apache/doris/pull/21360#issuecomment-1614030437

   run buildall


-- 
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


[GitHub] [doris] github-actions[bot] commented on pull request #21360: [improvement](join) avoid unnecessary copying in _build_output_block

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #21360:
URL: https://github.com/apache/doris/pull/21360#issuecomment-1614333072

   clang-tidy review says "All clean, LGTM! :+1:"


-- 
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


[GitHub] [doris] mrhhsg commented on pull request #21360: [improvement](join) avoid unnecessary copying in _build_output_block

Posted by "mrhhsg (via GitHub)" <gi...@apache.org>.
mrhhsg commented on PR #21360:
URL: https://github.com/apache/doris/pull/21360#issuecomment-1617654684

   run buildall


-- 
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


[GitHub] [doris] mrhhsg commented on pull request #21360: [improvement](join) avoid unnecessary copying in _build_output_block

Posted by "mrhhsg (via GitHub)" <gi...@apache.org>.
mrhhsg commented on PR #21360:
URL: https://github.com/apache/doris/pull/21360#issuecomment-1614325275

   run buildall


-- 
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


[GitHub] [doris] yiguolei merged pull request #21360: [improvement](join) avoid unnecessary copying in _build_output_block

Posted by "yiguolei (via GitHub)" <gi...@apache.org>.
yiguolei merged PR #21360:
URL: https://github.com/apache/doris/pull/21360


-- 
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


[GitHub] [doris] Gabriel39 commented on a diff in pull request #21360: [improvement](join) avoid unnecessary copying in _build_output_block

Posted by "Gabriel39 (via GitHub)" <gi...@apache.org>.
Gabriel39 commented on code in PR #21360:
URL: https://github.com/apache/doris/pull/21360#discussion_r1247351928


##########
be/src/vec/exec/join/vjoin_node_base.cpp:
##########
@@ -183,16 +192,21 @@ Status VJoinNodeBase::_build_output_block(Block* origin_block, Block* output_blo
             for (int i = 0; i < mutable_columns.size(); ++i) {
                 auto result_column_id = -1;
                 RETURN_IF_ERROR(_output_expr_ctxs[i]->execute(origin_block, &result_column_id));
-                auto column_ptr = origin_block->get_by_position(result_column_id)
-                                          .column->convert_to_full_column_if_const();
-                insert_column_datas(mutable_columns[i], *column_ptr, rows);
+                auto& origin_column = origin_block->get_by_position(result_column_id).column;
+                auto column_ptr = origin_column->convert_to_full_column_if_const();
+                if (column_ptr.get() == origin_column.get()) {
+                    column_ptr = nullptr;
+                    insert_column_datas(mutable_columns[i], origin_column, rows);
+                } else {
+                    insert_column_datas(mutable_columns[i], column_ptr, rows);
+                }
             }
         }
 
-        if (!is_mem_reuse) {
+        if (!is_mem_reuse || !keep_origin) {
             output_block->swap(mutable_block.to_block());
         }
-        DCHECK(output_block->rows() == rows);

Review Comment:
   `DCHECK` is more reasonable. If you want an error reported to users, you could return a error Status here.



-- 
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


[GitHub] [doris] github-actions[bot] commented on pull request #21360: [improvement](join) avoid unnecessary copying in _build_output_block

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #21360:
URL: https://github.com/apache/doris/pull/21360#issuecomment-1619350171

   PR approved by anyone and no changes requested.


-- 
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


[GitHub] [doris] github-actions[bot] commented on pull request #21360: [improvement](join) avoid unnecessary copying in _build_output_block

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #21360:
URL: https://github.com/apache/doris/pull/21360#issuecomment-1617638744

   clang-tidy review says "All clean, LGTM! :+1:"


-- 
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


[GitHub] [doris] HappenLee commented on a diff in pull request #21360: [improvement](join) avoid unnecessary copying in _build_output_block

Posted by "HappenLee (via GitHub)" <gi...@apache.org>.
HappenLee commented on code in PR #21360:
URL: https://github.com/apache/doris/pull/21360#discussion_r1249962657


##########
be/src/vec/exec/join/vjoin_node_base.cpp:
##########
@@ -183,13 +192,18 @@ Status VJoinNodeBase::_build_output_block(Block* origin_block, Block* output_blo
             for (int i = 0; i < mutable_columns.size(); ++i) {
                 auto result_column_id = -1;
                 RETURN_IF_ERROR(_output_expr_ctxs[i]->execute(origin_block, &result_column_id));
-                auto column_ptr = origin_block->get_by_position(result_column_id)
-                                          .column->convert_to_full_column_if_const();
-                insert_column_datas(mutable_columns[i], *column_ptr, rows);
+                auto& origin_column = origin_block->get_by_position(result_column_id).column;

Review Comment:
   TODO: need better dispose the const column 



-- 
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


[GitHub] [doris] github-actions[bot] commented on pull request #21360: [improvement](join) avoid unnecessary copying in _build_output_block

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #21360:
URL: https://github.com/apache/doris/pull/21360#issuecomment-1619350144

   PR approved by at least one committer and no changes requested.


-- 
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