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/12/21 10:16:26 UTC

[GitHub] [doris] xiaokang commented on a diff in pull request #15231: [improvement](topn)add per scanner limit check for new scanner

xiaokang commented on code in PR #15231:
URL: https://github.com/apache/doris/pull/15231#discussion_r1054213845


##########
be/src/vec/exec/scan/vscanner.cpp:
##########
@@ -62,10 +62,18 @@ Status VScanner::get_block(RuntimeState* state, Block* block, bool* eof) {
             {
                 SCOPED_TIMER(_parent->_filter_timer);
                 RETURN_IF_ERROR(_filter_output_block(block));
+                // record rows return (after filter) for _limit check
+                _num_rows_return += block->rows();
             }
         } while (block->rows() == 0 && !(*eof) && raw_rows_read() < raw_rows_threshold);
     }
 
+    // set eof to true if per scanner limit is reached
+    // currently for query: ORDER BY key LIMIT n
+    if (_limit > 0 && _num_rows_return > _limit) {

Review Comment:
   yes, it's more accurate using >=



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