viirya commented on code in PR #2247:
URL: https://github.com/apache/arrow-rs/pull/2247#discussion_r934705168


##########
arrow/src/array/array_decimal.rs:
##########
@@ -384,6 +391,59 @@ impl<'a> Decimal128Array {
     }
 }
 
+impl From<BigInt> for Decimal256 {
+    fn from(bigint: BigInt) -> Self {
+        Decimal256::from_big_int(&bigint, DECIMAL256_MAX_PRECISION, 
DECIMAL_DEFAULT_SCALE)
+            .unwrap()
+    }
+}
+
+fn build_decimal_array_from<U: BasicDecimalArray<T, U>, T>(
+    null_buf: BooleanBufferBuilder,
+    buffer: Buffer,
+) -> U
+where
+    T: BasicDecimal,
+    U: From<ArrayData>,
+{
+    let data = unsafe {
+        ArrayData::new_unchecked(
+            U::default_type(),

Review Comment:
   FromIterator for Decimal128Array doesn't validate with precision/scale. It 
uses default precision and scale.



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