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

comphead 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 9b19d36dbc Minor: Use `resize` instead of `extend` for adding static 
values in SortMergeJoin logic (#13861)
9b19d36dbc is described below

commit 9b19d36dbc15d4e35b8ce109e2e186f92e499ffc
Author: Oleks V <[email protected]>
AuthorDate: Fri Dec 20 12:53:23 2024 -0800

    Minor: Use `resize` instead of `extend` for adding static values in 
SortMergeJoin logic (#13861)
    
    Thanks @Dandandan
---
 datafusion/physical-plan/src/joins/sort_merge_join.rs | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/datafusion/physical-plan/src/joins/sort_merge_join.rs 
b/datafusion/physical-plan/src/joins/sort_merge_join.rs
index f17b99d81d..b8cb7b313b 100644
--- a/datafusion/physical-plan/src/joins/sort_merge_join.rs
+++ b/datafusion/physical-plan/src/joins/sort_merge_join.rs
@@ -1578,7 +1578,7 @@ impl SortMergeJoinStream {
                     .append_nulls(num_rows);
                 self.output_record_batches
                     .batch_ids
-                    .extend(vec![0; num_rows]);
+                    .resize(self.output_record_batches.batch_ids.len() + 
num_rows, 0);
 
                 self.output_record_batches.batches.push(record_batch);
             }
@@ -1622,7 +1622,7 @@ impl SortMergeJoinStream {
                 .append_nulls(num_rows);
             self.output_record_batches
                 .batch_ids
-                .extend(vec![0; num_rows]);
+                .resize(self.output_record_batches.batch_ids.len() + num_rows, 
0);
             self.output_record_batches.batches.push(record_batch);
         }
         buffered_batch.join_filter_not_matched_map.clear();
@@ -1757,10 +1757,10 @@ impl SortMergeJoinStream {
                         
self.output_record_batches.filter_mask.extend(pre_mask);
                     }
                     
self.output_record_batches.row_indices.extend(&left_indices);
-                    self.output_record_batches.batch_ids.extend(vec![
-                        self.streamed_batch_counter.load(Relaxed);
-                        left_indices.len()
-                        ]);
+                    self.output_record_batches.batch_ids.resize(
+                        self.output_record_batches.batch_ids.len() + 
left_indices.len(),
+                        self.streamed_batch_counter.load(Relaxed),
+                    );
 
                     // For outer joins, we need to push the null joined rows 
to the output if
                     // all joined rows are failed on the join filter.


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

Reply via email to