vortex_runend/compute/
is_constant.rs1use vortex_array::compute::{
5 IsConstantKernel, IsConstantKernelAdapter, IsConstantOpts, is_constant_opts,
6};
7use vortex_array::stats::Stat;
8use vortex_array::{Array, register_kernel};
9use vortex_error::VortexResult;
10
11use crate::RunEndVTable;
12
13impl IsConstantKernel for RunEndVTable {
14 fn is_constant(
15 &self,
16 array: &Self::Array,
17 opts: &IsConstantOpts,
18 ) -> VortexResult<Option<bool>> {
19 debug_assert_eq!(
21 array
22 .ends()
23 .statistics()
24 .compute_as::<bool>(Stat::IsStrictSorted),
25 Some(true)
26 );
27 is_constant_opts(array.values(), opts)
28 }
29}
30
31register_kernel!(IsConstantKernelAdapter(RunEndVTable).lift());