pub struct RangePartitioning { /* private fields */ }Expand description
Physical range partitioning.
RangePartitioning describes an ordered key space with split points.
orderingdefines the partitioning key and ordering.split_pointsdefine the boundaries between adjacent partitions.
Comparisons use the lexicographic order defined by ordering, including
ASC/DESC and null ordering. Split points must be strictly ordered
according to that ordering, and each split point must have one value per
ordering expression. See SplitPoint for the shared boundary convention.
Like other user-specified data properties such as sortedness, if a source declares range partitioning, it is responsible for placing each row in the partition described by the split points. DataFusion will not validate this is upheld.
For a single range key:
ordering = [date ASC NULLS LAST]
split_points = [
(2022-01-01),
(2023-01-01),
]
partition 0: date before 2022-01-01
partition 1: date between 2022-01-01 (inclusive) and 2023-01-01 (exclusive)
partition 2: date at/after 2023-01-01The same model extends to compound keys.
For ordering = [time ASC, city ASC], split points are ordered
lexicographically by (time, city):
ordering = [time ASC NULLS LAST, city ASC NULLS LAST]
split_points = [
(2022, Allston),
(2023, Allston),
]
partition 0: keys before (2022, Allston)
partition 1: keys between (2022, Allston) and (2023, Allston)
partition 2: keys at/after (2023, Allston)NOTE: Optimizer and execution behavior for this partitioning is intentionally not implemented and will be introduced incrementally. See https://github.com/apache/datafusion/issues/22395.
Implementations§
Source§impl RangePartitioning
impl RangePartitioning
Sourcepub fn new(ordering: LexOrdering, split_points: Vec<SplitPoint>) -> Self
pub fn new(ordering: LexOrdering, split_points: Vec<SplitPoint>) -> Self
Creates range partitioning metadata without validating split points.
Use Self::try_new to validate the contract documented on
RangePartitioning.
Sourcepub fn try_new(
ordering: LexOrdering,
split_points: Vec<SplitPoint>,
) -> Result<Self>
pub fn try_new( ordering: LexOrdering, split_points: Vec<SplitPoint>, ) -> Result<Self>
Creates range partitioning metadata and validates split point shape and ordering.
Sourcepub fn ordering(&self) -> &LexOrdering
pub fn ordering(&self) -> &LexOrdering
Returns the ordering that defines the range key.
Sourcepub fn split_points(&self) -> &[SplitPoint]
pub fn split_points(&self) -> &[SplitPoint]
Returns the ordered split points between partitions.
Sourcepub fn partition_count(&self) -> usize
pub fn partition_count(&self) -> usize
Returns the number of partitions.
Trait Implementations§
Source§impl Clone for RangePartitioning
impl Clone for RangePartitioning
Source§fn clone(&self) -> RangePartitioning
fn clone(&self) -> RangePartitioning
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for RangePartitioning
impl Debug for RangePartitioning
Source§impl Display for RangePartitioning
impl Display for RangePartitioning
Source§impl PartialEq for RangePartitioning
impl PartialEq for RangePartitioning
impl StructuralPartialEq for RangePartitioning
Auto Trait Implementations§
impl !RefUnwindSafe for RangePartitioning
impl !UnwindSafe for RangePartitioning
impl Freeze for RangePartitioning
impl Send for RangePartitioning
impl Sync for RangePartitioning
impl Unpin for RangePartitioning
impl UnsafeUnpin for RangePartitioning
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more