kosiew opened a new pull request, #23370: URL: https://github.com/apache/datafusion/pull/23370
## Which issue does this PR close? * Part of #22772 ## Rationale for this change `SharedBuildAccumulator::build_filter` currently combines lifecycle coordination with dynamic-filter expression construction for both collect-left and partitioned execution paths. This interleaves synchronization logic with expression composition, making the expression policy harder to evolve independently. This change extracts the expression assembly into a dedicated private helper so that the accumulator remains responsible for coordinating finalization and applying dynamic filter updates, while the helper owns expression construction and fallback policy. The refactoring is intended to preserve existing dynamic-filter semantics. ## What changes are included in this PR? * Introduce a private `DynamicFilterExprComposer` responsible for finalize-time dynamic-filter expression composition. * Add `FilterComposition` to distinguish between updating the dynamic filter and intentionally performing no update. * Move collect-left expression construction into the composer. * Move partitioned expression construction, including partition routing, fallback handling, and `CASE` expression generation, into the composer. * Extract helper methods for composing reported partition branches and building the routing modulo expression. * Simplify `SharedBuildAccumulator::build_filter` so it delegates expression construction to the composer and only applies updates when required. * Preserve existing error handling for invalid finalize states such as pending or unexpected partition status. ## Are these changes tested? No tests are included in this PR. This change is a refactoring intended to preserve existing behavior. Existing tests covering hash-join dynamic filtering are expected to continue to pass unchanged. ## Are there any user-facing changes? No. ## LLM-generated code disclosure This PR includes LLM-generated code and comments. All LLM-generated content has been manually reviewed. -- 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]
