nevi-me commented on a change in pull request #820:
URL: https://github.com/apache/arrow-rs/pull/820#discussion_r726393410



##########
File path: parquet/src/arrow/arrow_writer.rs
##########
@@ -461,15 +461,25 @@ fn write_leaf(
 macro_rules! def_get_binary_array_fn {
     ($name:ident, $ty:ty) => {
         fn $name(array: &$ty) -> Vec<ByteArray> {
-            let mut values = Vec::with_capacity(array.len() - 
array.null_count());
-            for i in 0..array.len() {
-                if array.is_valid(i) {
-                    let bytes: Vec<u8> = array.value(i).into();
-                    let bytes = ByteArray::from(bytes);
-                    values.push(bytes);
-                }
-            }
-            values
+            let mut byte_array = ByteArray::new();

Review comment:
       I think there's a way of making them work together, if we change 
`ByteArray`to be backed by an `Arc<Bytes>`. Given that the Parquet crate was 
written before Arrow, such harmonisation didn't exist then, but nothing stops 
us from making it happen.




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