Skip to content

Commit 9522d62

Browse files
gatesnconnortsui20
authored andcommitted
Use scalar functions as arrays
Signed-off-by: Nicholas Gates <nick@nickgates.com> Signed-off-by: Connor Tsui <connor.tsui20@gmail.com>
1 parent 5ad3c47 commit 9522d62

24 files changed

Lines changed: 283 additions & 934 deletions

File tree

encodings/zigzag/public-api.lock

Lines changed: 20 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -4,122 +4,48 @@ pub struct vortex_zigzag::ZigZag
44

55
impl vortex_zigzag::ZigZag
66

7-
pub const vortex_zigzag::ZigZag::ID: vortex_array::array::ArrayId
8-
9-
pub fn vortex_zigzag::ZigZag::try_new(encoded: vortex_array::array::erased::ArrayRef) -> vortex_error::VortexResult<vortex_zigzag::ZigZagArray>
7+
pub const vortex_zigzag::ZigZag::ID: vortex_array::scalar_fn::ScalarFnId
108

119
impl core::clone::Clone for vortex_zigzag::ZigZag
1210

1311
pub fn vortex_zigzag::ZigZag::clone(&self) -> vortex_zigzag::ZigZag
1412

15-
impl core::fmt::Debug for vortex_zigzag::ZigZag
16-
17-
pub fn vortex_zigzag::ZigZag::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result
18-
19-
impl vortex_array::array::vtable::VTable for vortex_zigzag::ZigZag
20-
21-
pub type vortex_zigzag::ZigZag::ArrayData = vortex_zigzag::ZigZagData
22-
23-
pub type vortex_zigzag::ZigZag::OperationsVTable = vortex_zigzag::ZigZag
24-
25-
pub type vortex_zigzag::ZigZag::ValidityVTable = vortex_array::array::vtable::validity::ValidityVTableFromChild
26-
27-
pub fn vortex_zigzag::ZigZag::buffer(_array: vortex_array::array::view::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle
28-
29-
pub fn vortex_zigzag::ZigZag::buffer_name(_array: vortex_array::array::view::ArrayView<'_, Self>, idx: usize) -> core::option::Option<alloc::string::String>
30-
31-
pub fn vortex_zigzag::ZigZag::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult<vortex_array::array::typed::ArrayParts<Self>>
32-
33-
pub fn vortex_zigzag::ZigZag::execute(array: vortex_array::array::typed::Array<Self>, ctx: &mut vortex_array::executor::ExecutionCtx) -> vortex_error::VortexResult<vortex_array::executor::ExecutionResult>
34-
35-
pub fn vortex_zigzag::ZigZag::execute_parent(array: vortex_array::array::view::ArrayView<'_, Self>, parent: &vortex_array::array::erased::ArrayRef, child_idx: usize, ctx: &mut vortex_array::executor::ExecutionCtx) -> vortex_error::VortexResult<core::option::Option<vortex_array::array::erased::ArrayRef>>
36-
37-
pub fn vortex_zigzag::ZigZag::id(&self) -> vortex_array::array::ArrayId
38-
39-
pub fn vortex_zigzag::ZigZag::nbuffers(_array: vortex_array::array::view::ArrayView<'_, Self>) -> usize
40-
41-
pub fn vortex_zigzag::ZigZag::reduce_parent(array: vortex_array::array::view::ArrayView<'_, Self>, parent: &vortex_array::array::erased::ArrayRef, child_idx: usize) -> vortex_error::VortexResult<core::option::Option<vortex_array::array::erased::ArrayRef>>
42-
43-
pub fn vortex_zigzag::ZigZag::serialize(_array: vortex_array::array::view::ArrayView<'_, Self>, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult<core::option::Option<alloc::vec::Vec<u8>>>
44-
45-
pub fn vortex_zigzag::ZigZag::slot_name(_array: vortex_array::array::view::ArrayView<'_, Self>, idx: usize) -> alloc::string::String
46-
47-
pub fn vortex_zigzag::ZigZag::validate(&self, _data: &Self::ArrayData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option<vortex_array::array::erased::ArrayRef>]) -> vortex_error::VortexResult<()>
48-
49-
impl vortex_array::array::vtable::operations::OperationsVTable<vortex_zigzag::ZigZag> for vortex_zigzag::ZigZag
50-
51-
pub fn vortex_zigzag::ZigZag::scalar_at(array: vortex_array::array::view::ArrayView<'_, vortex_zigzag::ZigZag>, index: usize, _ctx: &mut vortex_array::executor::ExecutionCtx) -> vortex_error::VortexResult<vortex_array::scalar::Scalar>
52-
53-
impl vortex_array::array::vtable::validity::ValidityChild<vortex_zigzag::ZigZag> for vortex_zigzag::ZigZag
54-
55-
pub fn vortex_zigzag::ZigZag::validity_child(array: vortex_array::array::view::ArrayView<'_, vortex_zigzag::ZigZag>) -> vortex_array::array::erased::ArrayRef
56-
57-
impl vortex_array::arrays::dict::take::TakeExecute for vortex_zigzag::ZigZag
58-
59-
pub fn vortex_zigzag::ZigZag::take(array: vortex_array::array::view::ArrayView<'_, Self>, indices: &vortex_array::array::erased::ArrayRef, _ctx: &mut vortex_array::executor::ExecutionCtx) -> vortex_error::VortexResult<core::option::Option<vortex_array::array::erased::ArrayRef>>
60-
61-
impl vortex_array::arrays::filter::kernel::FilterReduce for vortex_zigzag::ZigZag
62-
63-
pub fn vortex_zigzag::ZigZag::filter(array: vortex_array::array::view::ArrayView<'_, Self>, mask: &vortex_mask::Mask) -> vortex_error::VortexResult<core::option::Option<vortex_array::array::erased::ArrayRef>>
64-
65-
impl vortex_array::arrays::slice::SliceReduce for vortex_zigzag::ZigZag
66-
67-
pub fn vortex_zigzag::ZigZag::slice(array: vortex_array::array::view::ArrayView<'_, Self>, range: core::ops::range::Range<usize>) -> vortex_error::VortexResult<core::option::Option<vortex_array::array::erased::ArrayRef>>
68-
69-
impl vortex_array::scalar_fn::fns::cast::kernel::CastReduce for vortex_zigzag::ZigZag
70-
71-
pub fn vortex_zigzag::ZigZag::cast(array: vortex_array::array::view::ArrayView<'_, Self>, dtype: &vortex_array::dtype::DType) -> vortex_error::VortexResult<core::option::Option<vortex_array::array::erased::ArrayRef>>
72-
73-
impl vortex_array::scalar_fn::fns::mask::kernel::MaskReduce for vortex_zigzag::ZigZag
74-
75-
pub fn vortex_zigzag::ZigZag::mask(array: vortex_array::array::view::ArrayView<'_, Self>, mask: &vortex_array::array::erased::ArrayRef) -> vortex_error::VortexResult<core::option::Option<vortex_array::array::erased::ArrayRef>>
76-
77-
pub struct vortex_zigzag::ZigZagData
78-
79-
impl vortex_zigzag::ZigZagData
80-
81-
pub fn vortex_zigzag::ZigZagData::new() -> Self
82-
83-
pub fn vortex_zigzag::ZigZagData::try_new(encoded_dtype: &vortex_array::dtype::DType) -> vortex_error::VortexResult<Self>
84-
85-
impl core::clone::Clone for vortex_zigzag::ZigZagData
86-
87-
pub fn vortex_zigzag::ZigZagData::clone(&self) -> vortex_zigzag::ZigZagData
13+
impl vortex_array::arrays::scalar_fn::plugin::ScalarFnArrayVTable for vortex_zigzag::ZigZag
8814

89-
impl core::default::Default for vortex_zigzag::ZigZagData
15+
pub fn vortex_zigzag::ZigZag::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult<vortex_array::arrays::scalar_fn::plugin::ScalarFnArrayParts<Self>>
9016

91-
pub fn vortex_zigzag::ZigZagData::default() -> Self
17+
pub fn vortex_zigzag::ZigZag::serialize(&self, _view: &vortex_array::arrays::scalar_fn::vtable::ScalarFnArrayView<'_, Self>, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult<core::option::Option<alloc::vec::Vec<u8>>>
9218

93-
impl core::fmt::Debug for vortex_zigzag::ZigZagData
19+
impl vortex_array::scalar_fn::vtable::ScalarFnVTable for vortex_zigzag::ZigZag
9420

95-
pub fn vortex_zigzag::ZigZagData::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result
21+
pub type vortex_zigzag::ZigZag::Options = vortex_array::scalar_fn::vtable::EmptyOptions
9622

97-
impl core::fmt::Display for vortex_zigzag::ZigZagData
23+
pub fn vortex_zigzag::ZigZag::arity(&self, _options: &vortex_array::scalar_fn::vtable::EmptyOptions) -> vortex_array::scalar_fn::vtable::Arity
9824

99-
pub fn vortex_zigzag::ZigZagData::fmt(&self, _f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result
25+
pub fn vortex_zigzag::ZigZag::child_name(&self, _options: &vortex_array::scalar_fn::vtable::EmptyOptions, child_idx: usize) -> vortex_array::scalar_fn::vtable::ChildName
10026

101-
impl vortex_array::hash::ArrayEq for vortex_zigzag::ZigZagData
27+
pub fn vortex_zigzag::ZigZag::deserialize(&self, _metadata: &[u8], _session: &vortex_session::VortexSession) -> vortex_error::VortexResult<vortex_array::scalar_fn::vtable::EmptyOptions>
10228

103-
pub fn vortex_zigzag::ZigZagData::array_eq(&self, _other: &Self, _precision: vortex_array::hash::Precision) -> bool
29+
pub fn vortex_zigzag::ZigZag::execute(&self, _options: &vortex_array::scalar_fn::vtable::EmptyOptions, args: &dyn vortex_array::scalar_fn::vtable::ExecutionArgs, ctx: &mut vortex_array::executor::ExecutionCtx) -> vortex_error::VortexResult<vortex_array::array::erased::ArrayRef>
10430

105-
impl vortex_array::hash::ArrayHash for vortex_zigzag::ZigZagData
31+
pub fn vortex_zigzag::ZigZag::fmt_sql(&self, _options: &vortex_array::scalar_fn::vtable::EmptyOptions, expr: &vortex_array::expr::expression::Expression, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result
10632

107-
pub fn vortex_zigzag::ZigZagData::array_hash<H: core::hash::Hasher>(&self, _state: &mut H, _precision: vortex_array::hash::Precision)
33+
pub fn vortex_zigzag::ZigZag::id(&self) -> vortex_array::scalar_fn::ScalarFnId
10834

109-
pub trait vortex_zigzag::ZigZagArrayExt: vortex_array::array::typed::TypedArrayRef<vortex_zigzag::ZigZag>
35+
pub fn vortex_zigzag::ZigZag::is_fallible(&self, _options: &vortex_array::scalar_fn::vtable::EmptyOptions) -> bool
11036

111-
pub fn vortex_zigzag::ZigZagArrayExt::encoded(&self) -> &vortex_array::array::erased::ArrayRef
37+
pub fn vortex_zigzag::ZigZag::is_null_sensitive(&self, _options: &vortex_array::scalar_fn::vtable::EmptyOptions) -> bool
11238

113-
pub fn vortex_zigzag::ZigZagArrayExt::ptype(&self) -> vortex_array::dtype::ptype::PType
39+
pub fn vortex_zigzag::ZigZag::return_dtype(&self, _options: &vortex_array::scalar_fn::vtable::EmptyOptions, arg_dtypes: &[vortex_array::dtype::DType]) -> vortex_error::VortexResult<vortex_array::dtype::DType>
11440

115-
impl<T: vortex_array::array::typed::TypedArrayRef<vortex_zigzag::ZigZag>> vortex_zigzag::ZigZagArrayExt for T
41+
pub fn vortex_zigzag::ZigZag::serialize(&self, _options: &vortex_array::scalar_fn::vtable::EmptyOptions) -> vortex_error::VortexResult<core::option::Option<alloc::vec::Vec<u8>>>
11642

117-
pub fn T::encoded(&self) -> &vortex_array::array::erased::ArrayRef
43+
pub fn vortex_zigzag::ZigZag::validity(&self, _options: &vortex_array::scalar_fn::vtable::EmptyOptions, expression: &vortex_array::expr::expression::Expression) -> vortex_error::VortexResult<core::option::Option<vortex_array::expr::expression::Expression>>
11844

119-
pub fn T::ptype(&self) -> vortex_array::dtype::ptype::PType
45+
pub fn vortex_zigzag::initialize(session: &vortex_session::VortexSession)
12046

12147
pub fn vortex_zigzag::zigzag_decode(parray: vortex_array::arrays::primitive::vtable::PrimitiveArray) -> vortex_array::arrays::primitive::vtable::PrimitiveArray
12248

123-
pub fn vortex_zigzag::zigzag_encode(parray: vortex_array::array::view::ArrayView<'_, vortex_array::arrays::primitive::vtable::Primitive>) -> vortex_error::VortexResult<vortex_zigzag::ZigZagArray>
49+
pub fn vortex_zigzag::zigzag_encode(parray: vortex_array::array::view::ArrayView<'_, vortex_array::arrays::primitive::vtable::Primitive>) -> vortex_error::VortexResult<vortex_array::array::erased::ArrayRef>
12450

125-
pub type vortex_zigzag::ZigZagArray = vortex_array::array::typed::Array<vortex_zigzag::ZigZag>
51+
pub fn vortex_zigzag::zigzag_try_new(encoded: vortex_array::array::erased::ArrayRef) -> vortex_error::VortexResult<vortex_array::array::erased::ArrayRef>

0 commit comments

Comments
 (0)