LeslieKid commented on code in PR #13226:
URL: https://github.com/apache/datafusion/pull/13226#discussion_r1828346966


##########
datafusion/functions-aggregate/src/min_max/min_max_bytes.rs:
##########
@@ -338,6 +338,10 @@ impl GroupsAccumulator for MinMaxBytesAccumulator {
 /// This is a heuristic to avoid allocating too many small buffers
 fn capacity_to_view_block_size(data_capacity: usize) -> u32 {
     let max_block_size = 2 * 1024 * 1024;
+    // Avoid block size equal to zero when calling `with_fixed_block_size()`.
+    if data_capacity == 0 {
+        return 1;

Review Comment:
   The `data_capacity` might be zero and results in aggregation fuzz tests 
panicked with message "Block size must be greater than 0".
   
   So I modify this function to ensure that the block size would not be 0 in 
this case. But I'm not totally sure if this is a bug...



-- 
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