Skip to content

Commit 4433fcf

Browse files
authored
Array Serde (#2240)
* Add Array::serialize to write an array into a sequence of ByteBuffers. * Add Array::deserialize to decode an array from a byte buffer. * Use a single segment for a FlatLayout, instead of one per array buffer.
1 parent 19cc2c1 commit 4433fcf

File tree

25 files changed

+1115
-823
lines changed

25 files changed

+1115
-823
lines changed

vortex-array/src/data/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ impl Array {
8383
buffers: Vec<ByteBuffer>,
8484
) -> VortexResult<Self>
8585
where
86-
F: FnOnce(&[u8]) -> VortexResult<crate::flatbuffers::Array>,
86+
F: FnOnce(&[u8]) -> VortexResult<crate::flatbuffers::ArrayNode>,
8787
{
8888
let array = flatbuffer_init(flatbuffer.as_ref())?;
8989
let flatbuffer_loc = array._tab.loc();

vortex-array/src/data/viewed.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ impl Debug for ViewedArray {
3636
}
3737

3838
impl ViewedArray {
39-
pub fn flatbuffer(&self) -> fb::Array {
40-
unsafe { fb::Array::follow(self.flatbuffer.as_ref(), self.flatbuffer_loc) }
39+
pub fn flatbuffer(&self) -> fb::ArrayNode {
40+
unsafe { fb::ArrayNode::follow(self.flatbuffer.as_ref(), self.flatbuffer_loc) }
4141
}
4242

4343
// TODO(ngates): should we separate self and DType lifetimes? Should DType be cloned?
@@ -61,7 +61,7 @@ impl ViewedArray {
6161
})
6262
}
6363

64-
fn array_child(&self, idx: usize) -> Option<fb::Array> {
64+
fn array_child(&self, idx: usize) -> Option<fb::ArrayNode> {
6565
let children = self.flatbuffer().children()?;
6666
(idx < children.len()).then(|| children.get(idx))
6767
}

vortex-array/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ mod macros;
3838
mod metadata;
3939
pub mod nbytes;
4040
pub mod partial_ord;
41-
pub mod parts;
4241
pub mod patches;
42+
pub mod serde;
4343
pub mod stats;
4444
pub mod stream;
4545
#[cfg(feature = "test-harness")]

vortex-array/src/parts.rs

Lines changed: 0 additions & 175 deletions
This file was deleted.

0 commit comments

Comments
 (0)