ovr commented on a change in pull request #9114:
URL: https://github.com/apache/arrow/pull/9114#discussion_r560497147



##########
File path: rust/arrow/src/array/array_list.rs
##########
@@ -295,6 +299,264 @@ impl fmt::Debug for FixedSizeListArray {
     }
 }
 
+macro_rules! build_empty_list_array_with_primitive_items {
+    ($item_type:ident, $offset_type:ident) => {{
+        let values_builder = PrimitiveBuilder::<$item_type>::new(0);
+        let mut builder =
+            GenericListBuilder::<$offset_type, 
PrimitiveBuilder<$item_type>>::new(
+                values_builder,
+            );
+        let empty_list_array = builder.finish();
+        Ok(Arc::new(empty_list_array))
+    }};
+}
+
+macro_rules! build_empty_list_array_with_non_primitive_items {
+    ($type_builder:ident, $offset_type:ident) => {{
+        let values_builder = $type_builder::new(0);
+        let mut builder =
+            GenericListBuilder::<$offset_type, 
$type_builder>::new(values_builder);

Review comment:
       Arrow API is a Complex, I still dont know how to do it pretty simple as 
you suggested with Buffer. I think it's not a big performance impact to use 
builder in this place.




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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to