pub enum SortOrderPushdownResult<T> {
Exact {
inner: T,
},
Inexact {
inner: T,
},
Unsupported,
}Expand description
Result of attempting to push down sort ordering to a node.
Used by ExecutionPlan::try_pushdown_sort to communicate
whether and how sort ordering was successfully pushed down.
Variants§
Exact
The source can guarantee exact ordering (data is perfectly sorted).
When this is returned, the optimizer can safely remove the Sort operator entirely since the data source guarantees the requested ordering.
Fields
inner: TThe optimized node that provides exact ordering
Inexact
The source has optimized for the ordering but cannot guarantee perfect sorting.
This indicates the data source has been optimized (e.g., reordered files/row groups based on statistics, enabled reverse scanning) but the data may not be perfectly sorted. The optimizer should keep the Sort operator but benefits from the optimization (e.g., faster TopK queries due to early termination).
Fields
inner: TThe optimized node that provides approximate ordering
Unsupported
The source cannot optimize for this ordering.
The data source does not support the requested sort ordering and no optimization was applied.
Implementations§
Source§impl<T> SortOrderPushdownResult<T>
impl<T> SortOrderPushdownResult<T>
Sourcepub fn into_inner(self) -> Option<T>
pub fn into_inner(self) -> Option<T>
Extract the inner value if present
Sourcepub fn map<U, F: FnOnce(T) -> U>(self, f: F) -> SortOrderPushdownResult<U>
pub fn map<U, F: FnOnce(T) -> U>(self, f: F) -> SortOrderPushdownResult<U>
Map the inner value to a different type while preserving the variant.
Sourcepub fn try_map<U, E, F: FnOnce(T) -> Result<U, E>>(
self,
f: F,
) -> Result<SortOrderPushdownResult<U>, E>
pub fn try_map<U, E, F: FnOnce(T) -> Result<U, E>>( self, f: F, ) -> Result<SortOrderPushdownResult<U>, E>
Try to map the inner value, returning an error if the function fails.
Sourcepub fn into_inexact(self) -> Self
pub fn into_inexact(self) -> Self
Convert this result to Inexact, downgrading Exact if present.
This is useful when an operation (like merging multiple partitions) cannot guarantee exact ordering even if the input provides it.
§Examples
let exact = SortOrderPushdownResult::Exact { inner: 42 };
let inexact = exact.into_inexact();
assert!(matches!(inexact, SortOrderPushdownResult::Inexact { inner: 42 }));
let already_inexact = SortOrderPushdownResult::Inexact { inner: 42 };
let still_inexact = already_inexact.into_inexact();
assert!(matches!(still_inexact, SortOrderPushdownResult::Inexact { inner: 42 }));
let unsupported = SortOrderPushdownResult::<i32>::Unsupported;
let still_unsupported = unsupported.into_inexact();
assert!(matches!(still_unsupported, SortOrderPushdownResult::Unsupported));Trait Implementations§
Source§impl<T: Clone> Clone for SortOrderPushdownResult<T>
impl<T: Clone> Clone for SortOrderPushdownResult<T>
Source§fn clone(&self) -> SortOrderPushdownResult<T>
fn clone(&self) -> SortOrderPushdownResult<T>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl<T> Freeze for SortOrderPushdownResult<T>where
T: Freeze,
impl<T> RefUnwindSafe for SortOrderPushdownResult<T>where
T: RefUnwindSafe,
impl<T> Send for SortOrderPushdownResult<T>where
T: Send,
impl<T> Sync for SortOrderPushdownResult<T>where
T: Sync,
impl<T> Unpin for SortOrderPushdownResult<T>where
T: Unpin,
impl<T> UnwindSafe for SortOrderPushdownResult<T>where
T: UnwindSafe,
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