Repository navigation
feat(arrow): split a batch by partition values passed separately - #3760
Draft
xanderbailey wants to merge 1 commit into
Draft
xanderbailey wants to merge 1 commit into
xanderbailey wants to merge 1 commit into
Conversation
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
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?
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_partitioncolumn, 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 separateStructArrayand splits a batch that doesn't contain them.splitis unchanged; both now share the grouping code.Are these changes tested?
Yes, unit tests for splitting a batch with its own
_partitioncolumn, and for the error when the number of partition values doesn't match the batch.AI Disclosure