Skip to content

Apache DataFusion SQL Query Engine

Fix duplicated SharedBitmapBuilder definitions (#14122)

张林伟74e6922c3ff1
diff --git a/datafusion/physical-plan/src/joins/hash_join.rs b/datafusion/physical-plan/src/joins/hash_join.rs
index 4e0b0bf820..f24ecd4f7b 100644
--- a/datafusion/physical-plan/src/joins/hash_join.rs
+++ b/datafusion/physical-plan/src/joins/hash_join.rs
@@ -27,7 +27,7 @@ use std::{any::Any, vec};
use super::utils::{asymmetric_join_output_partitioning, reorder_output_after_swap};
use super::{
utils::{OnceAsync, OnceFut},
- PartitionMode,
+ PartitionMode, SharedBitmapBuilder,
};
use crate::execution_plan::{boundedness_from_children, EmissionType};
use crate::ExecutionPlanProperties;
@@ -78,8 +78,6 @@ use datafusion_physical_expr_common::datum::compare_op_for_nested;
use futures::{ready, Stream, StreamExt, TryStreamExt};
use parking_lot::Mutex;
-type SharedBitmapBuilder = Mutex<BooleanBufferBuilder>;
-
/// HashTable and input data for the left (build side) of a join
struct JoinLeftData {
/// The hash table with indices into `batch`
@@ -87,7 +85,7 @@ struct JoinLeftData {
/// The input rows for the build side
batch: RecordBatch,
/// Shared bitmap builder for visited left indices
- visited_indices_bitmap: Mutex<BooleanBufferBuilder>,
+ visited_indices_bitmap: SharedBitmapBuilder,
/// Counter of running probe-threads, potentially
/// able to update `visited_indices_bitmap`
probe_threads_counter: AtomicUsize,
diff --git a/datafusion/physical-plan/src/joins/mod.rs b/datafusion/physical-plan/src/joins/mod.rs
index fa077d2008..bfdeb2fd6e 100644
--- a/datafusion/physical-plan/src/joins/mod.rs
+++ b/datafusion/physical-plan/src/joins/mod.rs
@@ -17,9 +17,11 @@
//! DataFusion Join implementations
+use arrow_buffer::BooleanBufferBuilder;
pub use cross_join::CrossJoinExec;
pub use hash_join::HashJoinExec;
pub use nested_loop_join::NestedLoopJoinExec;
+use parking_lot::Mutex;
// Note: SortMergeJoin is not used in plans yet
pub use sort_merge_join::SortMergeJoinExec;
pub use symmetric_hash_join::SymmetricHashJoinExec;
@@ -56,3 +58,6 @@ pub enum StreamJoinPartitionMode {
/// Both sides will collected into one partition
SinglePartition,
}
+
+/// Shared bitmap for visited left-side indices
+type SharedBitmapBuilder = Mutex<BooleanBufferBuilder>;
diff --git a/datafusion/physical-plan/src/joins/nested_loop_join.rs b/datafusion/physical-plan/src/joins/nested_loop_join.rs
index c69fa28888..8872ab130b 100644
--- a/datafusion/physical-plan/src/joins/nested_loop_join.rs
+++ b/datafusion/physical-plan/src/joins/nested_loop_join.rs
@@ -55,11 +55,10 @@ use datafusion_execution::TaskContext;
use datafusion_expr::JoinType;
use datafusion_physical_expr::equivalence::join_equivalence_properties;
+use crate::joins::SharedBitmapBuilder;
use futures::{ready, Stream, StreamExt, TryStreamExt};
use parking_lot::Mutex;
-/// Shared bitmap for visited left-side indices
-type SharedBitmapBuilder = Mutex<BooleanBufferBuilder>;
/// Left (build-side) data
struct JoinLeftData {
/// Build-side data collected to single batch