Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions vortex-array/public-api.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3152,6 +3152,8 @@ pub type vortex_array::arrays::SliceVTable::ValidityVTable = vortex_array::array

pub type vortex_array::arrays::SliceVTable::VisitorVTable = vortex_array::arrays::SliceVTable

pub fn vortex_array::arrays::SliceVTable::append_to_builder(array: &Self::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()>

pub fn vortex_array::arrays::SliceVTable::build(dtype: &vortex_array::dtype::DType, len: usize, metadata: &vortex_array::arrays::SliceMetadata, _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult<Self::Array>

pub fn vortex_array::arrays::SliceVTable::deserialize(_bytes: &[u8], _dtype: &vortex_array::dtype::DType, _len: usize, _buffers: &[vortex_array::buffer::BufferHandle], _session: &vortex_session::VortexSession) -> vortex_error::VortexResult<Self::Metadata>
Expand Down Expand Up @@ -16488,6 +16490,8 @@ pub type vortex_array::arrays::SliceVTable::ValidityVTable = vortex_array::array

pub type vortex_array::arrays::SliceVTable::VisitorVTable = vortex_array::arrays::SliceVTable

pub fn vortex_array::arrays::SliceVTable::append_to_builder(array: &Self::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()>

pub fn vortex_array::arrays::SliceVTable::build(dtype: &vortex_array::dtype::DType, len: usize, metadata: &vortex_array::arrays::SliceMetadata, _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult<Self::Array>

pub fn vortex_array::arrays::SliceVTable::deserialize(_bytes: &[u8], _dtype: &vortex_array::dtype::DType, _len: usize, _buffers: &[vortex_array::buffer::BufferHandle], _session: &vortex_session::VortexSession) -> vortex_error::VortexResult<Self::Metadata>
Expand Down
13 changes: 13 additions & 0 deletions vortex-array/src/arrays/slice/vtable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ use crate::Precision;
use crate::arrays::slice::array::SliceArray;
use crate::arrays::slice::rules::PARENT_RULES;
use crate::buffer::BufferHandle;
use crate::builders::ArrayBuilder;
use crate::dtype::DType;
use crate::executor::ExecutionCtx;
use crate::scalar::Scalar;
Expand Down Expand Up @@ -108,6 +109,18 @@ impl VTable for SliceVTable {
Ok(())
}

fn append_to_builder(
array: &Self::Array,
builder: &mut dyn ArrayBuilder,
ctx: &mut ExecutionCtx,
) -> VortexResult<()> {
// Execute through the full loop so that execute_parent optimizations
// can fire before we canonicalize.
let canonical = array.to_array().execute::<Canonical>(ctx)?;
builder.extend_from_array(canonical.as_ref());
Ok(())
}

fn execute(array: &Self::Array, ctx: &mut ExecutionCtx) -> VortexResult<ArrayRef> {
// Execute the child to get canonical form, then slice it
let Some(canonical) = array.child.as_opt::<AnyCanonical>() else {
Expand Down
Loading