Expand description
SQL MATCH_RECOGNIZE for Apache DataFusion.
This is the main application crate. new_match_recognize_context installs
the functions, planners, and optimizer rules required by the extension and
returns a new DataFusion context. MatchRecognizeConfig controls compile
and runtime limits when an application needs values other than the defaults.
§Install the extension
Applications must depend on the matching official Apache DataFusion 56.0.0
release from crates.io. See Add the extension to an application for the
dependency declaration.
use datafusion::execution::SessionStateBuilder;
use datafusion_match_recognize::new_match_recognize_context;
let builder = SessionStateBuilder::new().with_default_features();
let ctx = new_match_recognize_context(builder)?;Register tables and run queries on the returned context. The installer
preserves the builder’s configuration and extensions, replaces its query
planner, and appends the required optimizer rules. See
new_match_recognize_context for the registration order, replaced function
registrations, duplicate-installation behavior, and possible errors. An
already-created SessionContext is not modified in place.
§Cargo features
sql(default) installs the adapter that turnsMATCH_RECOGNIZESQL into a DataFusion logical plan. Without it, applications build plans directly throughplanningor supply them through another integration.substraitexposes this package’s Substrait import and export helpers in thesubstraitmodule.
The advanced module exposes unstable component-by-component registration
for hosts that cannot use the normal installer. Applications that build
patterns directly in Rust use planning rather than those hooks.
§Guides and reference
- Run the example and its assertions
- Add the extension to an application
- Build a row pattern step by step
- Check SQL support
- Review configuration and feature combinations
- Evaluate a production workload
These web links follow the current main branch. When using a pinned
revision, read the corresponding files and Rustdoc from that checkout.
Re-exports§
pub use config::MatchRecognizeConfig;
Modules§
- advanced
- Unstable hooks for hosts that perform DataFusion registration manually.
- config
- Session settings used by physical planning and execution. Configuration options for MATCH_RECOGNIZE pattern matching.
- planning
- SQL-independent semantic planning for
MATCH_RECOGNIZE. - substrait
- Imports and exports
MATCH_RECOGNIZEthrough this package’s Substrait extension.
Functions§
- new_
match_ recognize_ context - Build a DataFusion context with
MATCH_RECOGNIZEsupport for the enabled Cargo features.