vortex_compute/take/vector/
decimal.rs1use vortex_dtype::UnsignedPType;
5use vortex_vector::VectorOps;
6use vortex_vector::decimal::DecimalVector;
7use vortex_vector::match_each_dvector;
8use vortex_vector::primitive::PVector;
9
10use crate::take::Take;
11
12impl<I: UnsignedPType> Take<PVector<I>> for &DecimalVector {
13 type Output = DecimalVector;
14
15 fn take(self, indices: &PVector<I>) -> DecimalVector {
16 if indices.validity().all_true() {
18 return self.take(indices.elements().as_slice());
19 }
20
21 match_each_dvector!(self, |v| { v.take(indices).into() })
22 }
23}
24
25impl<I: UnsignedPType> Take<[I]> for &DecimalVector {
26 type Output = DecimalVector;
27
28 fn take(self, indices: &[I]) -> DecimalVector {
29 match_each_dvector!(self, |v| { v.take(indices).into() })
30 }
31}