yiguolei commented on code in PR #68610:
URL: https://github.com/apache/doris/pull/68610#discussion_r4268182963
##########
be/src/exec/scan/scanner.cpp:
##########
@@ -101,6 +108,16 @@ Status Scanner::get_block_after_projects(RuntimeState*
state, Block* block, bool
RETURN_IF_ERROR(get_block(state, &_origin_block, eos));
return _do_projections(&_origin_block, block);
}
+ // get_block() charges the shared LIMIT as soon as rows pass the
filters, but rows that stay
+ // in _padding_block when this call returns are not returned by it.
Peer scanners may
+ // exhaust the LIMIT before this scanner runs again, and the context
then finishes without
+ // running it, so those rows would be charged but never returned. Keep
the counter equal
+ // to "LIMIT minus returned rows" between calls: charge the held rows
again on entry, so
+ // every row this scanner holds during the call is charged and the
read loop below stops
+ // as soon as the LIMIT is reached, and refund whatever is still held
on exit.
+ if (_shared_scan_limit && !_padding_block.empty()) {
Review Comment:
这里的padding 不应该为空?
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]