pub struct SortSpec {
pub sort_id: i64,
pub fields: Vec<SortField>,
}Expand description
A table’s active sort spec (one generation of ducklake_sort_info).
Fields§
§sort_id: i64ducklake_sort_info.sort_id for this spec generation.
fields: Vec<SortField>Sort keys, ordered by sort_key_index (primary key first).
Implementations§
Source§impl SortSpec
impl SortSpec
Sourcepub fn is_producible(&self) -> bool
pub fn is_producible(&self) -> bool
Whether this crate can apply this sort on write: true only when every key is a bare column reference. A spec containing any non-column expression is not producible and must be rejected by data-writing operations.
Sourcepub fn producible_columns(
&self,
) -> Option<Vec<(String, SortDirection, NullOrder)>>
pub fn producible_columns( &self, ) -> Option<Vec<(String, SortDirection, NullOrder)>>
The producible sort keys as (column_name, direction, null_order), in order,
or None if any key is not a bare column (see SortSpec::is_producible).
Sourcepub fn from_rows(
rows: Vec<(i64, i32, String, String, String, String)>,
) -> Option<SortSpec>
pub fn from_rows( rows: Vec<(i64, i32, String, String, String, String)>, ) -> Option<SortSpec>
Build a spec from catalog rows (sort_id, sort_key_index, expression, dialect, sort_direction, null_order) — the join of ducklake_sort_info and
ducklake_sort_expression for the single LIVE generation, ordered by
sort_key_index. Returns None when there are no rows (unsorted). Every row
is expected to carry the same sort_id; the first row’s id is used.
Trait Implementations§
impl Eq for SortSpec
impl StructuralPartialEq for SortSpec
Auto Trait Implementations§
impl Freeze for SortSpec
impl RefUnwindSafe for SortSpec
impl Send for SortSpec
impl Sync for SortSpec
impl Unpin for SortSpec
impl UnsafeUnpin for SortSpec
impl UnwindSafe for SortSpec
Blanket Implementations§
impl<T> Allocation for T
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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