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// https://github.com/apache/datafusion/issues/18881
28#![deny(clippy::allow_attributes)]
29
30//! Traits for physical query plan, supporting parallel execution for partitioned relations.
31//!
32//! Entrypoint of this crate is trait [ExecutionPlan].
33
34pub use datafusion_common::hash_utils;
35pub use datafusion_common::utils::project_schema;
36pub use datafusion_common::{ColumnStatistics, Statistics, internal_err};
37pub use datafusion_execution::{RecordBatchStream, SendableRecordBatchStream};
38pub use datafusion_expr::{Accumulator, ColumnarValue};
39use datafusion_physical_expr::PhysicalSortExpr;
40pub use datafusion_physical_expr::window::WindowExpr;
41pub use datafusion_physical_expr::{
42    Distribution, Partitioning, PhysicalExpr, expressions,
43};
44
45pub use crate::display::{DefaultDisplay, DisplayAs, DisplayFormatType, VerboseDisplay};
46pub use crate::execution_plan::{
47    ExecutionPlan, ExecutionPlanProperties, PlanProperties, collect, collect_partitioned,
48    displayable, execute_input_stream, execute_stream, execute_stream_partitioned,
49    get_plan_string, with_new_children_if_necessary,
50};
51pub use crate::metrics::Metric;
52pub use crate::ordering::InputOrderMode;
53pub use crate::sort_pushdown::SortOrderPushdownResult;
54pub use crate::stream::EmptyRecordBatchStream;
55pub use crate::topk::TopK;
56pub use crate::visitor::{ExecutionPlanVisitor, accept, visit_execution_plan};
57pub use crate::work_table::WorkTable;
58pub use spill::spill_manager::SpillManager;
59
60mod ordering;
61mod render_tree;
62mod topk;
63mod visitor;
64
65pub mod aggregates;
66pub mod analyze;
67pub mod async_func;
68pub mod coalesce;
69pub mod coalesce_batches;
70pub mod coalesce_partitions;
71pub mod common;
72pub mod coop;
73pub mod display;
74pub mod empty;
75pub mod execution_plan;
76pub mod explain;
77pub mod filter;
78pub mod filter_pushdown;
79pub mod joins;
80pub mod limit;
81pub mod memory;
82pub mod metrics;
83pub mod placeholder_row;
84pub mod projection;
85pub mod recursive_query;
86pub mod repartition;
87pub mod sort_pushdown;
88pub mod sorts;
89pub mod spill;
90pub mod stream;
91pub mod streaming;
92pub mod tree_node;
93pub mod union;
94pub mod unnest;
95pub mod windows;
96pub mod work_table;
97pub mod udaf {
98    pub use datafusion_expr::StatisticsArgs;
99    pub use datafusion_physical_expr::aggregate::AggregateFunctionExpr;
100}
101
102pub mod test;