You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by ag...@apache.org on 2022/10/07 21:12:23 UTC
[arrow-datafusion] branch master updated: Remove depreceted module datafusion::logical_plan::plan (#3759)
This is an automated email from the ASF dual-hosted git repository.
agrove pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow-datafusion.git
The following commit(s) were added to refs/heads/master by this push:
new 567ca5dc2 Remove depreceted module datafusion::logical_plan::plan (#3759)
567ca5dc2 is described below
commit 567ca5dc22be52484bdfbb132c6eae67fa1f5330
Author: Andy Grove <an...@gmail.com>
AuthorDate: Fri Oct 7 15:12:16 2022 -0600
Remove depreceted module datafusion::logical_plan::plan (#3759)
---
datafusion/core/src/execution/context.rs | 2 +-
datafusion/core/src/logical_plan/mod.rs | 1 -
datafusion/core/src/logical_plan/plan.rs | 32 ----------------------------
datafusion/core/src/physical_plan/planner.rs | 4 ++--
datafusion/core/tests/custom_sources.rs | 18 +++++++---------
datafusion/core/tests/sql/mod.rs | 4 +---
datafusion/core/tests/user_defined_plan.rs | 17 +++++++--------
datafusion/expr/src/lib.rs | 10 ++++++++-
datafusion/optimizer/src/lib.rs | 1 +
9 files changed, 30 insertions(+), 59 deletions(-)
diff --git a/datafusion/core/src/execution/context.rs b/datafusion/core/src/execution/context.rs
index 7284d3e8a..d0baa035e 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.rs
index 038571de3..4aabd5c3a 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 modules
mod 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.rs
deleted file mode 100644
index 2f6078947..000000000
--- 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.rs
index f7362e3c7..86d005776 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_ONL
use 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.rs
index c8fbc7666..14daf7b6d 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.rs
index 8ee70cb89..e0167b5c4 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.rs
index edd881266..c93b7c3eb 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.rs
index 16b1a8f13..56e60f5a2 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.rs
index 879658c40..23814dcf9 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;