pub struct SortField {
pub sort_key_index: i32,
pub expression: String,
pub dialect: String,
pub direction: SortDirection,
pub null_order: NullOrder,
}Expand description
One key of a sort spec: an expression to sort by, plus direction and null order.
The key is an expression string (ducklake_sort_expression.expression), not a
column_id — DuckLake sort keys are expression-based. For a spec this crate
produced, expression is a bare column name; for a spec written by DuckDB it may
be any expression, in which case SortField::column_candidate returns None
and the write path rejects the unsupported sort contract.
Fields§
§sort_key_index: i320-based position of this key within the sort order.
expression: StringThe sort expression (ducklake_sort_expression.expression).
dialect: StringThe expression dialect (ducklake_sort_expression.dialect), e.g. "duckdb".
direction: SortDirectionAscending or descending.
null_order: NullOrderWhere nulls sort.
Implementations§
Source§impl SortField
impl SortField
Sourcepub fn column(
sort_key_index: i32,
column: impl Into<String>,
direction: SortDirection,
null_order: NullOrder,
) -> Self
pub fn column( sort_key_index: i32, column: impl Into<String>, direction: SortDirection, null_order: NullOrder, ) -> Self
Build a bare-column sort field this crate can produce. expression is the
column name; dialect is set to DUCKDB_DIALECT.
Sourcepub fn column_candidate(&self) -> Option<String>
pub fn column_candidate(&self) -> Option<String>
Interpret this key’s expression as a bare column reference, returning the
column name if it is one. A bare column is either an unquoted simple
identifier (ts, device_id) or a double-quoted identifier ("My Col",
unquoted here). Anything else — function calls, arithmetic, qualified names,
multiple tokens — yields None.
Trait Implementations§
impl Eq for SortField
impl StructuralPartialEq for SortField
Auto Trait Implementations§
impl Freeze for SortField
impl RefUnwindSafe for SortField
impl Send for SortField
impl Sync for SortField
impl Unpin for SortField
impl UnsafeUnpin for SortField
impl UnwindSafe for SortField
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