alamb commented on code in PR #8004:
URL: https://github.com/apache/arrow-datafusion/pull/8004#discussion_r1377745041


##########
datafusion/physical-plan/src/aggregates/row_hash.rs:
##########
@@ -673,7 +673,18 @@ impl GroupedHashAggregateStream {
         let spillfile = 
self.runtime.disk_manager.create_tmp_file("HashAggSpill")?;
         let mut writer = IPCWriter::new(spillfile.path(), &emit.schema())?;
         // TODO: slice large `sorted` and write to multiple files in parallel
-        writer.write(&sorted)?;
+        let mut offset = 0;
+        let total_rows = sorted.num_rows();
+
+        while offset < total_rows {
+            // TODO: we could consider smaller batch size as there may be 
hundreds of batches

Review Comment:
   I think I was confused that this says "TODO smaller batch size" as the PR 
already makes the batch size smaller (caps it at the configured batch size). 
Given the rest of the engine processes things in the same sized batches, I 
don't see any reason to use a different batch size for the spill files 🤔 



##########
datafusion/physical-plan/src/aggregates/row_hash.rs:
##########
@@ -673,7 +673,18 @@ impl GroupedHashAggregateStream {
         let spillfile = 
self.runtime.disk_manager.create_tmp_file("HashAggSpill")?;
         let mut writer = IPCWriter::new(spillfile.path(), &emit.schema())?;
         // TODO: slice large `sorted` and write to multiple files in parallel
-        writer.write(&sorted)?;
+        let mut offset = 0;
+        let total_rows = sorted.num_rows();
+
+        while offset < total_rows {
+            // TODO: we could consider smaller batch size as there may be 
hundreds of batches

Review Comment:
   I think I was confused that this says "TODO smaller batch size" as the PR 
already makes the batch size smaller (caps it at the configured batch size). 
Given the rest of the engine processes things in the same sized batches, I 
don't see any reason to use a different batch size for the spill files 🤔 



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to