-
Notifications
You must be signed in to change notification settings - Fork 304
fix: distributed RangePartitioning bounds calculation with native shuffle #2258
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
Changes from all commits
709d6e9
4ee3d8e
6f34e35
332e76a
0eb1134
bb67f73
abd8958
967d1a1
7af9474
522ef80
1a956a5
58e35b0
08a4b51
2f4280f
58f2eda
2803842
5bceb41
044e098
21c4665
4e86961
c9acdfc
386aa6c
261ea33
4077f7d
dd0939f
764675b
91fef94
3a83258
a1adf7f
f287dd1
a36ab4f
ae7ea4c
1a1d329
6456d4e
e24a36b
b7a078a
5305366
4233b42
f6e5c90
b5b286b
d12c855
fa2c20b
8781264
318adbd
2aa3f0f
3d359ba
c87aba7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,26 +15,30 @@ | |
| // specific language governing permissions and limitations | ||
| // under the License. | ||
|
|
||
| use arrow::row::{OwnedRow, RowConverter}; | ||
| use datafusion::physical_expr::{LexOrdering, PhysicalExpr}; | ||
| use std::sync::Arc; | ||
|
|
||
| #[derive(Debug, Clone)] | ||
| pub enum CometPartitioning { | ||
| SinglePartition, | ||
| /// Allocate rows based on a hash of one of more expressions and the specified number of | ||
| /// partitions | ||
| /// partitions. Args are 1) the expression to hash on, and 2) the number of partitions. | ||
| Hash(Vec<Arc<dyn PhysicalExpr>>, usize), | ||
| /// Allocate rows based on the lexical order of one of more expressions and the specified number of | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm thinking would be that intuitive for the user to have here? 🤔
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you expand on this please? I'm not sure I understand the requested change.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry for misleading comment. it is quite intuitive that hash depends on numPartitions and expression that supposed to be hashed. for Range it is which looks no so intuitive IMO, because cannot say when reading what is the meaning of last 2 params. |
||
| /// partitions | ||
| RangePartitioning(LexOrdering, usize, usize), | ||
| /// partitions. Args are 1) the LexOrdering to use to compare values and split into partitions, | ||
| /// 2) the number of partitions, 3) the RowConverter used to view incoming RecordBatches as Arrow | ||
| /// Rows for comparing to 4) OwnedRows that represent the boundaries of each partition, used with | ||
| /// LexOrdering to bin each value in the RecordBatch to a partition. | ||
| RangePartitioning(LexOrdering, usize, Arc<RowConverter>, Vec<OwnedRow>), | ||
| } | ||
|
|
||
| impl CometPartitioning { | ||
| pub fn partition_count(&self) -> usize { | ||
| use CometPartitioning::*; | ||
| match self { | ||
| SinglePartition => 1, | ||
| Hash(_, n) | RangePartitioning(_, n, _) => *n, | ||
| Hash(_, n) | RangePartitioning(_, n, _, _) => *n, | ||
| } | ||
| } | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we keep it as false
then run some benches and real tests with this param true and later enable it by default?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I discussed with @andygrove and we were comfortable merging with
trueback in June. I think if you're opting into native shuffle we should try to accelerate all partitioning schemes, and if we discover issues it can be toggled off.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Enabling it by default now gives us more opportunities to find bugs over the next few weeks before we release 0.11.0 and we can always disable if we find issues in that time.