You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/08/20 14:29:50 UTC

[GitHub] [arrow-rs] tustvold commented on a diff in pull request #2517: Refactoring DecimalBuilder constructors

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


##########
arrow/src/array/builder/decimal_builder.rs:
##########
@@ -61,9 +61,14 @@ pub struct Decimal256Builder {
 
 impl Decimal128Builder {
     const BYTE_LENGTH: i32 = 16;
+    /// Creates a new [`Decimal128Builder`]
+    pub fn new(precision: usize, scale: usize) -> Self {
+        Self::with_capacity(1024, precision, scale)
+    }
+
     /// Creates a new [`Decimal128Builder`], `capacity` is the number of bytes in the values
     /// array

Review Comment:
   This needs to change the definition of `capacity` to be the number of decimal elements, instead of the number of decimal bytes



-- 
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-unsubscribe@arrow.apache.org

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