Skip to main content

datafusion_physical_plan/
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#![doc(
19    html_logo_url = "https://raw.githubusercontent.com/apache/datafusion/19fe44cf2f30cbdd63d4a4f52c74055163c6cc38/docs/logos/standalone_logo/logo_original.svg",
20    html_favicon_url = "https://raw.githubusercontent.com/apache/datafusion/19fe44cf2f30cbdd63d4a4f52c74055163c6cc38/docs/logos/standalone_logo/logo_original.svg"
21)]
22#![cfg_attr(docsrs, feature(doc_cfg))]
23// Make sure fast / cheap clones on Arc are explicit:
24// https://github.com/apache/datafusion/issues/11143
25#![deny(clippy::clone_on_ref_ptr)]
26#![cfg_attr(test, allow(clippy::needless_pass_by_value))]
27
28//! Traits for physical query plan, supporting parallel execution for partitioned relations.
29//!
30//! Entrypoint of this crate is trait [ExecutionPlan].
31
32pub use datafusion_common::hash_utils;
33pub use datafusion_common::utils::project_schema;
34pub use datafusion_common::{ColumnStatistics, Statistics, internal_err};
35pub use datafusion_execution::{RecordBatchStream, SendableRecordBatchStream};
36pub use datafusion_expr::{Accumulator, ColumnarValue};
37use datafusion_physical_expr::PhysicalSortExpr;
38pub use datafusion_physical_expr::window::WindowExpr;
39pub use datafusion_physical_expr::{
40    Distribution, Partitioning, PhysicalExpr, RangePartitioning, SplitPoint, expressions,
41};
42
43pub use crate::display::{DefaultDisplay, DisplayAs, DisplayFormatType, VerboseDisplay};
44pub use crate::distribution_requirements::{
45    ChildSatisfactionOptions, InputDistributionRequirements,
46};
47#[expect(deprecated)]
48pub use crate::execution_plan::{
49    AsPhysicalExprRef, ChildrenPropertiesMode, ExecutionPlan, ExecutionPlanProperties,
50    PlanProperties, ReplaceChildrenOptions, apply_expression_roots, collect,
51    collect_partitioned, displayable, execute_input_stream, execute_stream,
52    execute_stream_partitioned, get_plan_string, replace_children_if_necessary,
53    with_new_children_if_necessary,
54};
55pub use crate::metrics::Metric;
56pub use crate::ordering::InputOrderMode;
57pub use crate::sort_pushdown::SortOrderPushdownResult;
58pub use crate::statistics::{ChildStats, StatisticsArgs, StatisticsContext};
59pub use crate::stream::EmptyRecordBatchStream;
60pub use crate::topk::TopK;
61pub use crate::visitor::{ExecutionPlanVisitor, accept, visit_execution_plan};
62pub use crate::work_table::WorkTable;
63pub use spill::spill_manager::SpillManager;
64
65mod ordering;
66mod render_tree;
67mod topk;
68mod visitor;
69
70pub mod aggregates;
71pub mod analyze;
72pub mod async_func;
73pub mod buffer;
74pub mod coalesce;
75pub mod coalesce_batches;
76pub mod coalesce_partitions;
77pub mod column_rewriter;
78pub mod common;
79pub mod coop;
80pub mod display;
81pub mod distribution_requirements;
82pub mod empty;
83pub mod execution_plan;
84pub mod explain;
85pub mod filter;
86pub mod filter_pushdown;
87pub mod joins;
88pub mod limit;
89pub mod memory;
90pub mod metrics;
91pub mod operator_statistics;
92pub mod placeholder_row;
93pub mod projection;
94#[cfg(feature = "proto")]
95pub mod proto;
96pub mod recursive_query;
97pub mod repartition;
98pub mod scalar_subquery;
99pub mod sort_pushdown;
100pub mod sorts;
101pub mod spill;
102pub mod statistics;
103pub mod stream;
104pub mod streaming;
105pub mod tree_node;
106pub mod union;
107pub mod unnest;
108pub mod windows;
109pub mod work_table;
110pub mod udaf {
111    pub use datafusion_expr::StatisticsArgs;
112    pub use datafusion_physical_expr::aggregate::AggregateFunctionExpr;
113}
114
115pub mod test;