pub struct WindowedStream<T> { /* private fields */ }Expand description
Represents a windowed stream for aggregation operations
Implementations§
Source§impl<T> WindowedStream<T>
impl<T> WindowedStream<T>
Sourcepub fn aggregate<A, F>(self, init: A, f: F) -> DataStream<A>
pub fn aggregate<A, F>(self, init: A, f: F) -> DataStream<A>
Aggregate values in the window
pub fn any<F>(self, f: F) -> DataStream<bool>
pub fn all<F>(self, f: F) -> DataStream<bool>
Sourcepub fn limit(self, n: usize) -> DataStream<Vec<T>>
pub fn limit(self, n: usize) -> DataStream<Vec<T>>
Limit the number of values in the window
Sourcepub fn tail(self, n: usize) -> DataStream<Vec<T>>
pub fn tail(self, n: usize) -> DataStream<Vec<T>>
Retain last n values in the window
Sourcepub fn sort_by<F>(self, f: F) -> DataStream<Vec<T>>
pub fn sort_by<F>(self, f: F) -> DataStream<Vec<T>>
Sort values in the window
Sourcepub fn sort_by_ts(self, order: SortOrder) -> DataStream<Vec<T>>
pub fn sort_by_ts(self, order: SortOrder) -> DataStream<Vec<T>>
Sort values in the window by timestamp
Sourcepub fn sort_by_ts_asc(self) -> DataStream<Vec<T>>
pub fn sort_by_ts_asc(self) -> DataStream<Vec<T>>
Sort values in the window by timestamp in ascending order
Sourcepub fn sort_by_ts_desc(self) -> DataStream<Vec<T>>
pub fn sort_by_ts_desc(self) -> DataStream<Vec<T>>
Sort values in the window by timestamp in descending order
Sourcepub fn skip(self, n: usize) -> DataStream<Vec<T>>
pub fn skip(self, n: usize) -> DataStream<Vec<T>>
Skip
Source§impl<T> WindowedStream<T>
impl<T> WindowedStream<T>
Sourcepub fn sort(self, ord: SortOrder) -> DataStream<Vec<T>>
pub fn sort(self, ord: SortOrder) -> DataStream<Vec<T>>
Sort values in specified order
Sourcepub fn top_k(self, k: usize) -> DataStream<Vec<T>>
pub fn top_k(self, k: usize) -> DataStream<Vec<T>>
Get the top k values in the window, the values are sorted in descending order
Source§impl<T> WindowedStream<T>
impl<T> WindowedStream<T>
Sourcepub fn distinct(self) -> DataStream<HashSet<T>>
pub fn distinct(self) -> DataStream<HashSet<T>>
Distinct values
Source§impl<T> WindowedStream<T>
impl<T> WindowedStream<T>
Sourcepub fn distinct_by_key<F, K>(self, f: F) -> DataStream<Vec<T>>
pub fn distinct_by_key<F, K>(self, f: F) -> DataStream<Vec<T>>
Distinct values by key. When the same key is encountered, the first occurrence of the value is retained
Auto Trait Implementations§
impl<T> Freeze for WindowedStream<T>
impl<T> !RefUnwindSafe for WindowedStream<T>
impl<T> Send for WindowedStream<T>
impl<T> Sync for WindowedStream<T>
impl<T> Unpin for WindowedStream<T>
impl<T> !UnwindSafe for WindowedStream<T>
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
Mutably borrows from an owned value. Read more