Skip to content

Commit c030bfe

Browse files
Minor: Remove memory reservation in JoinLeftData used in HashJoin (#13751)
* Refactor JoinLeftData structure by removing unused memory reservation field in hash join implementation * Add Debug and Clone derives for HashJoinStreamState and ProcessProbeBatchState enums This commit enhances the HashJoinStreamState and ProcessProbeBatchState structures by implementing the Debug and Clone traits, allowing for easier debugging and cloning of these state representations in the hash join implementation.
1 parent 6ac1999 commit c030bfe

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

datafusion/physical-plan/src/joins/hash_join.rs

+2-6
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,6 @@ struct JoinLeftData {
9090
/// Counter of running probe-threads, potentially
9191
/// able to update `visited_indices_bitmap`
9292
probe_threads_counter: AtomicUsize,
93-
/// Memory reservation that tracks memory used by `hash_map` hash table
94-
/// `batch`. Cleared on drop.
95-
_reservation: MemoryReservation,
9693
}
9794

9895
impl JoinLeftData {
@@ -102,14 +99,12 @@ impl JoinLeftData {
10299
batch: RecordBatch,
103100
visited_indices_bitmap: SharedBitmapBuilder,
104101
probe_threads_counter: AtomicUsize,
105-
reservation: MemoryReservation,
106102
) -> Self {
107103
Self {
108104
hash_map,
109105
batch,
110106
visited_indices_bitmap,
111107
probe_threads_counter,
112-
_reservation: reservation,
113108
}
114109
}
115110

@@ -902,7 +897,6 @@ async fn collect_left_input(
902897
single_batch,
903898
Mutex::new(visited_indices_bitmap),
904899
AtomicUsize::new(probe_threads_count),
905-
reservation,
906900
);
907901

908902
Ok(data)
@@ -1019,6 +1013,7 @@ impl BuildSide {
10191013
/// └─ ProcessProbeBatch
10201014
///
10211015
/// ```
1016+
#[derive(Debug, Clone)]
10221017
enum HashJoinStreamState {
10231018
/// Initial state for HashJoinStream indicating that build-side data not collected yet
10241019
WaitBuildSide,
@@ -1044,6 +1039,7 @@ impl HashJoinStreamState {
10441039
}
10451040

10461041
/// Container for HashJoinStreamState::ProcessProbeBatch related data
1042+
#[derive(Debug, Clone)]
10471043
struct ProcessProbeBatchState {
10481044
/// Current probe-side batch
10491045
batch: RecordBatch,

0 commit comments

Comments
 (0)