martin-g commented on code in PR #21854:
URL: https://github.com/apache/datafusion/pull/21854#discussion_r3157008581


##########
datafusion/functions/src/string/repeat.rs:
##########
@@ -301,12 +285,18 @@ where
         }
     }
 
-    // Fast path: no nulls in either array
-    if string_array.null_count() == 0 && number_array.null_count() == 0 {
+    // Output is null IFF either input is null
+    let nulls = NullBuffer::union(string_array.nulls(), number_array.nulls());

Review Comment:
   `NullBuffer::union()` could panic if the buffers have different lengths - 
https://docs.rs/arrow-buffer/58.1.0/src/arrow_buffer/buffer/boolean.rs.html#642
   
   Since the method returns Result I wonder whether it would be better to check 
manually the lengths and return a plan_err! ?!



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


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

Reply via email to