1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use vortex_array::compute::{fill_null, FillNullFn};
use vortex_array::{ArrayData, ArrayLen, IntoArrayData};
use vortex_error::VortexResult;
use vortex_scalar::Scalar;

use crate::{RunEndArray, RunEndEncoding};

impl FillNullFn<RunEndArray> for RunEndEncoding {
    fn fill_null(&self, array: &RunEndArray, fill_value: Scalar) -> VortexResult<ArrayData> {
        Ok(RunEndArray::with_offset_and_length(
            array.ends(),
            fill_null(array.values(), fill_value)?,
            array.offset(),
            array.len(),
        )?
        .into_array())
    }
}