viirya commented on code in PR #2477:
URL: https://github.com/apache/arrow-rs/pull/2477#discussion_r949243777
##########
arrow/src/array/array_decimal.rs:
##########
@@ -401,15 +402,15 @@ impl Decimal256Array {
}
}
-impl<const BYTE_WIDTH: usize> From<ArrayData> for
BasicDecimalArray<BYTE_WIDTH> {
+impl<T: DecimalType> From<ArrayData> for DecimalArray<T> {
fn from(data: ArrayData) -> Self {
assert_eq!(
data.buffers().len(),
1,
"DecimalArray data should contain 1 buffer only (values)"
);
let values = data.buffers()[0].as_ptr();
- let (precision, scale) = match (data.data_type(), BYTE_WIDTH) {
+ let (precision, scale) = match (data.data_type(), T::BYTE_LENGTH) {
Review Comment:
nit:
```suggestion
let (precision, scale) = match (data.data_type(),
Self::VALUE_LENGTH) {
```
--
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]