adriangb commented on issue #21992:
URL: https://github.com/apache/datafusion/issues/21992#issuecomment-4374703267
I don't know that the enum is any different than the trait in terms of
representation. I.e. if we can represent it as a trait we can represent it as
an enum. The question is more if we want to hard code all of the handled cases
or leave it open for users to add more down the road.
I'd defer to @gene-bordegaray as to what an enum version would look like but
I think something like this:
```rust
pub enum Partitioning {
RoundRobinBatch(usize),
Hash {
exprs: Vec<Arc<dyn PhysicalExpr>>,
partition_count: usize,
},
Range {
exprs: Vec<Arc<dyn PhysicalExpr>>,
partitions: Vec<RangePartition>,
},
}
pub struct RangePartition {
/// One interval per `Range.exprs` entry.
///
/// For exprs = [time, int_val], this can represent:
/// time in [2026-05-01, 2026-05-07]
/// AND int_val in [1, 100]
pub bounds: Vec<RangeInterval>,
}
pub struct RangeInterval {
pub lower: Option<RangeBound>,
pub upper: Option<RangeBound>,
}
pub struct RangeBound {
pub value: ScalarValue,
pub inclusive: bool,
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]