refactor: reorganize shuffle crate module structure#3772
Merged
andygrove merged 3 commits intoapache:mainfrom Mar 27, 2026
Merged
refactor: reorganize shuffle crate module structure#3772andygrove merged 3 commits intoapache:mainfrom
andygrove merged 3 commits intoapache:mainfrom
Conversation
Split and reorganize the shuffle crate for better cohesion: - Move `CompressionCodec` and `ShuffleBlockWriter` from `codec.rs` into `writers/shuffle_block_writer.rs`; inline the codec enum alongside its primary consumer - Move `Checksum` from `codec.rs` into `writers/checksum.rs` to keep all write-path types together - Rename `codec.rs` → `ipc.rs` (now only contains `read_ipc_compressed`) - Rename `writers/partition_writer.rs` → `writers/spill.rs` to better reflect its spill-management responsibility - Extract `SparkUnsafeObject` trait and `impl_primitive_accessors\!` macro from `spark_unsafe/row.rs` into `spark_unsafe/unsafe_object.rs` - Extract `ShufflePartitioner` trait from `partitioners/mod.rs` into `partitioners/traits.rs` - Add concise rustdoc comments to all structs, enums, and traits that were missing them
0bd4012 to
8f22ffe
Compare
Make `unsafe_object` module public and update the bench import to use the correct path for `SparkUnsafeObject`.
mbutrovich
approved these changes
Mar 27, 2026
Contributor
mbutrovich
left a comment
There was a problem hiding this comment.
Makes sense to me. Being able to swap in implementations cleanly will be nice to experiment with. Thanks @andygrove!
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.
Which issue does this PR close?
N/A
Rationale for this change
The shuffle crate grew organically and ended up with related code scattered across modules. This PR groups similar things together to make the crate easier to navigate. It is also a step towards potentially having multiple implementations of some traits so that we can compare performance of different approaches with different workloads.
What changes are included in this PR?
CompressionCodecandShuffleBlockWriterfromcodec.rsintowriters/shuffle_block_writer.rs, inlining the codec enum alongside its primary consumerChecksumfromcodec.rsintowriters/checksum.rsto keep all write-path types togethercodec.rs→ipc.rs(now solely containsread_ipc_compressed)writers/partition_writer.rs→writers/spill.rsto better reflect its spill-management responsibilitySparkUnsafeObjecttrait andimpl_primitive_accessors\!macro from the overloadedspark_unsafe/row.rsintospark_unsafe/unsafe_object.rsShufflePartitionertrait frompartitioners/mod.rsintopartitioners/traits.rsHow are these changes tested?
Existing tests