Skip to content

Commit ece11dd

Browse files
committed
Support bring-your-own-key
Signed-off-by: Nicholas Gates <[email protected]>
1 parent 15cded9 commit ece11dd

File tree

4 files changed

+21
-7
lines changed

4 files changed

+21
-7
lines changed

vortex-array/src/arrays/chunked/vtable/mod.rs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,20 @@ use vortex_buffer::BufferHandle;
66
use vortex_dtype::DType;
77
use vortex_dtype::Nullability;
88
use vortex_dtype::PType;
9-
use vortex_error::VortexResult;
109
use vortex_error::vortex_bail;
1110
use vortex_error::vortex_err;
11+
use vortex_error::VortexResult;
12+
use vortex_mask::Mask;
1213
use vortex_vector::Vector;
1314
use vortex_vector::VectorMut;
1415
use vortex_vector::VectorMutOps;
1516

16-
use crate::EmptyMetadata;
17-
use crate::ToCanonical;
1817
use crate::arrays::ChunkedArray;
1918
use crate::arrays::PrimitiveArray;
2019
use crate::kernel::BindCtx;
2120
use crate::kernel::Kernel;
2221
use crate::kernel::KernelRef;
22+
use crate::kernel::PushDownResult;
2323
use crate::serde::ArrayChildren;
2424
use crate::validity::Validity;
2525
use crate::vtable;
@@ -28,6 +28,8 @@ use crate::vtable::ArrayVTable;
2828
use crate::vtable::ArrayVTableExt;
2929
use crate::vtable::NotSupported;
3030
use crate::vtable::VTable;
31+
use crate::EmptyMetadata;
32+
use crate::ToCanonical;
3133

3234
mod array;
3335
mod canonical;
@@ -157,4 +159,8 @@ impl Kernel for ChunkedKernel {
157159
}
158160
Ok(vector.freeze())
159161
}
162+
163+
fn push_down_filter(self: Box<Self>, _selection: &Mask) -> VortexResult<PushDownResult> {
164+
Ok(PushDownResult::NotPushed(self))
165+
}
160166
}

vortex-array/src/kernel/closure.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,12 @@ use std::fmt::Debug;
55
use std::fmt::Formatter;
66

77
use vortex_error::VortexResult;
8+
use vortex_mask::Mask;
89
use vortex_vector::Vector;
910

1011
use crate::kernel::Kernel;
1112
use crate::kernel::KernelRef;
13+
use crate::kernel::PushDownResult;
1214

1315
/// Create a kernel from a closure.
1416
pub fn kernel<F: FnOnce() -> VortexResult<Vector> + Send + 'static>(closure: F) -> KernelRef {
@@ -29,4 +31,8 @@ impl<F: FnOnce() -> VortexResult<Vector> + Send + 'static> Kernel for ClosureKer
2931
fn execute(self: Box<Self>) -> VortexResult<Vector> {
3032
(self.closure)()
3133
}
34+
35+
fn push_down_filter(self: Box<Self>, _selection: &Mask) -> VortexResult<PushDownResult> {
36+
Ok(PushDownResult::NotPushed(self))
37+
}
3238
}

vortex-array/src/kernel/mod.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,7 @@ pub trait Kernel: 'static + Send + Debug {
4040
/// Push a selection mask through this kernel.
4141
///
4242
/// Return `Ok(None)` if the filter cannot be pushed down.
43-
fn push_down_filter(self: Box<Self>, selection: &Mask) -> VortexResult<PushDownResult> {
44-
_ = selection;
45-
Ok(PushDownResult::NotPushed(self))
46-
}
43+
fn push_down_filter(self: Box<Self>, selection: &Mask) -> VortexResult<PushDownResult>;
4744
}
4845

4946
pub enum PushDownResult {

vortex-array/src/kernel/ready.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ use vortex_vector::Vector;
77

88
use crate::kernel::Kernel;
99
use crate::kernel::KernelRef;
10+
use crate::kernel::PushDownResult;
1011

1112
/// Create a kernel that is already computed and ready.
1213
pub fn ready(vector: Vector) -> KernelRef {
@@ -32,4 +33,8 @@ impl Kernel for ReadyKernel {
3233
_ = selection;
3334
0.0
3435
}
36+
37+
fn push_down_filter(self: Box<Self>, _selection: &Mask) -> VortexResult<PushDownResult> {
38+
Ok(PushDownResult::NotPushed(self))
39+
}
3540
}

0 commit comments

Comments
 (0)