datafusion-match-recognize 0.56.0

MATCH_RECOGNIZE extension for 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.

//! Builds the DataFusion physical operator and its executable matcher program.

pub(in crate::execution) mod classification;
// Retain the import used by the compact-input adapter; binding lives in classification.
use classification as stateful_classification;
pub(in crate::execution) mod exec;
mod fixed_prefixes;
mod halo;
pub(in crate::execution) mod navigation;
pub(in crate::execution) mod planner;
mod properties;
pub(crate) mod running_window;
pub(in crate::execution) mod statistical_absence;
pub(in crate::execution) mod virtual_input;

pub(crate) use exec::{MatchRecognizePatternExec, PartitionRetention};
pub use exec::{match_recognize_grouped_order_rule, try_absorb_synthetic_row_filter};
#[cfg(test)]
pub(crate) use planner::plan_match_recognize_extension;
pub use planner::{MatchRecognizeQueryPlanner, match_recognize_extension_planner};

use datafusion_physical_plan::ExecutionPlan;

/// Whether `plan` itself is this crate's `MATCH_RECOGNIZE` physical operator.
///
/// This check does not walk child plans. It also does not identify the
/// surrounding Halo, repartition, sort, or projection operators that may form
/// part of a complete no-partition execution pipeline.
pub fn is_match_recognize_exec(plan: &dyn ExecutionPlan) -> bool {
    plan.downcast_ref::<MatchRecognizePatternExec>().is_some()
}