datafusion-match-recognize 0.55.0

SQL MATCH_RECOGNIZE row-pattern matching for Apache DataFusion
Documentation
// Licensed under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License.  You may obtain a copy of the License at
//
//   http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied.  See the License for the
// specific language governing permissions and limitations
// under the License.
//
// This product includes software developed at Datadog (https://www.datadoghq.com/) Copyright 2025-Present Datadog, Inc.

//! Capability-derived lane program and resumable executor.
//!
//! Variant sealing authenticates the exact automaton, executable symbol
//! allocation, ordered transitions, complete state and path capabilities, and
//! bounded storage together. Rejection leaves the generic route selected before
//! candidate mutation. An admitted candidate owns fixed, pool-accounted state.
//! A capacity miss discards its unpublished attempt and retries the same start
//! through General; other query and resource errors keep their normal meaning.
//! Compressed paths use the ordinary comparer and selected-path validator before
//! the shared skip/output transaction publishes a result.
//!
//! A greedy candidate with a unique eligible edge advances one active slot in
//! place. A proved terminal choice may also try ordered siblings with private
//! register and navigation values. Ambiguity uses ordinary Lane, transferring an
//! eligible prefix (when no incumbent exists) or replaying the unpublished candidate.
//! `route.scan.direct_linear` counts candidates that executed this path.

mod compiler;
mod direct_history;
mod direct_linear;
pub(crate) mod direct_payload;
mod executor;
mod graph;
mod ir;
pub(crate) mod path;
mod selected;
mod selection;
pub(crate) use selected::{
    ClassifierDemand, CompactSelection, LaneSelectedRuns, SymbolCaptures,
};
pub(in crate::execution::matching) use selection::commit_scratch_transition;
pub(crate) mod start_search;
mod state;

pub(super) use compiler::build_admitted_lane;
#[cfg(test)]
pub(crate) use compiler::{LaneCompileOutcome, try_compile};
pub(crate) use compiler::{LaneSessionFacts, control_rejection_with_navigation};
pub(crate) use direct_linear::{
    DirectLinearCursor, DirectLinearStep, DirectScratch, StaticProbe,
};
pub(crate) use executor::{
    LaneCollection, resume_candidate_scan, start_local_candidate_scan,
};
pub(crate) use ir::LaneScanProgram;
pub(crate) use ir::{LaneBoundaryAnchors, LaneRejection, LaneState, SymbolFacts};
pub(crate) use state::{LaneScanState, is_lane_capacity_miss};

#[cfg(test)]
pub(crate) use ir::LaneCapacity;