pub enum EmitClause {
AfterWatermark,
OnWindowClose,
Periodically {
interval: Box<Expr>,
},
OnUpdate,
Changes,
Final,
}Expand description
EMIT clause for controlling output timing.
This is the SQL AST representation of emit strategies.
See laminar_core::operator::window::EmitStrategy for the runtime representation.
Variants§
AfterWatermark
EMIT AFTER WATERMARK (or EMIT ON WATERMARK)
Emit results when the watermark passes the window end. This is the most efficient strategy.
OnWindowClose
EMIT ON WINDOW CLOSE
For append-only sinks (Kafka, S3, Delta Lake, Iceberg).
Only emits when window closes, no intermediate results.
Unlike AfterWatermark, this is NOT a synonym - it has distinct behavior.
Periodically
EMIT EVERY INTERVAL ‘N’ unit (or EMIT PERIODICALLY)
Emit intermediate results at fixed intervals. Final results are still emitted on watermark.
OnUpdate
EMIT ON UPDATE
Emit updated results after every state change. This provides lowest latency but highest overhead.
Changes
EMIT CHANGES
Emit changelog records with Z-set weights for CDC pipelines. Every emission includes operation type and weight:
- Insert (+1 weight)
- Delete (-1 weight)
- Update (retraction pair: -1 old, +1 new)
Required for:
- CDC pipelines
- Cascading materialized views
- Downstream consumers that need to track changes
Final
EMIT FINAL
Suppress ALL intermediate results, emit only finalized. Also drops late data entirely after window close. Use for BI reporting where only final, exact results matter.
Implementations§
Source§impl EmitClause
impl EmitClause
Sourcepub fn to_emit_strategy(&self) -> Result<EmitStrategy, ParseError>
pub fn to_emit_strategy(&self) -> Result<EmitStrategy, ParseError>
Convert to runtime EmitStrategy.
§Errors
Returns ParseError::WindowError if the periodic interval cannot be parsed.
Sourcepub fn requires_changelog(&self) -> bool
pub fn requires_changelog(&self) -> bool
Check if this emit strategy requires changelog/retraction support.
Sourcepub fn is_append_only(&self) -> bool
pub fn is_append_only(&self) -> bool
Check if this emit strategy is append-only (no retractions).
Trait Implementations§
Source§impl Clone for EmitClause
impl Clone for EmitClause
Source§fn clone(&self) -> EmitClause
fn clone(&self) -> EmitClause
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for EmitClause
impl Debug for EmitClause
Source§impl PartialEq for EmitClause
impl PartialEq for EmitClause
impl StructuralPartialEq for EmitClause
Auto Trait Implementations§
impl Freeze for EmitClause
impl RefUnwindSafe for EmitClause
impl Send for EmitClause
impl Sync for EmitClause
impl Unpin for EmitClause
impl UnwindSafe for EmitClause
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.