1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
use arrow_array::types::{
    DurationMicrosecondType, DurationMillisecondType, DurationNanosecondType, DurationSecondType,
};
use arrow_array::{
    DurationMicrosecondArray, DurationMillisecondArray, DurationNanosecondArray,
    DurationSecondArray,
};
use rayon::iter::ParallelIterator;

use crate::parallel_primitive_array::{ParallelPrimitiveArray, ParallelPrimitiveArrayRef};

pub type ParallelDurationSecondArray = ParallelPrimitiveArray<DurationSecondType>;
pub type ParallelDurationSecondArrayRef<'data> =
    ParallelPrimitiveArrayRef<'data, DurationSecondType>;
pub type ParallelDurationMillisecondArray = ParallelPrimitiveArray<DurationMillisecondType>;
pub type ParallelDurationMillisecondArrayRef<'data> =
    ParallelPrimitiveArrayRef<'data, DurationMillisecondType>;
pub type ParallelDurationMicrosecondArray = ParallelPrimitiveArray<DurationMicrosecondType>;
pub type ParallelDurationMicrosecondArrayRef<'data> =
    ParallelPrimitiveArrayRef<'data, DurationMicrosecondType>;
pub type ParallelDurationNanosecondArray = ParallelPrimitiveArray<DurationNanosecondType>;
pub type ParallelDurationNanosecondArrayRef<'data> =
    ParallelPrimitiveArrayRef<'data, DurationNanosecondType>;

pub trait DurationSecondArrayRefParallelIterator<'data> {
    type Iter: ParallelIterator<Item = Option<i64>>;

    fn par_iter(&'data self) -> Self::Iter;
}

impl<'data> DurationSecondArrayRefParallelIterator<'data> for DurationSecondArray {
    type Iter = ParallelDurationSecondArrayRef<'data>;

    fn par_iter(&'data self) -> Self::Iter {
        ParallelDurationSecondArrayRef::new(self)
    }
}

pub trait DurationMillisecondArrayRefParallelIterator<'data> {
    type Iter: ParallelIterator<Item = Option<i64>>;

    fn par_iter(&'data self) -> Self::Iter;
}

impl<'data> DurationMillisecondArrayRefParallelIterator<'data> for DurationMillisecondArray {
    type Iter = ParallelDurationMillisecondArrayRef<'data>;

    fn par_iter(&'data self) -> Self::Iter {
        ParallelDurationMillisecondArrayRef::new(self)
    }
}

pub trait DurationMicrosecondArrayRefParallelIterator<'data> {
    type Iter: ParallelIterator<Item = Option<i64>>;

    fn par_iter(&'data self) -> Self::Iter;
}

impl<'data> DurationMicrosecondArrayRefParallelIterator<'data> for DurationMicrosecondArray {
    type Iter = ParallelDurationMicrosecondArrayRef<'data>;

    fn par_iter(&'data self) -> Self::Iter {
        ParallelDurationMicrosecondArrayRef::new(self)
    }
}

pub trait DurationNanosecondArrayRefParallelIterator<'data> {
    type Iter: ParallelIterator<Item = Option<i64>>;

    fn par_iter(&'data self) -> Self::Iter;
}

impl<'data> DurationNanosecondArrayRefParallelIterator<'data> for DurationNanosecondArray {
    type Iter = ParallelDurationNanosecondArrayRef<'data>;

    fn par_iter(&'data self) -> Self::Iter {
        ParallelDurationNanosecondArrayRef::new(self)
    }
}