neilconway commented on code in PR #21854:
URL: https://github.com/apache/datafusion/pull/21854#discussion_r3158047802


##########
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:
   It is a very widespread assumption that all of the Array args to a UDF will 
be the same length; if that wasn't the case, a _lot_ of things would break in 
all sorts of unsightly ways. If we think there's a reason to program 
defensively around that assumption, we'd need to change a _lot_ of places to 
validate that condition consistently; doing it in just one place seems hard to 
justify IMO.



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