liukun4515 commented on code in PR #2247:
URL: https://github.com/apache/arrow-rs/pull/2247#discussion_r934284452
##########
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:
Do we need to add the validation with precision/scale to change the default
precision/scale for the Decimal256Array like Decimal128Array?
--
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]