Apache DataFusion SQL Query Engine
rm duplicated type (#15590)
Jay Zhan30921be9c06b
diff --git a/datafusion/physical-plan/src/joins/hash_join.rs b/datafusion/physical-plan/src/joins/hash_join.rsindex c2a313edd1..8a49a236fe 100644--- a/datafusion/physical-plan/src/joins/hash_join.rs+++ b/datafusion/physical-plan/src/joins/hash_join.rs@@ -32,6 +32,7 @@ use super::{utils::{OnceAsync, OnceFut},PartitionMode, SharedBitmapBuilder,};+use super::{JoinOn, JoinOnRef};use crate::execution_plan::{boundedness_from_children, EmissionType};use crate::projection::{try_embed_projection, try_pushdown_through_join, EmbeddedProjection, JoinData,@@ -50,8 +51,7 @@ use crate::{build_batch_from_indices, build_join_schema, check_join_is_valid,estimate_join_statistics, need_produce_result_in_final,symmetric_join_output_partitioning, BuildProbeJoinMetrics, ColumnIndex,- JoinFilter, JoinHashMap, JoinHashMapType, JoinOn, JoinOnRef,- StatefulStreamResult,+ JoinFilter, JoinHashMap, JoinHashMapType, StatefulStreamResult,},metrics::{ExecutionPlanMetricsSet, MetricsSet},DisplayAs, DisplayFormatType, Distribution, ExecutionPlan, Partitioning,diff --git a/datafusion/physical-plan/src/joins/mod.rs b/datafusion/physical-plan/src/joins/mod.rsindex 22a8c0bc79..1d36db9964 100644--- a/datafusion/physical-plan/src/joins/mod.rs+++ b/datafusion/physical-plan/src/joins/mod.rs@@ -19,6 +19,7 @@use arrow::array::BooleanBufferBuilder;pub use cross_join::CrossJoinExec;+use datafusion_physical_expr::PhysicalExprRef;pub use hash_join::HashJoinExec;pub use nested_loop_join::NestedLoopJoinExec;use parking_lot::Mutex;@@ -39,6 +40,11 @@ mod join_hash_map;#[cfg(test)]pub mod test_utils;+/// The on clause of the join, as vector of (left, right) columns.+pub type JoinOn = Vec<(PhysicalExprRef, PhysicalExprRef)>;+/// Reference for JoinOn.+pub type JoinOnRef<'a> = &'a [(PhysicalExprRef, PhysicalExprRef)];+#[derive(Clone, Copy, Debug, PartialEq, Eq)]/// Hash join Partitioning modepub enum PartitionMode {diff --git a/datafusion/physical-plan/src/joins/utils.rs b/datafusion/physical-plan/src/joins/utils.rsindex f6c720dbb7..efb9f80dd2 100644--- a/datafusion/physical-plan/src/joins/utils.rs+++ b/datafusion/physical-plan/src/joins/utils.rs@@ -32,6 +32,7 @@ use crate::{// compatibilitypub use super::join_filter::JoinFilter;pub use super::join_hash_map::{JoinHashMap, JoinHashMapType};+pub use crate::joins::{JoinOn, JoinOnRef};use arrow::array::{builder::UInt64Builder, downcast_array, new_null_array, Array, ArrowPrimitiveType,@@ -62,11 +63,6 @@ use futures::future::{BoxFuture, Shared};use futures::{ready, FutureExt};use parking_lot::Mutex;-/// The on clause of the join, as vector of (left, right) columns.-pub type JoinOn = Vec<(PhysicalExprRef, PhysicalExprRef)>;-/// Reference for JoinOn.-pub type JoinOnRef<'a> = &'a [(PhysicalExprRef, PhysicalExprRef)];-/// Checks whether the schemas "left" and "right" and columns "on" represent a valid join./// They are valid whenever their columns' intersection equals the set `on`pub fn check_join_is_valid(left: &Schema, right: &Schema, on: JoinOnRef) -> Result<()> {diff --git a/datafusion/physical-plan/src/projection.rs b/datafusion/physical-plan/src/projection.rsindex 1d3e23ea90..72934c7444 100644--- a/datafusion/physical-plan/src/projection.rs+++ b/datafusion/physical-plan/src/projection.rs@@ -33,7 +33,7 @@ use super::{SendableRecordBatchStream, Statistics,};use crate::execution_plan::CardinalityEffect;-use crate::joins::utils::{ColumnIndex, JoinFilter};+use crate::joins::utils::{ColumnIndex, JoinFilter, JoinOn, JoinOnRef};use crate::{ColumnStatistics, DisplayFormatType, ExecutionPlan, PhysicalExpr};use arrow::datatypes::{Field, Schema, SchemaRef};@@ -446,11 +446,6 @@ pub fn try_embed_projection<Exec: EmbeddedProjection + 'static>(}}-/// The on clause of the join, as vector of (left, right) columns.-pub type JoinOn = Vec<(PhysicalExprRef, PhysicalExprRef)>;-/// Reference for JoinOn.-pub type JoinOnRef<'a> = &'a [(PhysicalExprRef, PhysicalExprRef)];-pub struct JoinData {pub projected_left_child: ProjectionExec,pub projected_right_child: ProjectionExec,