diff --git a/datafusion/core/src/execution/context.rs b/datafusion/core/src/execution/context.rs index 078093189c4cd..acf99808bf425 100644 --- a/datafusion/core/src/execution/context.rs +++ b/datafusion/core/src/execution/context.rs @@ -83,11 +83,11 @@ use crate::config::ConfigOptions; use crate::execution::{runtime_env::RuntimeEnv, FunctionRegistry}; use crate::physical_optimizer::dist_enforcement::EnforceDistribution; use crate::physical_plan::file_format::{plan_to_csv, plan_to_json, plan_to_parquet}; -use crate::physical_plan::planner::DefaultPhysicalPlanner; use crate::physical_plan::udaf::AggregateUDF; use crate::physical_plan::udf::ScalarUDF; use crate::physical_plan::ExecutionPlan; -use crate::physical_plan::PhysicalPlanner; +use crate::physical_planner::DefaultPhysicalPlanner; +use crate::physical_planner::PhysicalPlanner; use crate::variable::{VarProvider, VarType}; use async_trait::async_trait; use chrono::{DateTime, Utc}; diff --git a/datafusion/core/src/lib.rs b/datafusion/core/src/lib.rs index 4082a22daac19..d2cc5d43ef051 100644 --- a/datafusion/core/src/lib.rs +++ b/datafusion/core/src/lib.rs @@ -397,7 +397,7 @@ //! [`AnalyzerRule`]: datafusion_optimizer::analyzer::AnalyzerRule //! [`OptimizerRule`]: optimizer::optimizer::OptimizerRule //! [`ExecutionPlan`]: physical_plan::ExecutionPlan -//! [`PhysicalPlanner`]: physical_plan::PhysicalPlanner +//! [`PhysicalPlanner`]: physical_planner::PhysicalPlanner //! [`PhysicalOptimizerRule`]: datafusion::physical_optimizer::optimizer::PhysicalOptimizerRule //! [`Schema`]: arrow::datatypes::Schema //! [`PhysicalExpr`]: physical_plan::PhysicalExpr @@ -420,6 +420,7 @@ pub mod error; pub mod execution; pub mod physical_optimizer; pub mod physical_plan; +pub mod physical_planner; pub mod prelude; pub mod scalar; pub mod variable; diff --git a/datafusion/core/src/physical_plan/mod.rs b/datafusion/core/src/physical_plan/mod.rs index deff619b4ffe4..c45edd911efc8 100644 --- a/datafusion/core/src/physical_plan/mod.rs +++ b/datafusion/core/src/physical_plan/mod.rs @@ -88,9 +88,6 @@ impl Stream for EmptyRecordBatchStream { } } -/// Physical planner interface -pub use self::planner::PhysicalPlanner; - /// `ExecutionPlan` represent nodes in the DataFusion Physical Plan. /// /// Each `ExecutionPlan` is partition-aware and is responsible for @@ -687,7 +684,6 @@ pub mod joins; pub mod limit; pub mod memory; pub mod metrics; -pub mod planner; pub mod projection; pub mod repartition; pub mod sorts; diff --git a/datafusion/core/src/physical_plan/planner.rs b/datafusion/core/src/physical_planner.rs similarity index 99% rename from datafusion/core/src/physical_plan/planner.rs rename to datafusion/core/src/physical_planner.rs index 6f45b7b5452d8..05c744f8b0af0 100644 --- a/datafusion/core/src/physical_plan/planner.rs +++ b/datafusion/core/src/physical_planner.rs @@ -15,14 +15,8 @@ // specific language governing permissions and limitations // under the License. -//! Physical query planner +//! Planner for [`LogicalPlan`] to [`ExecutionPlan`] -use super::analyze::AnalyzeExec; -use super::unnest::UnnestExec; -use super::{ - aggregates, empty::EmptyExec, joins::PartitionMode, udaf, union::UnionExec, - values::ValuesExec, windows, -}; use crate::datasource::source_as_provider; use crate::execution::context::{ExecutionProps, SessionState}; use crate::logical_expr::utils::generate_sort_key; @@ -38,6 +32,7 @@ use crate::logical_expr::{Limit, Values}; use crate::physical_expr::create_physical_expr; use crate::physical_optimizer::optimizer::PhysicalOptimizerRule; use crate::physical_plan::aggregates::{AggregateExec, AggregateMode, PhysicalGroupBy}; +use crate::physical_plan::analyze::AnalyzeExec; use crate::physical_plan::explain::ExplainExec; use crate::physical_plan::expressions::{Column, PhysicalSortExpr}; use crate::physical_plan::filter::FilterExec; @@ -48,9 +43,14 @@ use crate::physical_plan::limit::{GlobalLimitExec, LocalLimitExec}; use crate::physical_plan::projection::ProjectionExec; use crate::physical_plan::repartition::RepartitionExec; use crate::physical_plan::sorts::sort::SortExec; +use crate::physical_plan::unnest::UnnestExec; use crate::physical_plan::windows::{ BoundedWindowAggExec, PartitionSearchMode, WindowAggExec, }; +use crate::physical_plan::{ + aggregates, empty::EmptyExec, joins::PartitionMode, udaf, union::UnionExec, + values::ValuesExec, windows, +}; use crate::physical_plan::{joins::utils as join_utils, Partitioning}; use crate::physical_plan::{AggregateExpr, ExecutionPlan, PhysicalExpr, WindowExpr}; use crate::{ @@ -1931,8 +1931,9 @@ mod tests { use crate::datasource::MemTable; use crate::physical_plan::SendableRecordBatchStream; use crate::physical_plan::{ - expressions, DisplayFormatType, Partitioning, PhysicalPlanner, Statistics, + expressions, DisplayFormatType, Partitioning, Statistics, }; + use crate::physical_planner::PhysicalPlanner; use crate::prelude::{SessionConfig, SessionContext}; use crate::scalar::ScalarValue; use crate::test_util::{scan_empty, scan_empty_with_partitions}; diff --git a/datafusion/core/tests/user_defined_plan.rs b/datafusion/core/tests/user_defined_plan.rs index 7738a123949f9..c237d8e632c97 100644 --- a/datafusion/core/tests/user_defined_plan.rs +++ b/datafusion/core/tests/user_defined_plan.rs @@ -80,11 +80,10 @@ use datafusion::{ }, optimizer::{optimize_children, OptimizerConfig, OptimizerRule}, physical_plan::{ - expressions::PhysicalSortExpr, - planner::{DefaultPhysicalPlanner, ExtensionPlanner}, - DisplayFormatType, Distribution, ExecutionPlan, Partitioning, PhysicalPlanner, - RecordBatchStream, SendableRecordBatchStream, Statistics, + expressions::PhysicalSortExpr, DisplayFormatType, Distribution, ExecutionPlan, + Partitioning, RecordBatchStream, SendableRecordBatchStream, Statistics, }, + physical_planner::{DefaultPhysicalPlanner, ExtensionPlanner, PhysicalPlanner}, prelude::{SessionConfig, SessionContext}, };