Refactor partition groups and add tests - #57
Merged
Conversation
jayshrivastava
force-pushed
the
js/distribution-tests
branch
from
July 27, 2025 18:12
bf7b224 to
506a7fe
Compare
jayshrivastava
commented
Jul 27, 2025
| stage_id: stage.stage_id, | ||
| plan_bytes, | ||
| partition_group: partition_group.to_vec(), | ||
| partition_group: (partition_group.start() as u64..partition_group.end() as u64).collect(), |
Collaborator
Author
There was a problem hiding this comment.
Please let me know if I can change the DDTask proto to use a range as well.
| let new_child = Arc::new(PartitionIsolatorExec::new( | ||
| child.clone(), | ||
| partitions_per_worker.unwrap(), // we know it is a Some, here. | ||
| partition_count, |
Collaborator
Author
There was a problem hiding this comment.
I think this was a bug before. The isolator seems to want the total number of partitions here.
jayshrivastava
force-pushed
the
js/distribution-tests
branch
2 times, most recently
from
July 27, 2025 18:45
25fe243 to
0fa3702
Compare
jayshrivastava
marked this pull request as ready for review
July 27, 2025 18:47
jayshrivastava
force-pushed
the
js/distribution-tests
branch
from
July 27, 2025 18:50
0fa3702 to
0ec389d
Compare
NGA-TRAN
approved these changes
Jul 28, 2025
NGA-TRAN
left a comment
Collaborator
There was a problem hiding this comment.
Very impressive first PR, @jayshrivastava
I have a few minor comments to suggest clearer names and more unit tests
jayshrivastava
force-pushed
the
js/distribution-tests
branch
2 times, most recently
from
July 28, 2025 21:04
b208ab2 to
05d3d2a
Compare
This change adds a new abstraction called a `Grouper` in `distribution_strategy.rs`. This is responsible for grouping partitions into partition groups. The new `distribution_strategy` module can be used to store other splitters and, in the future, distribution strategies like round robin etc. A "partition group" is now a range [starting_partition, ending_partition) instead of a Vec, so we improve space efficiency. In the proto layer, the `DDTask` proto still uses a Vec, so we simply expand the range into a Vec when creating them in `planning.rs::assign_to_workers`. Testing - unit tests in isolator.rs - unit tests for `build_replacement` in `planning.rs` - unit tests for the grouper in `distribution_strategy.rs`
jayshrivastava
force-pushed
the
js/distribution-tests
branch
from
July 29, 2025 19:03
05d3d2a to
6c86f29
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This change adds a new abstraction called a
Grouperindistribution_strategy.rs. This is responsible for grouping partitions into partition groups. The newdistribution_strategymodule can be used to store other splitters and, in the future, distribution strategies like round robin etc.A "partition group" is now a range [starting_partition, ending_partition) instead of a Vec, so we improve space efficiency. In the proto layer, the
DDTaskproto still uses a Vec, so we simply expand the range into a Vec when creating them inplanning.rs::assign_to_workers.This also fixes a bug in the isolator where it may not have reported the right number of partitions.
Testing
build_replacementinplanning.rsdistribution_strategy.rs