apache / apache/arrow-rs

Support partitioning functionality

Open
#4,476 3 comments 0 reactions 0 assignees View on GitHub
enhancement performance
Dominant language
Rust
Stars
3.6k
Forks
1.3k
Avg merge
2d 18h
Merged PRs (30d)
169

Description

**Is your feature request related to a problem or challenge? Please describe what you are trying to do.**

In DataFusion, a common operation is to repartition a RecordBatch by hashing one or more columns and dividing them into `partition` record batches using the "formula" `hash % num_partitions`.

The current approach is to create the indices that match and use them to `take` the individual arrays (see `BatchPartitioner` in datafusion).

This is relatively expensive however, as we visit the arrays `num_partitions` times in different places, leading to cache inefficient.

**Describe the solution you'd like**

I would like to have a method in arrow-rs that takes an Array with `partition` numbers (0..) and spreads the rows of the Array(s) into a `Vec` and/or `Vec`.

**Describe alternatives you've considered**

**Additional context**

Contributor guide

Open the contributing guide

Research direction

Review BatchPartitioner in DataFusion and the existing take-based partitioning approach for Array and RecordBatch values. Completion means providing a method that distributes rows into Vec and/or Vec according to the supplied partition numbers, while addressing the repeated array visits described in the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
data-engineering
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.