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/09/06 08:31:45 UTC
[GitHub] [doris] HappenLee commented on a diff in pull request #12336: [Improvement](sort) Accumulate blocks to do partial sort
HappenLee commented on code in PR #12336:
URL: https://github.com/apache/doris/pull/12336#discussion_r963406293
##########
be/src/vec/exec/vsort_node.h:
##########
@@ -84,6 +84,11 @@ class VSortNode : public doris::ExecNode {
// only valid in TOP-N node
uint64_t _num_rows_in_block = 0;
std::priority_queue<SortBlockCursor> _block_priority_queue;
+
+ std::unique_ptr<MutableBlock> _unsorted_block;
+
+ static constexpr size_t BufferedBlockSize = 1024 * 1024;
Review Comment:
use all UPPRER CASE in constexpr value
##########
be/src/vec/exec/vsort_node.cpp:
##########
@@ -124,25 +128,30 @@ void VSortNode::debug_string(int indentation_level, stringstream* out) const {
Status VSortNode::sort_input(RuntimeState* state) {
bool eos = false;
do {
- Block block;
- RETURN_IF_ERROR_AND_CHECK_SPAN(child(0)->get_next_after_projects(state, &block, &eos),
- child(0)->get_next_span(), eos);
- auto rows = block.rows();
-
- if (rows != 0) {
- RETURN_IF_ERROR(pretreat_block(block));
- size_t mem_usage = block.allocated_bytes();
-
+ do {
+ Block upstream_block;
+ RETURN_IF_ERROR_AND_CHECK_SPAN(
+ child(0)->get_next_after_projects(state, &upstream_block, &eos),
+ child(0)->get_next_span(), eos);
+ if (upstream_block.rows() != 0) {
+ size_t mem_usage = upstream_block.allocated_bytes();
Review Comment:
maybe here we only need to calculate the mem_usage of `_unsorted_block` ?
--
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