-
Notifications
You must be signed in to change notification settings - Fork 0
refactor: Make CollectLeftAccumulator a trait for custom left-side accumulators #116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…ds instead of computing them after data is accumulated (apache#17444)
|
Physical planner tests - failure is unrelated to changes, and due to feature flagging: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR refactors the hash join bounds accumulation system to support custom accumulator implementations through traits. The refactor maintains backward compatibility by providing a default MinMaxLeftAccumulator implementation while enabling consumers to implement custom accumulator logic.
Key changes:
- Introduces
CollectLeftAccumulatorandColumnBoundstraits for extensibility - Renames
CollectLeftAccumulatorstruct toMinMaxLeftAccumulatorandColumnBoundsstruct toMinMaxColumnBounds - Makes
HashJoinExecgeneric over the accumulator type withMinMaxLeftAccumulatoras the default - Exposes previously internal types and functions through public APIs to support custom implementations
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| datafusion/pruning/src/pruning_predicate.rs | Exposes internal utilities (BoolVecBuilder, build_statistics_record_batch, StatisticsType) as public APIs |
| datafusion/pruning/src/lib.rs | Re-exports newly public types from pruning_predicate module |
| datafusion/physical-plan/src/joins/mod.rs | Re-exports new trait types and renamed accumulator from hash_join module |
| datafusion/physical-plan/src/joins/hash_join/shared_bounds.rs | Introduces ColumnBounds trait, renames ColumnBounds struct to MinMaxColumnBounds, updates types to use trait objects |
| datafusion/physical-plan/src/joins/hash_join/mod.rs | Re-exports new public types (CollectLeftAccumulator, MinMaxLeftAccumulator, ColumnBounds) |
| datafusion/physical-plan/src/joins/hash_join/exec.rs | Makes HashJoinExec generic over accumulator type, introduces CollectLeftAccumulator trait, renames struct to MinMaxLeftAccumulator, adds try_new_with_accumulator method |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
CollectLeftAccumulatorstruct toMinMaxLeftAccumulatorCollectLeftAccumulatorand implements it forMinMaxLeftAccumulatorHashJoinExec::try_newto set a default accumulator forMinMaxLeftAccumulator. This ensures the refactor is not a breaking change by defaulting the generic type.ColumnBoundstoMinMaxColumnBoundsColumnBoundstrait which returnsArc<dyn PhysicalExpr>representing the expression for the bounds returned by the accumulator. Implements it forMinMaxColumnBoundsThis refactor maintains existing min-max bounds functionality, while providing the ability for consumers to override
HashJoinExec's with custom accumulators for their specific use case.