arrow_rayon/parallel_array/
parallel_time_array.rs1use arrow_array::types::{
2 Time32MillisecondType, Time32SecondType, Time64MicrosecondType, Time64NanosecondType,
3};
4use arrow_array::{
5 Time32MillisecondArray, Time32SecondArray, Time64MicrosecondArray, Time64NanosecondArray,
6};
7use rayon::iter::ParallelIterator;
8
9use crate::parallel_primitive_array::{ParallelPrimitiveArray, ParallelPrimitiveArrayRef};
10
11pub type ParallelTime32SecondArray = ParallelPrimitiveArray<Time32SecondType>;
12pub type ParallelTime32SecondArrayRef<'data> = ParallelPrimitiveArrayRef<'data, Time32SecondType>;
13pub type ParallelTime32MillisecondArray = ParallelPrimitiveArray<Time32MillisecondType>;
14pub type ParallelTime32MillisecondArrayRef<'data> =
15 ParallelPrimitiveArrayRef<'data, Time32MillisecondType>;
16pub type ParallelTime64MicrosecondArray = ParallelPrimitiveArray<Time64MicrosecondType>;
17pub type ParallelTime64MicrosecondArrayRef<'data> =
18 ParallelPrimitiveArrayRef<'data, Time64MicrosecondType>;
19pub type ParallelTime64NanosecondArray = ParallelPrimitiveArray<Time64NanosecondType>;
20pub type ParallelTime64NanosecondArrayRef<'data> =
21 ParallelPrimitiveArrayRef<'data, Time64NanosecondType>;
22
23pub trait Time32SecondArrayRefParallelIterator<'data> {
24 type Iter: ParallelIterator<Item = Option<i32>>;
25
26 fn par_iter(&'data self) -> Self::Iter;
27}
28
29impl<'data> Time32SecondArrayRefParallelIterator<'data> for Time32SecondArray {
30 type Iter = ParallelTime32SecondArrayRef<'data>;
31
32 fn par_iter(&'data self) -> Self::Iter {
33 ParallelTime32SecondArrayRef::new(self)
34 }
35}
36
37pub trait Time32MillisecondArrayRefParallelIterator<'data> {
38 type Iter: ParallelIterator<Item = Option<i32>>;
39
40 fn par_iter(&'data self) -> Self::Iter;
41}
42
43impl<'data> Time32MillisecondArrayRefParallelIterator<'data> for Time32MillisecondArray {
44 type Iter = ParallelTime32MillisecondArrayRef<'data>;
45
46 fn par_iter(&'data self) -> Self::Iter {
47 ParallelTime32MillisecondArrayRef::new(self)
48 }
49}
50
51pub trait Time64MicrosecondArrayRefParallelIterator<'data> {
52 type Iter: ParallelIterator<Item = Option<i64>>;
53
54 fn par_iter(&'data self) -> Self::Iter;
55}
56
57impl<'data> Time64MicrosecondArrayRefParallelIterator<'data> for Time64MicrosecondArray {
58 type Iter = ParallelTime64MicrosecondArrayRef<'data>;
59
60 fn par_iter(&'data self) -> Self::Iter {
61 ParallelTime64MicrosecondArrayRef::new(self)
62 }
63}
64
65pub trait Time64NanosecondArrayRefParallelIterator<'data> {
66 type Iter: ParallelIterator<Item = Option<i64>>;
67
68 fn par_iter(&'data self) -> Self::Iter;
69}
70
71impl<'data> Time64NanosecondArrayRefParallelIterator<'data> for Time64NanosecondArray {
72 type Iter = ParallelTime64NanosecondArrayRef<'data>;
73
74 fn par_iter(&'data self) -> Self::Iter {
75 ParallelTime64NanosecondArrayRef::new(self)
76 }
77}