jayzhan211 commented on PR #25503:
URL: https://github.com/apache/datafusion/pull/25503#issuecomment-5749749843
Thanks @Rich-T-kid , test coverage issue
Fetch logic of `push_batch_with_filter` is covered by one FilterExec test
(single batch, no nulls). Uncovered: null filter values under `fetch` (the
`None` arm of `first_n_true`), limit spanning several batches, exact-boundary
`LimitReached`, push after limit, `fetch = 0`. I checked these locally and they
pass; please add unit tests next to the existing `push_batch` ones. Fine to
handle in a follow-up.
```rs
#[test]
fn test_push_batch_with_filter_nulls_and_fetch() {
let batch = uint32_batch(0..8);
let mut coalescer = LimitedBatchCoalescer::new(batch.schema(), 100,
Some(3));
let filter = BooleanArray::from(vec![
None,
Some(true),
None,
Some(false),
Some(true),
Some(true),
None,
Some(true),
]);
assert_eq!(
coalescer.push_batch_with_filter(batch, &filter).unwrap(),
PushBatchStatus::LimitReached,
);
coalescer.finish().unwrap();
let output = coalescer.next_completed_batch().unwrap();
let expected = UInt32Array::from(vec![1, 4, 5]);
assert_eq!(output.column(0).as_ref(), &expected as &dyn
arrow::array::Array);
}
```
--
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]