Skip to content
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

Add BatchPartitioner (#2285) #2287

Merged
merged 3 commits into from
Apr 20, 2022
Merged

Conversation

tustvold
Copy link
Contributor

Which issue does this PR close?

Closes #2285

Rationale for this change

Extracts common logic so it can be used by RepartitionExec, Ballista and #2226

What changes are included in this PR?

Adds a [BatchPartitioner] that contains the logic for partitioning batches

Are there any user-facing changes?

No

@tustvold tustvold requested a review from Dandandan April 20, 2022 14:34
@github-actions github-actions bot added ballista datafusion Changes in the datafusion crate labels Apr 20, 2022
@@ -87,7 +87,7 @@ impl BatchPartitioner {
/// Create a new [`BatchPartitioner`] with the provided [`Partitioning`]
///
/// The time spent repartitioning will be recorded to `timer`
pub fn new(partitioning: Partitioning, timer: metrics::Time) -> Self {
pub fn new(partitioning: Partitioning, timer: metrics::Time) -> Result<Self> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn´t this be try_new now by convention?

Copy link
Member

@andygrove andygrove left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice cleanup. Thanks @tustvold

@Dandandan Dandandan merged commit 583b4ab into apache:master Apr 20, 2022
@Dandandan
Copy link
Contributor

Thanks @tustvold 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
datafusion Changes in the datafusion crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Extract Reusable BatchPartitioner
3 participants