Skip to main content

vortex_array/arrays/decimal/
mod.rs

1// SPDX-License-Identifier: Apache-2.0
2// SPDX-FileCopyrightText: Copyright the Vortex contributors
3
4mod array;
5pub use array::DecimalArrayExt;
6pub use array::DecimalData;
7pub use array::DecimalDataParts;
8pub use vtable::DecimalArray;
9
10pub(crate) mod compute;
11
12mod vtable;
13pub use compute::rules::DecimalMaskedValidityRule;
14pub use vtable::Decimal;
15
16pub(crate) fn initialize(session: &vortex_session::VortexSession) {
17    vtable::initialize(session);
18}
19
20mod utils;
21pub use utils::*;
22
23#[cfg(test)]
24mod tests {
25    use arrow_array::Decimal128Array;
26
27    #[test]
28    fn test_decimal() {
29        // They pass it b/c the DType carries the information. No other way to carry a
30        // dtype except via the array.
31        let value = Decimal128Array::new_null(100);
32        let numeric = value.value(10);
33        assert_eq!(numeric, 0i128);
34    }
35}