alamb opened a new pull request, #11610: URL: https://github.com/apache/datafusion/pull/11610
Draft as I need to - [ ] add tests - [ ] Run benchmarks to ensure no regression ## Which issue does this PR close? Related to https://github.com/apache/datafusion/issues/9370 ## Rationale for this change 1. I want to be able to write tests more easily for PRs like (https://github.com/apache/datafusion/pull/11587) 2. I also harbor plans to improve repartitioning / aggregates, and I have wanted to do this refactor for a while For example today we have a `FilterExec` which copies all rows that pass the filter into a new `RecordBatch`. Then that new RecordBatch is immediately run through `CoalesceBatches` which will likely copy the batch again the filter write directly to the output of CoalesceBatches. Encapsulating this logic in a struct makes it easier to potentially do that optimization. ## What changes are included in this PR? 1. Move the logic for coalescing batches into a struct `CoalesceBatchesExec` 2. Add tests for the new struct I also happen to think this change makes the code easier to read as it separates the coalescing logic from the stream handling logic. ## Are these changes tested? Yes, by existing CI and new unit tests <!-- We typically require tests for all PRs in order to: 1. Prevent the code from being accidentally broken by subsequent changes 2. Serve as another way to document the expected behavior of the code If tests are not included in your PR, please explain why (for example, are they covered by existing tests)? --> ## Are there any user-facing changes? No changes, this is just an internal code reorganization <!-- If there are user-facing changes then we may require documentation to be updated before approving the PR. --> <!-- If there are any breaking changes to public APIs, please add the `api change` label. --> -- 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-unsubscr...@datafusion.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For additional commands, e-mail: github-h...@datafusion.apache.org