#[non_exhaustive]pub enum WindowFunctionSpec {
Show 19 variants
RowNumber,
Rank,
DenseRank,
Ntile {
n: u32,
},
PercentRank,
CumeDist,
Lag {
field: String,
offset: i32,
default: Option<Value>,
},
Lead {
field: String,
offset: i32,
default: Option<Value>,
},
FirstValue {
field: String,
},
LastValue {
field: String,
},
NthValue {
field: String,
n: u32,
},
RunningSum {
measure: String,
},
RunningAvg {
measure: String,
},
RunningCount,
RunningCountField {
field: String,
},
RunningMin {
measure: String,
},
RunningMax {
measure: String,
},
RunningStddev {
measure: String,
},
RunningVariance {
measure: String,
},
}Expand description
Window function specification using semantic field names.
Unlike WindowFunctionType which uses raw SQL expressions,
this uses measure/dimension names that get validated against metadata.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
RowNumber
ROW_NUMBER() - Sequential number within partition
Rank
RANK() - Rank with gaps for ties
DenseRank
DENSE_RANK() - Rank without gaps
Ntile
NTILE(n) - Divide rows into n groups
PercentRank
PERCENT_RANK() - Relative rank (0 to 1)
CumeDist
CUME_DIST() - Cumulative distribution
Lag
LAG(field, offset, default) - Value from previous row
Fields
Lead
LEAD(field, offset, default) - Value from next row
Fields
FirstValue
FIRST_VALUE(field) - First value in window frame
LastValue
LAST_VALUE(field) - Last value in window frame
NthValue
NTH_VALUE(field, n) - Nth value in window frame
RunningSum
SUM(measure) OVER (…) - Running total
RunningAvg
AVG(measure) OVER (…) - Moving average
RunningCount
COUNT(*) OVER (…) - Running count
RunningCountField
COUNT(field) OVER (…) - Running count of non-null values
RunningMin
MIN(measure) OVER (…) - Running minimum
RunningMax
MAX(measure) OVER (…) - Running maximum
RunningStddev
STDDEV(measure) OVER (…) - Running standard deviation
RunningVariance
VARIANCE(measure) OVER (…) - Running variance
Trait Implementations§
Source§impl Clone for WindowFunctionSpec
impl Clone for WindowFunctionSpec
Source§fn clone(&self) -> WindowFunctionSpec
fn clone(&self) -> WindowFunctionSpec
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for WindowFunctionSpec
impl Debug for WindowFunctionSpec
Source§impl<'de> Deserialize<'de> for WindowFunctionSpec
impl<'de> Deserialize<'de> for WindowFunctionSpec
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for WindowFunctionSpec
impl PartialEq for WindowFunctionSpec
Source§impl Serialize for WindowFunctionSpec
impl Serialize for WindowFunctionSpec
impl Eq for WindowFunctionSpec
impl StructuralPartialEq for WindowFunctionSpec
Auto Trait Implementations§
impl Freeze for WindowFunctionSpec
impl RefUnwindSafe for WindowFunctionSpec
impl Send for WindowFunctionSpec
impl Sync for WindowFunctionSpec
impl Unpin for WindowFunctionSpec
impl UnsafeUnpin for WindowFunctionSpec
impl UnwindSafe for WindowFunctionSpec
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<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<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