arrow_rayon/parallel_array/
parallel_timestamp_array.rs1use arrow_array::types::{
2 TimestampMicrosecondType, TimestampMillisecondType, TimestampNanosecondType,
3 TimestampSecondType,
4};
5use arrow_array::{
6 TimestampMicrosecondArray, TimestampMillisecondArray, TimestampNanosecondArray,
7 TimestampSecondArray,
8};
9use rayon::iter::ParallelIterator;
10
11use crate::parallel_primitive_array::{ParallelPrimitiveArray, ParallelPrimitiveArrayRef};
12
13pub type ParallelTimestampSecondArray = ParallelPrimitiveArray<TimestampSecondType>;
14pub type ParallelTimestampSecondArrayRef<'data> =
15 ParallelPrimitiveArrayRef<'data, TimestampSecondType>;
16pub type ParallelTimestampMillisecondArray = ParallelPrimitiveArray<TimestampMillisecondType>;
17pub type ParallelTimestampMillisecondArrayRef<'data> =
18 ParallelPrimitiveArrayRef<'data, TimestampMillisecondType>;
19pub type ParallelTimestampMicrosecondArray = ParallelPrimitiveArray<TimestampMicrosecondType>;
20pub type ParallelTimestampMicrosecondArrayRef<'data> =
21 ParallelPrimitiveArrayRef<'data, TimestampMicrosecondType>;
22pub type ParallelTimestampNanosecondArray = ParallelPrimitiveArray<TimestampNanosecondType>;
23pub type ParallelTimestampNanosecondArrayRef<'data> =
24 ParallelPrimitiveArrayRef<'data, TimestampNanosecondType>;
25
26pub trait TimestampSecondArrayRefParallelIterator<'data> {
27 type Iter: ParallelIterator<Item = Option<i64>>;
28
29 fn par_iter(&'data self) -> Self::Iter;
30}
31
32impl<'data> TimestampSecondArrayRefParallelIterator<'data> for TimestampSecondArray {
33 type Iter = ParallelTimestampSecondArrayRef<'data>;
34
35 fn par_iter(&'data self) -> Self::Iter {
36 ParallelTimestampSecondArrayRef::new(self)
37 }
38}
39
40pub trait TimestampMillisecondArrayRefParallelIterator<'data> {
41 type Iter: ParallelIterator<Item = Option<i64>>;
42
43 fn par_iter(&'data self) -> Self::Iter;
44}
45
46impl<'data> TimestampMillisecondArrayRefParallelIterator<'data> for TimestampMillisecondArray {
47 type Iter = ParallelTimestampMillisecondArrayRef<'data>;
48
49 fn par_iter(&'data self) -> Self::Iter {
50 ParallelTimestampMillisecondArrayRef::new(self)
51 }
52}
53
54pub trait TimestampMicrosecondArrayRefParallelIterator<'data> {
55 type Iter: ParallelIterator<Item = Option<i64>>;
56
57 fn par_iter(&'data self) -> Self::Iter;
58}
59
60impl<'data> TimestampMicrosecondArrayRefParallelIterator<'data> for TimestampMicrosecondArray {
61 type Iter = ParallelTimestampMicrosecondArrayRef<'data>;
62
63 fn par_iter(&'data self) -> Self::Iter {
64 ParallelTimestampMicrosecondArrayRef::new(self)
65 }
66}
67
68pub trait TimestampNanosecondArrayRefParallelIterator<'data> {
69 type Iter: ParallelIterator<Item = Option<i64>>;
70
71 fn par_iter(&'data self) -> Self::Iter;
72}
73
74impl<'data> TimestampNanosecondArrayRefParallelIterator<'data> for TimestampNanosecondArray {
75 type Iter = ParallelTimestampNanosecondArrayRef<'data>;
76
77 fn par_iter(&'data self) -> Self::Iter {
78 ParallelTimestampNanosecondArrayRef::new(self)
79 }
80}