1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use vortex_array::compute::{like, LikeFn, LikeOptions};
use vortex_array::{ArrayData, IntoArrayData};
use vortex_error::VortexResult;

use crate::{DictArray, DictEncoding};

impl LikeFn<DictArray> for DictEncoding {
    fn like(
        &self,
        array: &DictArray,
        pattern: &ArrayData,
        options: LikeOptions,
    ) -> VortexResult<ArrayData> {
        let values = like(&array.values(), pattern, options)?;
        Ok(DictArray::try_new(array.codes(), values)?.into_array())
    }
}