This is an automated email from the ASF dual-hosted git repository.

berkay pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/datafusion.git


The following commit(s) were added to refs/heads/main by this push:
     new c030bfe1e1 Minor: Remove memory reservation in `JoinLeftData` used in 
HashJoin (#13751)
c030bfe1e1 is described below

commit c030bfe1e197fdbb385511a2e4fedf753f284d6f
Author: Jay Zhan <[email protected]>
AuthorDate: Fri Dec 13 18:43:13 2024 +0800

    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.
---
 datafusion/physical-plan/src/joins/hash_join.rs | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

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,


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to