Skip to main content

execute_streaming_match_recognize

Function execute_streaming_match_recognize 

Source
pub fn execute_streaming_match_recognize(
    stmt: &MatchRecognizeStatement,
    new_batches: &[RecordBatch],
    state: &mut PartitionedCepMatcher<String>,
) -> SqlResult<Vec<RecordBatch>>
Expand description

Incrementally apply a MATCH_RECOGNIZE pattern to a new batch of events from a streaming source, updating state in place.

Unlike execute_match_recognize, this function does not require all source rows upfront — it feeds only the events in new_batches to the per-key matcher state and returns any pattern completions produced by this batch. The caller owns state and passes the same instance on every call, accumulating pattern state across many batches.

Keys whose last event is older than within_ms × 2 are evicted from state to prevent unbounded memory growth for high-cardinality key spaces.