vortex_array/arrays/varbin/compute/
mod.rs1pub use min_max::compute_min_max;
2use vortex_error::VortexResult;
3use vortex_scalar::Scalar;
4
5use crate::arrays::VarBinEncoding;
6use crate::arrays::varbin::{VarBinArray, varbin_scalar};
7use crate::compute::{
8 CastFn, CompareFn, FilterKernelAdapter, IsConstantFn, IsSortedFn, KernelRef, MaskFn, MinMaxFn,
9 ScalarAtFn, SliceFn, TakeFn, ToArrowFn, UncompressedSizeFn,
10};
11use crate::vtable::ComputeVTable;
12use crate::{Array, ArrayComputeImpl};
13
14mod cast;
15mod compare;
16mod filter;
17mod is_constant;
18mod is_sorted;
19mod mask;
20mod min_max;
21mod slice;
22mod take;
23pub(crate) mod to_arrow;
24mod uncompressed_size;
25
26impl ArrayComputeImpl for VarBinArray {
27 const FILTER: Option<KernelRef> = FilterKernelAdapter(VarBinEncoding).some();
28}
29
30impl ComputeVTable for VarBinEncoding {
31 fn cast_fn(&self) -> Option<&dyn CastFn<&dyn Array>> {
32 Some(self)
33 }
34
35 fn compare_fn(&self) -> Option<&dyn CompareFn<&dyn Array>> {
36 Some(self)
37 }
38
39 fn is_constant_fn(&self) -> Option<&dyn IsConstantFn<&dyn Array>> {
40 Some(self)
41 }
42
43 fn is_sorted_fn(&self) -> Option<&dyn IsSortedFn<&dyn Array>> {
44 Some(self)
45 }
46
47 fn mask_fn(&self) -> Option<&dyn MaskFn<&dyn Array>> {
48 Some(self)
49 }
50
51 fn scalar_at_fn(&self) -> Option<&dyn ScalarAtFn<&dyn Array>> {
52 Some(self)
53 }
54
55 fn slice_fn(&self) -> Option<&dyn SliceFn<&dyn Array>> {
56 Some(self)
57 }
58
59 fn take_fn(&self) -> Option<&dyn TakeFn<&dyn Array>> {
60 Some(self)
61 }
62
63 fn to_arrow_fn(&self) -> Option<&dyn ToArrowFn<&dyn Array>> {
64 Some(self)
65 }
66
67 fn min_max_fn(&self) -> Option<&dyn MinMaxFn<&dyn Array>> {
68 Some(self)
69 }
70
71 fn uncompressed_size_fn(&self) -> Option<&dyn UncompressedSizeFn<&dyn Array>> {
72 Some(self)
73 }
74}
75
76impl ScalarAtFn<&VarBinArray> for VarBinEncoding {
77 fn scalar_at(&self, array: &VarBinArray, index: usize) -> VortexResult<Scalar> {
78 Ok(varbin_scalar(array.bytes_at(index)?, array.dtype()))
79 }
80}