Skip to content

feat(arrow): split a batch by partition values passed separately - #3760

Draft
xanderbailey wants to merge 1 commit into
apache:mainfrom
xanderbailey:xb/split-with-partition-values
Draft

xanderbailey wants to merge 1 commit into
apache:mainfrom
xanderbailey:xb/split-with-partition-values

Conversation

@xanderbailey

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

  • Closes #.

Related: apache/datafusion-iceberg#139

What changes are included in this PR?

RecordBatchPartitionSplitter's precomputed mode reads the partition values from a column named _partition, taking the first column with that name. If the table also has a _partition column, the splitter reads the table column instead. The returned batches also keep the partition values column, so callers have to strip it before writing.

This adds split_with_partition_values, which takes the partition values as a separate StructArray and splits a batch that doesn't contain them. split is unchanged; both now share the grouping code.

Are these changes tested?

Yes, unit tests for splitting a batch with its own _partition column, and for the error when the number of partition values doesn't match the batch.

AI Disclosure

RecordBatchPartitionSplitter's precomputed mode reads the partition
values from the first column named `_partition`, so a table column of
that name is read in their place, and the split batches keep the
partition values column.

Add split_with_partition_values, which takes the partition values as a
StructArray and splits a batch that doesn't contain them.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant