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


##########
arrow/src/util/decimal.rs:
##########
@@ -18,50 +18,26 @@
 //! Decimal related utils
 
 use crate::datatypes::{
-    DataType, DECIMAL128_MAX_PRECISION, DECIMAL128_MAX_SCALE, 
DECIMAL256_MAX_PRECISION,
-    DECIMAL256_MAX_SCALE, DECIMAL_DEFAULT_SCALE,
+    DataType, Decimal128Type, Decimal256Type, DecimalType, 
DECIMAL256_MAX_PRECISION,
+    DECIMAL_DEFAULT_SCALE,
 };
 use crate::error::{ArrowError, Result};
 use num::bigint::BigInt;
 use num::Signed;
 use std::cmp::{min, Ordering};
 
 #[derive(Debug)]
-pub struct BasicDecimal<const BYTE_WIDTH: usize> {
+pub struct Decimal<T: DecimalType> {
     precision: usize,
     scale: usize,
-    value: [u8; BYTE_WIDTH],
+    value: T::Native,
 }
 
-impl<const BYTE_WIDTH: usize> BasicDecimal<BYTE_WIDTH> {
-    #[allow(clippy::type_complexity)]
-    const MAX_PRECISION_SCALE_CONSTRUCTOR_DEFAULT_TYPE: (

Review Comment:
   Agreed, this is part of what makes me feel that perhaps using const generics 
in this way doesn't provide the best UX



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