vortex_array/arrays/bool/compute/
mod.rs

1use crate::Array;
2use crate::arrays::BoolEncoding;
3use crate::compute::{
4    BinaryBooleanFn, CastFn, FillForwardFn, FillNullFn, FilterFn, InvertFn, IsConstantFn, MaskFn,
5    MinMaxFn, ScalarAtFn, SliceFn, SumFn, TakeFn, ToArrowFn, UncompressedSizeFn,
6};
7use crate::vtable::ComputeVTable;
8
9mod cast;
10mod fill_forward;
11mod fill_null;
12pub mod filter;
13mod flatten;
14mod invert;
15mod is_constant;
16mod mask;
17mod min_max;
18mod scalar_at;
19mod slice;
20mod sum;
21mod take;
22mod to_arrow;
23mod uncompressed_size;
24
25impl ComputeVTable for BoolEncoding {
26    fn binary_boolean_fn(&self) -> Option<&dyn BinaryBooleanFn<&dyn Array>> {
27        // We only implement this when other is a constant value, otherwise we fall back to the
28        // default implementation that canonicalizes to Arrow.
29        // TODO(ngates): implement this for constants.
30        // other.is_constant().then_some(self)
31        None
32    }
33
34    fn cast_fn(&self) -> Option<&dyn CastFn<&dyn Array>> {
35        Some(self)
36    }
37
38    fn fill_forward_fn(&self) -> Option<&dyn FillForwardFn<&dyn Array>> {
39        Some(self)
40    }
41
42    fn fill_null_fn(&self) -> Option<&dyn FillNullFn<&dyn Array>> {
43        Some(self)
44    }
45
46    fn filter_fn(&self) -> Option<&dyn FilterFn<&dyn Array>> {
47        Some(self)
48    }
49
50    fn invert_fn(&self) -> Option<&dyn InvertFn<&dyn Array>> {
51        Some(self)
52    }
53
54    fn is_constant_fn(&self) -> Option<&dyn IsConstantFn<&dyn Array>> {
55        Some(self)
56    }
57
58    fn mask_fn(&self) -> Option<&dyn MaskFn<&dyn Array>> {
59        Some(self)
60    }
61
62    fn min_max_fn(&self) -> Option<&dyn MinMaxFn<&dyn Array>> {
63        Some(self)
64    }
65
66    fn scalar_at_fn(&self) -> Option<&dyn ScalarAtFn<&dyn Array>> {
67        Some(self)
68    }
69
70    fn slice_fn(&self) -> Option<&dyn SliceFn<&dyn Array>> {
71        Some(self)
72    }
73
74    fn sum_fn(&self) -> Option<&dyn SumFn<&dyn Array>> {
75        Some(self)
76    }
77
78    fn take_fn(&self) -> Option<&dyn TakeFn<&dyn Array>> {
79        Some(self)
80    }
81
82    fn to_arrow_fn(&self) -> Option<&dyn ToArrowFn<&dyn Array>> {
83        Some(self)
84    }
85
86    fn uncompressed_size_fn(&self) -> Option<&dyn UncompressedSizeFn<&dyn Array>> {
87        Some(self)
88    }
89}