github-actions[bot] commented on code in PR #14774:
URL: https://github.com/apache/doris/pull/14774#discussion_r1044157830


##########
be/src/vec/exec/vanalytic_eval_node.cpp:
##########
@@ -268,99 +320,70 @@ Status VAnalyticEvalNode::get_next(RuntimeState* state, 
vectorized::Block* block
         return Status::OK();
     }
 
-    RETURN_IF_ERROR(_executor.get_next(state, block, eos));
-
-    SCOPED_CONSUME_MEM_TRACKER(mem_tracker_growh());
-    RETURN_IF_ERROR(VExprContext::filter_block(_vconjunct_ctx_ptr, block, 
block->columns()));
-    reached_limit(block, eos);
-    return Status::OK();
-}
-
-Status VAnalyticEvalNode::_get_next_for_partition(RuntimeState* state, Block* 
block, bool* eos) {
     while (!_input_eos || _output_block_index < _input_blocks.size()) {
-        bool next_partition = false;
-        RETURN_IF_ERROR(_consumed_block_and_init_partition(state, 
&next_partition, eos));
+        RETURN_IF_ERROR(_consumed_block_and_init_partition(state, 
&_next_partition, eos));
         if (*eos) {
-            break;
+            return Status::OK();
         }
-
-        SCOPED_CONSUME_MEM_TRACKER(mem_tracker_growh());
         size_t current_block_rows = _input_blocks[_output_block_index].rows();
-        if (next_partition) {
-            _executor.execute(_partition_by_start.pos, _partition_by_end.pos,
-                              _partition_by_start.pos, _partition_by_end.pos);
-        }
-        _executor.insert_result(current_block_rows);
+        SCOPED_CONSUME_MEM_TRACKER(mem_tracker_growh());
+        RETURN_IF_ERROR(_executor.get_next(current_block_rows));
         if (_window_end_position == current_block_rows) {
-            return _output_current_block(block);
+            break;
         }
     }
+    RETURN_IF_ERROR(_output_current_block(block));
+    SCOPED_CONSUME_MEM_TRACKER(mem_tracker_growh());
+    RETURN_IF_ERROR(VExprContext::filter_block(_vconjunct_ctx_ptr, block, 
block->columns()));
+    reached_limit(block, eos);
     return Status::OK();
 }
 
-Status VAnalyticEvalNode::_get_next_for_range(RuntimeState* state, Block* 
block, bool* eos) {
-    while (!_input_eos || _output_block_index < _input_blocks.size()) {
-        bool next_partition = false;
-        RETURN_IF_ERROR(_consumed_block_and_init_partition(state, 
&next_partition, eos));
-        if (*eos) {
-            break;
-        }
-
-        SCOPED_CONSUME_MEM_TRACKER(mem_tracker_growh());
-        size_t current_block_rows = _input_blocks[_output_block_index].rows();
-        while (_current_row_position < _partition_by_end.pos &&
-               _window_end_position < current_block_rows) {
-            if (_current_row_position >= _order_by_end.pos) {
-                _update_order_by_range();
-                _executor.execute(_order_by_start.pos, _order_by_end.pos, 
_order_by_start.pos,
-                                  _order_by_end.pos);
-            }
-            _executor.insert_result(current_block_rows);
-        }
-        if (_window_end_position == current_block_rows) {
-            return _output_current_block(block);
-        }
+Status VAnalyticEvalNode::_get_next_for_partition(size_t current_block_rows) {

Review Comment:
   warning: method '_get_next_for_partition' can be made const 
[readability-make-member-function-const]
   
   ```suggestion
   Status VAnalyticEvalNode::_get_next_for_partition(size_t current_block_rows) 
const {
   ```
   
   be/src/vec/exec/vanalytic_eval_node.h:63:
   ```diff
   -     Status _get_next_for_partition(size_t rows);
   +     Status _get_next_for_partition(size_t rows) const;
   ```
   



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

Reply via email to