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