Apache DataFusion SQL Query Engine
Remove depreceted module datafusion::logical_plan::plan (#3759)
Andy Grove567ca5dc22be
diff --git a/datafusion/core/src/execution/context.rs b/datafusion/core/src/execution/context.rsindex 7284d3e8ac..d0baa035ed 100644--- a/datafusion/core/src/execution/context.rs+++ b/datafusion/core/src/execution/context.rs@@ -82,7 +82,7 @@ use crate::config::{};use crate::datasource::datasource::TableProviderFactory;use crate::execution::runtime_env::RuntimeEnv;-use crate::logical_plan::plan::Explain;+use crate::logical_expr::Explain;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;diff --git a/datafusion/core/src/logical_plan/mod.rs b/datafusion/core/src/logical_plan/mod.rsindex 038571de30..4aabd5c3ad 100644--- a/datafusion/core/src/logical_plan/mod.rs+++ b/datafusion/core/src/logical_plan/mod.rs@@ -18,7 +18,6 @@//! This is a legacy module that only contains re-exports of other modulesmod expr;-pub mod plan;pub mod window_frames;pub use crate::datasource::{provider_as_source, source_as_provider};diff --git a/datafusion/core/src/logical_plan/plan.rs b/datafusion/core/src/logical_plan/plan.rsdeleted file mode 100644index 2f6078947a..0000000000--- a/datafusion/core/src/logical_plan/plan.rs+++ /dev/null@@ -1,32 +0,0 @@-// Licensed to the Apache Software Foundation (ASF) under one-// or more contributor license agreements. See the NOTICE file-// distributed with this work for additional information-// regarding copyright ownership. The ASF licenses this file-// to you under the Apache License, Version 2.0 (the-// "License"); you may not use this file except in compliance-// with the License. You may obtain a copy of the License at-//-// http://www.apache.org/licenses/LICENSE-2.0-//-// Unless required by applicable law or agreed to in writing,-// software distributed under the License is distributed on an-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY-// KIND, either express or implied. See the License for the-// specific language governing permissions and limitations-// under the License.--//! This is a legacy module that only contains re-exports of other modules--pub use crate::datasource::{provider_as_source, source_as_provider, DefaultTableSource};-pub use datafusion_expr::{- logical_plan::{- display::{GraphvizVisitor, IndentVisitor},- Aggregate, Analyze, CreateCatalog, CreateCatalogSchema, CreateExternalTable,- CreateMemoryTable, CreateView, CrossJoin, Distinct, DropTable, EmptyRelation,- Explain, Extension, Filter, Join, JoinConstraint, JoinType, Limit, LogicalPlan,- Partitioning, PlanType, PlanVisitor, Projection, Repartition, Sort,- StringifiedPlan, Subquery, SubqueryAlias, TableScan, ToStringifiedPlan, Union,- UserDefinedLogicalNode, Values, Window,- },- TableProviderFilterPushDown, TableSource,-};diff --git a/datafusion/core/src/physical_plan/planner.rs b/datafusion/core/src/physical_plan/planner.rsindex f7362e3c71..86d0057763 100644--- a/datafusion/core/src/physical_plan/planner.rs+++ b/datafusion/core/src/physical_plan/planner.rs@@ -27,7 +27,7 @@ use crate::config::{OPT_EXPLAIN_LOGICAL_PLAN_ONLY, OPT_EXPLAIN_PHYSICAL_PLAN_ONLuse crate::datasource::source_as_provider;use crate::execution::context::{ExecutionProps, SessionState};use crate::logical_expr::utils::generate_sort_key;-use crate::logical_plan::plan::{+use crate::logical_expr::{Aggregate, Distinct, EmptyRelation, Filter, Join, Projection, Sort, SubqueryAlias,TableScan, Window,};@@ -1685,7 +1685,7 @@ mod tests {use crate::execution::context::TaskContext;use crate::execution::options::CsvReadOptions;use crate::execution::runtime_env::RuntimeEnv;- use crate::logical_plan::plan::Extension;+ use crate::logical_expr::Extension;use crate::physical_plan::{expressions, DisplayFormatType, Partitioning, PhysicalPlanner, Statistics,};diff --git a/datafusion/core/tests/custom_sources.rs b/datafusion/core/tests/custom_sources.rsindex c8fbc76662..14daf7b6d6 100644--- a/datafusion/core/tests/custom_sources.rs+++ b/datafusion/core/tests/custom_sources.rs@@ -20,9 +20,17 @@ use arrow::compute::kernels::aggregate;use arrow::datatypes::{DataType, Field, Int32Type, Schema, SchemaRef};use arrow::error::Result as ArrowResult;use arrow::record_batch::RecordBatch;+use datafusion::execution::context::{SessionContext, SessionState, TaskContext};use datafusion::from_slice::FromSlice;+use datafusion::logical_expr::{+ col, Expr, LogicalPlan, LogicalPlanBuilder, Projection, TableScan, UNNAMED_TABLE,+};use datafusion::physical_plan::empty::EmptyExec;use datafusion::physical_plan::expressions::PhysicalSortExpr;+use datafusion::physical_plan::{+ project_schema, ColumnStatistics, ExecutionPlan, Partitioning, RecordBatchStream,+ SendableRecordBatchStream, Statistics,+};use datafusion::scalar::ScalarValue;use datafusion::{datasource::{TableProvider, TableType},@@ -30,15 +38,6 @@ use datafusion::{};use datafusion::{error::Result, physical_plan::DisplayFormatType};-use datafusion::execution::context::{SessionContext, SessionState, TaskContext};-use datafusion::logical_plan::{- col, Expr, LogicalPlan, LogicalPlanBuilder, TableScan, UNNAMED_TABLE,-};-use datafusion::physical_plan::{- project_schema, ColumnStatistics, ExecutionPlan, Partitioning, RecordBatchStream,- SendableRecordBatchStream, Statistics,-};-use futures::stream::Stream;use std::any::Any;use std::pin::Pin;@@ -46,7 +45,6 @@ use std::sync::Arc;use std::task::{Context, Poll};use async_trait::async_trait;-use datafusion::logical_plan::plan::Projection;//// Custom source dataframe tests ////diff --git a/datafusion/core/tests/sql/mod.rs b/datafusion/core/tests/sql/mod.rsindex 8ee70cb898..e0167b5c4f 100644--- a/datafusion/core/tests/sql/mod.rs+++ b/datafusion/core/tests/sql/mod.rs@@ -31,9 +31,7 @@ use datafusion::assert_contains;use datafusion::assert_not_contains;use datafusion::datasource::TableProvider;use datafusion::from_slice::FromSlice;-use datafusion::logical_plan::plan::{Aggregate, Projection};-use datafusion::logical_plan::LogicalPlan;-use datafusion::logical_plan::TableScan;+use datafusion::logical_expr::{Aggregate, LogicalPlan, Projection, TableScan};use datafusion::physical_plan::metrics::MetricValue;use datafusion::physical_plan::ExecutionPlan;use datafusion::physical_plan::ExecutionPlanVisitor;diff --git a/datafusion/core/tests/user_defined_plan.rs b/datafusion/core/tests/user_defined_plan.rsindex edd8812668..c93b7c3eb4 100644--- a/datafusion/core/tests/user_defined_plan.rs+++ b/datafusion/core/tests/user_defined_plan.rs@@ -68,11 +68,14 @@ use arrow::{util::pretty::pretty_format_batches,};use datafusion::{+ common::DFSchemaRef,error::{DataFusionError, Result},- execution::context::QueryPlanner,- execution::context::SessionState,- logical_plan::{Expr, LogicalPlan, UserDefinedLogicalNode},- optimizer::{optimizer::OptimizerRule, utils::optimize_children},+ execution::{+ context::{QueryPlanner, SessionState, TaskContext},+ runtime_env::RuntimeEnv,+ },+ logical_expr::{Expr, Extension, Limit, LogicalPlan, Sort, UserDefinedLogicalNode},+ optimizer::{optimize_children, OptimizerConfig, OptimizerRule},physical_plan::{expressions::PhysicalSortExpr,planner::{DefaultPhysicalPlanner, ExtensionPlanner},@@ -81,16 +84,12 @@ use datafusion::{},prelude::{SessionConfig, SessionContext},};+use fmt::Debug;use std::task::{Context, Poll};use std::{any::Any, collections::BTreeMap, fmt, sync::Arc};use async_trait::async_trait;-use datafusion::execution::context::TaskContext;-use datafusion::execution::runtime_env::RuntimeEnv;-use datafusion::logical_plan::plan::{Extension, Sort};-use datafusion::logical_plan::{DFSchemaRef, Limit};-use datafusion::optimizer::optimizer::OptimizerConfig;/// Execute the specified sql and return the resulting record batches/// pretty printed as a String.diff --git a/datafusion/expr/src/lib.rs b/datafusion/expr/src/lib.rsindex 16b1a8f139..56e60f5a28 100644--- a/datafusion/expr/src/lib.rs+++ b/datafusion/expr/src/lib.rs@@ -64,7 +64,15 @@ pub use function::{StateTypeFunction,};pub use literal::{lit, lit_timestamp_nano, Literal, TimestampLiteral};-pub use logical_plan::{LogicalPlan, LogicalPlanBuilder, PlanVisitor};+pub use logical_plan::{+ builder::{build_join_schema, union_with_alias, UNNAMED_TABLE},+ Aggregate, CreateCatalog, CreateCatalogSchema, CreateExternalTable,+ CreateMemoryTable, CreateView, CrossJoin, Distinct, DropTable, DropView,+ EmptyRelation, Explain, Extension, Filter, Join, JoinConstraint, JoinType, Limit,+ LogicalPlan, LogicalPlanBuilder, Partitioning, PlanType, PlanVisitor, Projection,+ Repartition, Sort, StringifiedPlan, Subquery, SubqueryAlias, TableScan,+ ToStringifiedPlan, Union, UserDefinedLogicalNode, Values, Window,+};pub use nullif::SUPPORTED_NULLIF_TYPES;pub use operator::Operator;pub use signature::{Signature, TypeSignature, Volatility};diff --git a/datafusion/optimizer/src/lib.rs b/datafusion/optimizer/src/lib.rsindex 879658c408..23814dcf98 100644--- a/datafusion/optimizer/src/lib.rs+++ b/datafusion/optimizer/src/lib.rs@@ -41,3 +41,4 @@ pub mod test;pub mod unwrap_cast_in_comparison;pub use optimizer::{OptimizerConfig, OptimizerRule};+pub use utils::optimize_children;