tustvold commented on code in PR #2038:
URL: https://github.com/apache/arrow-rs/pull/2038#discussion_r918988947


##########
arrow/src/array/builder/decimal_builder.rs:
##########
@@ -149,20 +167,39 @@ impl ArrayBuilder for DecimalBuilder {
     fn into_box_any(self: Box<Self>) -> Box<dyn Any> {
         self
     }
+}
 
-    /// Returns the number of array slots in the builder
-    fn len(&self) -> usize {
-        self.builder.len()
-    }
-
-    /// Returns whether the number of array slots is zero
-    fn is_empty(&self) -> bool {
-        self.builder.is_empty()
-    }
+impl<Ptr: Borrow<Option<i128>>> FromIterator<Ptr> for DecimalBuilder {
+    fn from_iter<I: IntoIterator<Item = Ptr>>(iter: I) -> Self {
+        let iter = iter.into_iter();
+        let (lower, upper) = iter.size_hint();
+        let size_hint = upper.unwrap_or(lower);
+        let fixed_len = 16_usize;
+
+        let mut builder = FixedSizeListBuilder::with_capacity(
+            UInt8Builder::new(size_hint),

Review Comment:
   I think this should be size_hint * fixed_len although I do think the UX of 
this isn't great. I'll file a ticket for this



-- 
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: github-unsubscr...@arrow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to