arrow_rayon/parallel_array/
parallel_duration_array.rs1use arrow_array::types::{
2 DurationMicrosecondType, DurationMillisecondType, DurationNanosecondType, DurationSecondType,
3};
4use arrow_array::{
5 DurationMicrosecondArray, DurationMillisecondArray, DurationNanosecondArray,
6 DurationSecondArray,
7};
8use rayon::iter::ParallelIterator;
9
10use crate::parallel_primitive_array::{ParallelPrimitiveArray, ParallelPrimitiveArrayRef};
11
12pub type ParallelDurationSecondArray = ParallelPrimitiveArray<DurationSecondType>;
13pub type ParallelDurationSecondArrayRef<'data> =
14 ParallelPrimitiveArrayRef<'data, DurationSecondType>;
15pub type ParallelDurationMillisecondArray = ParallelPrimitiveArray<DurationMillisecondType>;
16pub type ParallelDurationMillisecondArrayRef<'data> =
17 ParallelPrimitiveArrayRef<'data, DurationMillisecondType>;
18pub type ParallelDurationMicrosecondArray = ParallelPrimitiveArray<DurationMicrosecondType>;
19pub type ParallelDurationMicrosecondArrayRef<'data> =
20 ParallelPrimitiveArrayRef<'data, DurationMicrosecondType>;
21pub type ParallelDurationNanosecondArray = ParallelPrimitiveArray<DurationNanosecondType>;
22pub type ParallelDurationNanosecondArrayRef<'data> =
23 ParallelPrimitiveArrayRef<'data, DurationNanosecondType>;
24
25pub trait DurationSecondArrayRefParallelIterator<'data> {
26 type Iter: ParallelIterator<Item = Option<i64>>;
27
28 fn par_iter(&'data self) -> Self::Iter;
29}
30
31impl<'data> DurationSecondArrayRefParallelIterator<'data> for DurationSecondArray {
32 type Iter = ParallelDurationSecondArrayRef<'data>;
33
34 fn par_iter(&'data self) -> Self::Iter {
35 ParallelDurationSecondArrayRef::new(self)
36 }
37}
38
39pub trait DurationMillisecondArrayRefParallelIterator<'data> {
40 type Iter: ParallelIterator<Item = Option<i64>>;
41
42 fn par_iter(&'data self) -> Self::Iter;
43}
44
45impl<'data> DurationMillisecondArrayRefParallelIterator<'data> for DurationMillisecondArray {
46 type Iter = ParallelDurationMillisecondArrayRef<'data>;
47
48 fn par_iter(&'data self) -> Self::Iter {
49 ParallelDurationMillisecondArrayRef::new(self)
50 }
51}
52
53pub trait DurationMicrosecondArrayRefParallelIterator<'data> {
54 type Iter: ParallelIterator<Item = Option<i64>>;
55
56 fn par_iter(&'data self) -> Self::Iter;
57}
58
59impl<'data> DurationMicrosecondArrayRefParallelIterator<'data> for DurationMicrosecondArray {
60 type Iter = ParallelDurationMicrosecondArrayRef<'data>;
61
62 fn par_iter(&'data self) -> Self::Iter {
63 ParallelDurationMicrosecondArrayRef::new(self)
64 }
65}
66
67pub trait DurationNanosecondArrayRefParallelIterator<'data> {
68 type Iter: ParallelIterator<Item = Option<i64>>;
69
70 fn par_iter(&'data self) -> Self::Iter;
71}
72
73impl<'data> DurationNanosecondArrayRefParallelIterator<'data> for DurationNanosecondArray {
74 type Iter = ParallelDurationNanosecondArrayRef<'data>;
75
76 fn par_iter(&'data self) -> Self::Iter {
77 ParallelDurationNanosecondArrayRef::new(self)
78 }
79}