Skip to content

Partition Writer Support Part 1: add partition splitter #1040

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ZENOTME
Copy link
Contributor

@ZENOTME ZENOTME commented Mar 5, 2025

Which issue does this PR close?

This PR is part 1 to close #342.

What changes are included in this PR?

The partition writer support will be separate into three PR:

  1. add partition splitter which used to split the record batch based on partition value
  2. add fanout partition writer which will compute the partition value of input and split them
  3. add precompute partition writer which will use the partition value provided by user

This PR is the first part.

Are these changes tested?

@ZENOTME
Copy link
Contributor Author

ZENOTME commented Mar 5, 2025

This PR may conflict with #1014. But I'm not sure whether #1014 can be reviewed and merge recently. I'm ok to merge any one first and I will fix the conflict later. cc @liurenjie1024 @jonathanc-n @Fokko @Xuanwo @sdd

@ZENOTME ZENOTME force-pushed the pw_1_partition_spliter branch from 4ac8823 to 7bc64bb Compare March 5, 2025 13:30
@jonathanc-n
Copy link
Contributor

jonathanc-n commented Mar 17, 2025

@ZENOTME I should be able to take a look at this tomorrow

Copy link
Contributor

@jonathanc-n jonathanc-n left a comment

Choose a reason for hiding this comment

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

small nits, I don't know if worth to even change if this is just temporary code.

// # TODO
// Remove this after partition writer supported.
#[allow(dead_code)]
pub struct RecordBatchPartitionsplitter {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
pub struct RecordBatchPartitionsplitter {
pub struct RecordBatchPartitionSplitter {

Copy link
Contributor

Choose a reason for hiding this comment

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

and rest of code

partition_batches.push((
row,
filter_record_batch(batch, &filter_array)
.expect("We should guarantee the filter array is valid"),
Copy link
Contributor

Choose a reason for hiding this comment

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

prefer to propogate error instead of expect

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

Successfully merging this pull request may close these issues.

Implement partition writer
2 participants