Skip to content

Commit 4bb468c

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 26f7426 commit 4bb468c

23 files changed

Lines changed: 274 additions & 930 deletions

File tree

encodings/zigzag/public-api.lock

Lines changed: 19 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -2,122 +2,46 @@ pub mod vortex_zigzag
22

33
pub struct vortex_zigzag::ZigZag
44

5-
impl vortex_zigzag::ZigZag
6-
7-
pub fn vortex_zigzag::ZigZag::try_new(encoded: vortex_array::array::erased::ArrayRef) -> vortex_error::VortexResult<vortex_zigzag::ZigZagArray>
8-
95
impl core::clone::Clone for vortex_zigzag::ZigZag
106

117
pub fn vortex_zigzag::ZigZag::clone(&self) -> vortex_zigzag::ZigZag
128

13-
impl core::fmt::Debug for vortex_zigzag::ZigZag
14-
15-
pub fn vortex_zigzag::ZigZag::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result
16-
17-
impl vortex_array::array::vtable::VTable for vortex_zigzag::ZigZag
18-
19-
pub type vortex_zigzag::ZigZag::ArrayData = vortex_zigzag::ZigZagData
20-
21-
pub type vortex_zigzag::ZigZag::OperationsVTable = vortex_zigzag::ZigZag
22-
23-
pub type vortex_zigzag::ZigZag::ValidityVTable = vortex_array::array::vtable::validity::ValidityVTableFromChild
24-
25-
pub fn vortex_zigzag::ZigZag::buffer(_array: vortex_array::array::view::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle
26-
27-
pub fn vortex_zigzag::ZigZag::buffer_name(_array: vortex_array::array::view::ArrayView<'_, Self>, idx: usize) -> core::option::Option<alloc::string::String>
28-
29-
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>>
30-
31-
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>
32-
33-
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>>
34-
35-
pub fn vortex_zigzag::ZigZag::id(&self) -> vortex_array::array::ArrayId
36-
37-
pub fn vortex_zigzag::ZigZag::nbuffers(_array: vortex_array::array::view::ArrayView<'_, Self>) -> usize
38-
39-
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>>
40-
41-
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>>>
42-
43-
pub fn vortex_zigzag::ZigZag::slot_name(_array: vortex_array::array::view::ArrayView<'_, Self>, idx: usize) -> alloc::string::String
44-
45-
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<()>
46-
47-
impl vortex_array::array::vtable::operations::OperationsVTable<vortex_zigzag::ZigZag> for vortex_zigzag::ZigZag
48-
49-
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>
50-
51-
impl vortex_array::array::vtable::validity::ValidityChild<vortex_zigzag::ZigZag> for vortex_zigzag::ZigZag
52-
53-
pub fn vortex_zigzag::ZigZag::validity_child(array: vortex_array::array::view::ArrayView<'_, vortex_zigzag::ZigZag>) -> vortex_array::array::erased::ArrayRef
54-
55-
impl vortex_array::arrays::dict::take::TakeExecute for vortex_zigzag::ZigZag
56-
57-
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>>
58-
59-
impl vortex_array::arrays::filter::kernel::FilterReduce for vortex_zigzag::ZigZag
60-
61-
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>>
62-
63-
impl vortex_array::arrays::slice::SliceReduce for vortex_zigzag::ZigZag
64-
65-
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>>
66-
67-
impl vortex_array::scalar_fn::fns::cast::kernel::CastReduce for vortex_zigzag::ZigZag
68-
69-
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>>
70-
71-
impl vortex_array::scalar_fn::fns::mask::kernel::MaskReduce for vortex_zigzag::ZigZag
72-
73-
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>>
74-
75-
pub struct vortex_zigzag::ZigZagData
76-
77-
impl vortex_zigzag::ZigZagData
78-
79-
pub fn vortex_zigzag::ZigZagData::new() -> Self
80-
81-
pub fn vortex_zigzag::ZigZagData::try_new(encoded_dtype: &vortex_array::dtype::DType) -> vortex_error::VortexResult<Self>
82-
83-
impl core::clone::Clone for vortex_zigzag::ZigZagData
84-
85-
pub fn vortex_zigzag::ZigZagData::clone(&self) -> vortex_zigzag::ZigZagData
9+
impl vortex_array::arrays::scalar_fn::plugin::ScalarFnArrayVTable for vortex_zigzag::ZigZag
8610

87-
impl core::default::Default for vortex_zigzag::ZigZagData
11+
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>>
8812

89-
pub fn vortex_zigzag::ZigZagData::default() -> Self
13+
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>>>
9014

91-
impl core::fmt::Debug for vortex_zigzag::ZigZagData
15+
impl vortex_array::scalar_fn::vtable::ScalarFnVTable for vortex_zigzag::ZigZag
9216

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

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

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

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

101-
pub fn vortex_zigzag::ZigZagData::array_eq(&self, _other: &Self, _precision: vortex_array::hash::Precision) -> bool
25+
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>
10226

103-
impl vortex_array::hash::ArrayHash for vortex_zigzag::ZigZagData
27+
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
10428

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

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

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

111-
pub fn vortex_zigzag::ZigZagArrayExt::ptype(&self) -> vortex_array::dtype::ptype::PType
35+
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>
11236

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

115-
pub fn T::encoded(&self) -> &vortex_array::array::erased::ArrayRef
39+
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>>
11640

117-
pub fn T::ptype(&self) -> vortex_array::dtype::ptype::PType
41+
pub fn vortex_zigzag::initialize(session: &vortex_session::VortexSession)
11842

11943
pub fn vortex_zigzag::zigzag_decode(parray: vortex_array::arrays::primitive::vtable::PrimitiveArray) -> vortex_array::arrays::primitive::vtable::PrimitiveArray
12044

121-
pub fn vortex_zigzag::zigzag_encode(parray: vortex_array::array::view::ArrayView<'_, vortex_array::arrays::primitive::vtable::Primitive>) -> vortex_error::VortexResult<vortex_zigzag::ZigZagArray>
45+
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>
12246

123-
pub type vortex_zigzag::ZigZagArray = vortex_array::array::typed::Array<vortex_zigzag::ZigZag>
47+
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)