You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "jayzhan211 (via GitHub)" <gi...@apache.org> on 2026/09/20 12:18:46 UTC

Re: [PR] FilterExec : expose push_batch_with_filter on LimitedBatchCoalescer [datafusion]

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: github-unsubscribe@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org