ajegou commented on code in PR #22852:
URL: https://github.com/apache/datafusion/pull/22852#discussion_r3388084575
##########
datafusion/physical-plan/src/topk/mod.rs:
##########
@@ -1196,6 +1202,100 @@ mod tests {
Ok(())
}
+ /// Regression test for #22849: a batch whose rows are entirely rejected
by the
+ /// heap's dynamic filter must still trigger `attempt_early_completion`
when its
+ /// last row's prefix is worse than the heap's worst.
+ ///
+ /// Before the fix, the `!filter.has_true()` short-circuit returned
without calling
+ /// `attempt_early_completion`. Because the heap's filter is itself
derived from the
+ /// heap's worst row, a batch from a strictly-worse prefix is exactly the
case the
+ /// filter rejects entirely — i.e. the very signal the early-exit was
designed to
+ /// detect was being silently dropped.
+ #[tokio::test]
+ async fn test_try_finish_fires_when_filter_rejects_entire_batch() ->
Result<()> {
Review Comment:
Yes good idea, I just made the change
--
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]