pub struct WindowOperatorConfig {
pub window_type: WindowType,
pub time_column: String,
pub size: Duration,
pub slide: Option<Duration>,
pub gap: Option<Duration>,
pub offset_ms: i64,
pub allowed_lateness: Duration,
pub emit_strategy: EmitStrategy,
pub late_data_side_output: Option<String>,
}Expand description
Complete configuration for instantiating a window operator.
This structure holds all the information needed to create and configure a window operator in Ring 0.
§EMIT ON WINDOW CLOSE
When emit_strategy is OnWindowClose or FinalOnly, use validate()
to ensure the configuration is valid. These strategies require:
- A watermark definition on the source (timers are driven by watermark)
- A windowed aggregation context (non-windowed queries cannot use EOWC)
Fields§
§window_type: WindowTypeThe type of window (tumbling, sliding, session)
time_column: StringThe time column name used for windowing
size: DurationWindow size (for tumbling and sliding)
slide: Option<Duration>Slide interval for sliding windows
gap: Option<Duration>Gap interval for session windows
offset_ms: i64Window offset in milliseconds for timezone-aligned windows
allowed_lateness: DurationMaximum allowed lateness for late events
emit_strategy: EmitStrategyEmit strategy (when to output results)
late_data_side_output: Option<String>Side output name for late data (if configured)
Implementations§
Source§impl WindowOperatorConfig
impl WindowOperatorConfig
Sourcepub fn tumbling(time_column: String, size: Duration) -> Self
pub fn tumbling(time_column: String, size: Duration) -> Self
Create a new tumbling window configuration.
Sourcepub fn sliding(time_column: String, size: Duration, slide: Duration) -> Self
pub fn sliding(time_column: String, size: Duration, slide: Duration) -> Self
Create a new sliding window configuration.
Sourcepub fn session(time_column: String, gap: Duration) -> Self
pub fn session(time_column: String, gap: Duration) -> Self
Create a new session window configuration.
Sourcepub fn cumulate(time_column: String, step: Duration, max_size: Duration) -> Self
pub fn cumulate(time_column: String, step: Duration, max_size: Duration) -> Self
Create a new cumulate window configuration.
step is the window growth increment and max_size is the epoch
size. The slide field is reused to store the step interval.
Sourcepub fn with_offset_ms(self, offset_ms: i64) -> Self
pub fn with_offset_ms(self, offset_ms: i64) -> Self
Set window offset in milliseconds.
Sourcepub fn from_window_function(window: &WindowFunction) -> Result<Self, ParseError>
pub fn from_window_function(window: &WindowFunction) -> Result<Self, ParseError>
Build configuration from a parsed WindowFunction.
§Errors
Returns ParseError::WindowError if:
- Time column cannot be extracted
- Interval cannot be parsed
Sourcepub fn with_emit_clause(
self,
emit_clause: &EmitClause,
) -> Result<Self, ParseError>
pub fn with_emit_clause( self, emit_clause: &EmitClause, ) -> Result<Self, ParseError>
Apply EMIT clause configuration.
§Errors
Returns ParseError::WindowError if the emit clause cannot be converted.
Sourcepub fn with_late_data_clause(
self,
late_data_clause: &LateDataClause,
) -> Result<Self, ParseError>
pub fn with_late_data_clause( self, late_data_clause: &LateDataClause, ) -> Result<Self, ParseError>
Apply late data clause configuration.
§Errors
Returns ParseError::WindowError if the allowed lateness cannot be parsed.
Sourcepub fn with_allowed_lateness(self, lateness: Duration) -> Self
pub fn with_allowed_lateness(self, lateness: Duration) -> Self
Set allowed lateness duration.
Sourcepub fn with_emit_strategy(self, strategy: EmitStrategy) -> Self
pub fn with_emit_strategy(self, strategy: EmitStrategy) -> Self
Set emit strategy.
Sourcepub fn with_late_data_side_output(self, name: String) -> Self
pub fn with_late_data_side_output(self, name: String) -> Self
Set late data side output.
Sourcepub fn validate(
&self,
has_watermark: bool,
has_window: bool,
) -> Result<(), ParseError>
pub fn validate( &self, has_watermark: bool, has_window: bool, ) -> Result<(), ParseError>
Validates that the window operator configuration is used in a valid context.
Checks:
EMIT ON WINDOW CLOSEandEMIT FINALrequire a watermark on the sourceEMIT ON WINDOW CLOSEandEMIT FINALrequire a windowed aggregation
§Arguments
has_watermark- Whether the source has a watermark definitionhas_window- Whether the query contains a windowed aggregation
§Errors
Returns ParseError::WindowError if validation fails.
Sourcepub fn is_append_only_compatible(&self) -> bool
pub fn is_append_only_compatible(&self) -> bool
Check if this configuration supports append-only output.
Append-only sinks (Kafka, S3, Delta Lake) require emit strategies that don’t produce retractions.
Sourcepub fn has_late_data_handling(&self) -> bool
pub fn has_late_data_handling(&self) -> bool
Check if late data handling is configured.
Trait Implementations§
Source§impl Clone for WindowOperatorConfig
impl Clone for WindowOperatorConfig
Source§fn clone(&self) -> WindowOperatorConfig
fn clone(&self) -> WindowOperatorConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for WindowOperatorConfig
impl Debug for WindowOperatorConfig
Auto Trait Implementations§
impl Freeze for WindowOperatorConfig
impl RefUnwindSafe for WindowOperatorConfig
impl Send for WindowOperatorConfig
impl Sync for WindowOperatorConfig
impl Unpin for WindowOperatorConfig
impl UnsafeUnpin for WindowOperatorConfig
impl UnwindSafe for WindowOperatorConfig
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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<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 moreSource§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.