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§
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 more