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.

//! Static and stateful candidate matching, with shared graph and output contracts.

mod aggregate_runtime;
pub(crate) mod anchors;
mod bindings;
mod collection;
mod collection_batch;
mod dedup;
pub(crate) mod epsilon;
pub(crate) mod graph;
mod matcher;
mod output_plan;
mod partition_key;
pub(in crate::execution) mod partition_scan;
pub(crate) mod path;
mod pattern_optimization;
pub(crate) mod program;
pub(crate) mod row_loop;
pub(crate) mod selection;
pub(crate) mod state_set;
mod stream_requirements;
pub(crate) mod symbol_columns;
mod symbol_program;
pub(crate) mod symbols;
#[cfg(test)]
mod tests;

pub(crate) use bindings::ResolvedInputColumn;
pub(crate) use bindings::{
    NextMatchCursor, ResolvedAfterMatchSkip, ResolvedBoolColumn, SymbolColumn,
    SymbolTable,
};
pub(crate) use collection::ProcessRowsInput;
#[cfg(test)]
pub(crate) use collection::SkipDirect;
pub(crate) use collection_batch::PreparingPhysicalBoolColumns;
pub use matcher::PatternMatcher;
pub(crate) use matcher::{AggregateHotTables, MatcherConfiguration};
pub(crate) use output_plan::{
    ExecutableDirectCountSummary, ExecutableEdge, ExecutableOutputFinalizer,
    ExecutableOutputPlan, ExecutableReduction, ExecutableRowStreamPlan,
    SelectedReductionOp, WinningValue,
};
#[cfg(test)]
pub(crate) use partition_key::owned_partition_key;
pub(crate) use partition_key::{
    PartitionKey, PartitionKeyBatch, PartitionKeyRows, PartitionKeySchema,
    key_memory_overflow, shared_empty_partition_key,
};
#[cfg(test)]
pub(crate) use program::contracts::AggregateProgram;
pub(crate) use program::contracts::SymbolProgram;
pub(crate) use program::{ExecutableMatchProgram, PreparedMatcherProgram};
pub(crate) use row_loop::compiled_program::ExecutablePatternVariant;
#[cfg(test)]
pub(crate) use row_loop::state::ScanContext;
pub(crate) use symbol_program::{
    DefineCachePolicy, ExecutableAggregateStateProgram, ExecutableIncrementalEvaluator,
    ExecutableStaticPrecheckProgram, ExecutableSymbolEvaluator, ExecutableSymbolProgram,
    ExecutableUserSymbolProgram, LeadingGuard,
};
#[cfg(test)]
pub(crate) use tests::harness::{
    SelectedLane, TestCompiledAutomaton, build_test_executable, build_test_task_context,
    deterministic_test_config, scan_test_lane, seal_test_executable, static_test_program,
    test_executable_input, test_executable_symbol_programs_for_static,
    test_symbol_columns, test_symbol_programs_for_automaton,
    test_symbol_programs_with_vm_for_automaton, test_user_symbol_program,
};
#[cfg(test)]
pub(crate) use tests::output_test_helper::RowOutputHarness;
#[cfg(test)]
pub(crate) use tests::test_helper::{
    CollectionTestDriver, CountingBoolExpr, TEST_OUTPUT_METADATA, add_count_accumulator,
    add_count_register, add_count_register_at, add_nav_register_at, build_test_matcher,
    test_output_program,
};
#[cfg(test)]
pub(crate) use tests::{predicate_test_helper, static_test_support, test_helper};