Skip to content
Merged
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
1 change: 1 addition & 0 deletions vortex-array/src/arrays/extension/vtable/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
mod array;
mod canonical;
mod operations;
mod operator;
mod serde;
mod validity;
mod visitor;
Expand Down
20 changes: 20 additions & 0 deletions vortex-array/src/arrays/extension/vtable/operator.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// SPDX-License-Identifier: Apache-2.0
// SPDX-FileCopyrightText: Copyright the Vortex contributors

use vortex_error::VortexResult;

use crate::ArrayRef;
use crate::arrays::{ExtensionArray, ExtensionVTable};
use crate::execution::{BatchKernelRef, BindCtx};
use crate::vtable::OperatorVTable;

impl OperatorVTable<ExtensionVTable> for ExtensionVTable {
fn bind(
array: &ExtensionArray,
selection: Option<&ArrayRef>,
ctx: &mut dyn BindCtx,
) -> VortexResult<BatchKernelRef> {
// Since vectors are physically typed, extension array can delegate to its storage array
ctx.bind(&array.storage, selection)
}
}
19 changes: 16 additions & 3 deletions vortex-array/src/arrays/null/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@ use vortex_dtype::DType;
use vortex_error::VortexResult;
use vortex_mask::Mask;
use vortex_scalar::Scalar;
use vortex_vector::NullVector;

use crate::execution::{BatchKernelRef, BindCtx, kernel};
use crate::serde::ArrayChildren;
use crate::stats::{ArrayStats, StatsSetRef};
use crate::vtable::{
ArrayVTable, CanonicalVTable, NotSupported, OperationsVTable, SerdeVTable, VTable,
ValidityVTable, VisitorVTable,
ArrayVTable, CanonicalVTable, NotSupported, OperationsVTable, OperatorVTable, SerdeVTable,
VTable, ValidityVTable, VisitorVTable,
};
use crate::{
ArrayBufferVisitor, ArrayChildVisitor, ArrayRef, Canonical, EmptyMetadata, EncodingId,
Expand All @@ -36,8 +38,8 @@ impl VTable for NullVTable {
type VisitorVTable = Self;
type ComputeVTable = NotSupported;
type EncodeVTable = NotSupported;
type OperatorVTable = NotSupported;
type SerdeVTable = Self;
type OperatorVTable = Self;

fn id(_encoding: &Self::Encoding) -> EncodingId {
EncodingId::new_ref("vortex.null")
Expand Down Expand Up @@ -170,3 +172,14 @@ impl ValidityVTable<NullVTable> for NullVTable {
Mask::AllFalse(array.len)
}
}

impl OperatorVTable<NullVTable> for NullVTable {
fn bind(
array: &NullArray,
_selection: Option<&ArrayRef>,
_ctx: &mut dyn BindCtx,
) -> VortexResult<BatchKernelRef> {
let len = array.len();
Ok(kernel(move || Ok(NullVector::new(len).into())))
}
}
Loading