Skip to content

Commit 15a76c0

Browse files
committed
wip
Signed-off-by: Joe Isaacs <[email protected]>
1 parent 7b0cec7 commit 15a76c0

File tree

3 files changed

+6
-8
lines changed

3 files changed

+6
-8
lines changed

vortex-array/src/arrays/decimal/array.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,12 @@ use itertools::Itertools;
55
use vortex_buffer::{BitBufferMut, Buffer, BufferMut, ByteBuffer};
66
use vortex_dtype::{
77
BigCast, DType, DecimalDType, DecimalType, IntegerPType, NativeDecimalType,
8-
match_each_integer_ptype,
8+
is_compatible_decimal_value_type, match_each_integer_ptype,
99
};
1010
use vortex_error::{VortexExpect, VortexResult, vortex_ensure, vortex_panic};
1111
use vortex_scalar::match_each_decimal_value_type;
1212

1313
use crate::ToCanonical;
14-
use crate::arrays::is_compatible_decimal_value_type;
1514
use crate::patches::Patches;
1615
use crate::stats::ArrayStats;
1716
use crate::validity::Validity;

vortex-array/src/arrays/decimal/utils.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,12 @@
22
// SPDX-FileCopyrightText: Copyright the Vortex contributors
33

44
use itertools::{Itertools, MinMaxResult};
5-
use vortex_dtype::{DecimalDType, smallest_decimal_value_type};
65
use vortex_error::VortexExpect;
76
use vortex_scalar::{DecimalType, i256};
87

98
use crate::arrays::DecimalArray;
109
use crate::vtable::ValidityHelper;
1110

12-
/// True if `value_type` can represent every value of the type `dtype`.
13-
pub fn is_compatible_decimal_value_type(value_type: DecimalType, dtype: DecimalDType) -> bool {
14-
value_type >= smallest_decimal_value_type(&dtype)
15-
}
16-
1711
macro_rules! try_downcast {
1812
($array:expr, from: $src:ty, to: $($dst:ty),*) => {{
1913
use vortex_dtype::BigCast;

vortex-dtype/src/decimal/smallest_type.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,8 @@ pub fn smallest_decimal_value_type(decimal_dtype: &DecimalDType) -> DecimalType
1616
p => unreachable!("precision larger than 76 is invalid found precision {p}"),
1717
}
1818
}
19+
20+
/// True if `value_type` can represent every value of the type `dtype`.
21+
pub fn is_compatible_decimal_value_type(value_type: DecimalType, dtype: DecimalDType) -> bool {
22+
value_type >= smallest_decimal_value_type(&dtype)
23+
}

0 commit comments

Comments
 (0)