Skip to main content

datafusion_session/
lib.rs

1// Licensed to the Apache Software Foundation (ASF) under one
2// or more contributor license agreements.  See the NOTICE file
3// distributed with this work for additional information
4// regarding copyright ownership.  The ASF licenses this file
5// to you under the Apache License, Version 2.0 (the
6// "License"); you may not use this file except in compliance
7// with the License.  You may obtain a copy of the License at
8//
9//   http://www.apache.org/licenses/LICENSE-2.0
10//
11// Unless required by applicable law or agreed to in writing,
12// software distributed under the License is distributed on an
13// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14// KIND, either express or implied.  See the License for the
15// specific language governing permissions and limitations
16// under the License.
17
18// Make sure fast / cheap clones on Arc are explicit:
19// https://github.com/apache/datafusion/issues/11143
20#![cfg_attr(not(test), deny(clippy::clone_on_ref_ptr))]
21#![cfg_attr(test, allow(clippy::needless_pass_by_value))]
22
23//! Session APIs for the DataFusion query execution environment
24//!
25//! This crate defines shared interfaces for session-related APIs and extension
26//! points. Concrete query-engine implementations are provided by higher-level
27//! DataFusion crates.
28//!
29//! Key components:
30//! * [`Session`] - Describes a query execution context, including configurations,
31//!   catalogs, and runtime state
32//! * [`CatalogProviderList`], [`CatalogProvider`], and [`SchemaProvider`] -
33//!   Describe catalog hierarchies
34//! * [`TableProvider`] - Provides data for query planning and execution
35//! * [`QueryPlanner`], [`PhysicalPlanner`], and [`ExtensionPlanner`] - Query and
36//!   physical planning contracts
37//! * [`PhysicalOptimizerRule`] and [`PhysicalOptimizerContext`] - Physical
38//!   optimization contracts
39//! * [`SessionStore`] - Handles session persistence and retrieval
40//!
41//! The session system enables:
42//! * Configuration management for query execution
43//! * Catalog and schema management
44//! * Function registry access
45//! * Runtime environment configuration
46//! * Query state persistence
47
48pub mod catalog;
49pub mod physical_optimizer;
50pub mod planner;
51pub mod schema;
52pub mod session;
53pub mod table;
54
55pub use crate::catalog::{
56    CatalogProvider, CatalogProviderList, EmptyCatalogProviderList,
57};
58pub use crate::physical_optimizer::{PhysicalOptimizerContext, PhysicalOptimizerRule};
59pub use crate::planner::{
60    ExtensionPlanner, PhysicalPlanner, QueryPlanner, UnsupportedQueryPlanner,
61};
62pub use crate::schema::SchemaProvider;
63pub use crate::session::{Session, SessionStore};
64pub use crate::table::{
65    ScanArgs, ScanResult, TableFunction, TableFunctionArgs, TableFunctionImpl,
66    TableProvider, TableProviderFactory,
67};