pepijnve commented on code in PR #10161:
URL: https://github.com/apache/arrow-rs/pull/10161#discussion_r3450878358


##########
arrow-string/src/concat_elements.rs:
##########
@@ -221,6 +221,170 @@ pub fn concat_elements_fixed_size_binary(
     Ok(result.finish())
 }
 
+struct ConcatByteViewBuilder<T>
+where
+    T: ByteViewType,
+{
+    views: Vec<u128>,
+    data: Vec<u8>,
+    inline: Vec<u8>,
+    phantom: PhantomData<T>,
+}
+
+impl<T> ConcatByteViewBuilder<T>
+where
+    T: ByteViewType,
+{
+    /// Returns the elementwise concatenation of two [`GenericByteViewArray`]s.
+    fn concat_elements_view_array(
+        left: &GenericByteViewArray<T>,
+        right: &GenericByteViewArray<T>,
+    ) -> Result<GenericByteViewArray<T>, ArrowError> {
+        let len = left.len();
+        if len != right.len() {
+            return Err(ArrowError::ComputeError(format!(
+                "Arrays must have the same length: {} != {}",
+                len,
+                right.len()
+            )));
+        }
+
+        let mut null_buffer = NullBuffer::union(left.nulls(), right.nulls());
+        if let Some(n) = &null_buffer {
+            if n.null_count() == 0 {
+                null_buffer = None
+            }
+        }

Review Comment:
   I've gone ahead and made that change. `null_count() > 0` check added in 
`union` and `union_many`.



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