Skip to content

Apache DataFusion SQL Query Engine

Minor: Remove memory reservation in `JoinLeftData` used in HashJoin (#13751)

Jay Zhanc030bfe1e197
diff --git a/datafusion/physical-plan/src/joins/hash_join.rs b/datafusion/physical-plan/src/joins/hash_join.rs
index f7bf039ee7..9fcb39e65d 100644
--- a/datafusion/physical-plan/src/joins/hash_join.rs
+++ b/datafusion/physical-plan/src/joins/hash_join.rs
@@ -90,9 +90,6 @@ struct JoinLeftData {
/// Counter of running probe-threads, potentially
/// able to update `visited_indices_bitmap`
probe_threads_counter: AtomicUsize,
- /// Memory reservation that tracks memory used by `hash_map` hash table
- /// `batch`. Cleared on drop.
- _reservation: MemoryReservation,
}
impl JoinLeftData {
@@ -102,14 +99,12 @@ impl JoinLeftData {
batch: RecordBatch,
visited_indices_bitmap: SharedBitmapBuilder,
probe_threads_counter: AtomicUsize,
- reservation: MemoryReservation,
) -> Self {
Self {
hash_map,
batch,
visited_indices_bitmap,
probe_threads_counter,
- _reservation: reservation,
}
}
@@ -902,7 +897,6 @@ async fn collect_left_input(
single_batch,
Mutex::new(visited_indices_bitmap),
AtomicUsize::new(probe_threads_count),
- reservation,
);
Ok(data)
@@ -1019,6 +1013,7 @@ impl BuildSide {
/// └─ ProcessProbeBatch
///
/// ```
+#[derive(Debug, Clone)]
enum HashJoinStreamState {
/// Initial state for HashJoinStream indicating that build-side data not collected yet
WaitBuildSide,
@@ -1044,6 +1039,7 @@ impl HashJoinStreamState {
}
/// Container for HashJoinStreamState::ProcessProbeBatch related data
+#[derive(Debug, Clone)]
struct ProcessProbeBatchState {
/// Current probe-side batch
batch: RecordBatch,