andygrove commented on code in PR #1034:
URL: https://github.com/apache/datafusion-comet/pull/1034#discussion_r1828478322


##########
native/core/src/execution/shuffle/row.rs:
##########
@@ -235,6 +250,143 @@ impl SparkUnsafeRow {
         }
     }
 
+    #[allow(clippy::needless_range_loop)]
+    pub fn get_rows_from_arrays(
+        schema: Vec<ArrowDataType>,
+        arrays: Vec<ArrayRef>,
+        num_rows: usize,
+        num_cols: usize,
+        addr: usize,
+    ) {
+        let mut row_start_addr: usize = addr;
+        for i in 0..num_rows {
+            let mut row = SparkUnsafeRow::new(&schema);

Review Comment:
   This can be created once before the loop - we do not need to create once 
instance per row since this points to a memory address that gets updated each 
time we call `row.point_to_slice`



##########
native/core/src/execution/shuffle/row.rs:
##########
@@ -235,6 +250,143 @@ impl SparkUnsafeRow {
         }
     }
 
+    #[allow(clippy::needless_range_loop)]
+    pub fn get_rows_from_arrays(
+        schema: Vec<ArrowDataType>,
+        arrays: Vec<ArrayRef>,
+        num_rows: usize,
+        num_cols: usize,
+        addr: usize,
+    ) {
+        let mut row_start_addr: usize = addr;
+        for i in 0..num_rows {
+            let mut row = SparkUnsafeRow::new(&schema);

Review Comment:
   `SparkUnsafeRow` can be created once before the loop - we do not need to 
create once instance per row since this points to a memory address that gets 
updated each time we call `row.point_to_slice`



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org
For additional commands, e-mail: github-h...@datafusion.apache.org

Reply via email to