vortex-array 0.54.0

Vortex in memory columnar data format
Documentation
// SPDX-License-Identifier: Apache-2.0
// SPDX-FileCopyrightText: Copyright the Vortex contributors

use itertools::Itertools;
use vortex_error::VortexResult;

use crate::arrays::{ChunkedArray, ChunkedVTable};
use crate::compute::{InvertKernel, InvertKernelAdapter, invert};
use crate::{ArrayRef, IntoArray, register_kernel};

impl InvertKernel for ChunkedVTable {
    fn invert(&self, array: &ChunkedArray) -> VortexResult<ArrayRef> {
        let chunks = array.chunks().iter().map(|c| invert(c)).try_collect()?;
        // SAFETY: Invert operation preserves the dtype of each chunk.
        // All inverted chunks maintain the same dtype as the original array.
        unsafe { Ok(ChunkedArray::new_unchecked(chunks, array.dtype().clone()).into_array()) }
    }
}

register_kernel!(InvertKernelAdapter(ChunkedVTable).lift());