Skip to content

Commit 3496dde

Browse files
committed
Remove selection mask
Signed-off-by: Nicholas Gates <[email protected]>
1 parent f584fa6 commit 3496dde

File tree

3 files changed

+22
-23
lines changed

3 files changed

+22
-23
lines changed

vortex-array/src/array/operator.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ impl ArrayOperator for Arc<dyn Array> {
7272

7373
impl<V: VTable> ArrayOperator for ArrayAdapter<V> {
7474
fn execute_batch(&self, ctx: &mut dyn ExecutionCtx) -> VortexResult<Vector> {
75-
let vector = <V::OperatorVTable as OperatorVTable<V>>::execute_batch(&self.0, ctx)?;
75+
let vector = V::execute(&self.0, ctx)?;
7676

7777
if cfg!(debug_assertions) {
7878
// Checks for correct type and nullability.

vortex-array/src/vtable/mod.rs

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,10 @@ pub use validity::*;
2525
pub use visitor::*;
2626
use vortex_buffer::ByteBuffer;
2727
use vortex_dtype::DType;
28-
use vortex_error::VortexResult;
28+
use vortex_error::{VortexResult, vortex_bail};
29+
use vortex_vector::Vector;
2930

31+
use crate::execution::ExecutionCtx;
3032
use crate::serde::ArrayChildren;
3133
use crate::{Array, Encoding, EncodingId, EncodingRef, IntoArray};
3234

@@ -127,6 +129,23 @@ pub trait VTable: 'static + Sized + Send + Sync + Debug {
127129
buffers: &[ByteBuffer],
128130
children: &dyn ArrayChildren,
129131
) -> VortexResult<Self::Array>;
132+
133+
/// Executes this array tree to return a canonical [`Vector`].
134+
///
135+
/// The returned vector must be the appropriate one for the array's logical type (they are
136+
/// one-to-one with Vortex `DType`s), and should respect the output nullability of the array.
137+
///
138+
/// Debug builds will panic if the returned vector is of the wrong type, wrong length, or
139+
/// incorrectly contains null values.
140+
///
141+
/// Implementations should recursively call [`crate::ArrayOperator::execute_batch`] on child
142+
/// arrays as needed.
143+
fn execute(array: &Self::Array, _ctx: &mut dyn ExecutionCtx) -> VortexResult<Vector> {
144+
vortex_bail!(
145+
"Array {} does not support vector execution",
146+
Self::encoding(array).id()
147+
)
148+
}
130149
}
131150

132151
/// Placeholder type used to indicate when a particular vtable is not supported by the encoding.

vortex-array/src/vtable/operator.rs

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,9 @@
22
// SPDX-FileCopyrightText: Copyright the Vortex contributors
33

44
use vortex_error::{VortexResult, vortex_bail};
5-
use vortex_vector::Vector;
65

76
use crate::ArrayRef;
8-
use crate::execution::{BatchKernelRef, BindCtx, ExecutionCtx};
7+
use crate::execution::{BatchKernelRef, BindCtx};
98
use crate::pipeline::PipelinedNode;
109
use crate::vtable::{NotSupported, VTable};
1110

@@ -15,25 +14,6 @@ use crate::vtable::{NotSupported, VTable};
1514
///
1615
/// See <https://github.com/vortex-data/vortex/pull/4726> for the operators RFC.
1716
pub trait OperatorVTable<V: VTable> {
18-
/// Returns a canonical [`Vector`].
19-
///
20-
/// The returned vector must be the appropriate one for the array's logical type (they are
21-
/// one-to-one with Vortex `DType`s), and should respect the output nullability of the array.
22-
///
23-
/// Debug builds will panic if the returned vector is of the wrong type, wrong length, or
24-
/// incorrectly contains null values.
25-
///
26-
/// Implementations should recursively call [`crate::ArrayOperator::execute_batch`] on child
27-
/// arrays as needed.
28-
// NOTE(ngates): in the future, we will add pipeline_execute to process chunks of 1k rows at
29-
// a time.
30-
// TODO(ngates): we should fix array vtables such that we can take the array by ownership. This
31-
// allows for more efficient in-place compute, as well as avoids allocating additional memory
32-
// if the array's own memory can be reused by some reasonable allocator.
33-
fn execute_batch(array: &V::Array, _ctx: &mut dyn ExecutionCtx) -> VortexResult<Vector> {
34-
Self::bind(array, None, &mut ())?.execute()
35-
}
36-
3717
/// Downcast this array into a [`PipelinedNode`] if it supports pipelined execution.
3818
///
3919
/// Each node is either a source node or a transformation node.

0 commit comments

Comments
 (0)