Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
robert3005 committed Mar 22, 2024
1 parent 90780d8 commit b1f99bc
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 11 deletions.
2 changes: 1 addition & 1 deletion vortex-array/src/array/primitive/serde.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ impl ArraySerde for PrimitiveArray {
impl EncodingSerde for PrimitiveEncoding {
fn read(&self, ctx: &mut ReadCtx) -> VortexResult<ArrayRef> {
let ptype = ctx.ptype()?;
let validity = ctx.read_optional_array()?;
let validity = ctx.validity().read_optional_array()?;
let (_, buf) = ctx.read_buffer(|len| len * ptype.byte_width())?;
Ok(PrimitiveArray::new(ptype, buf, validity).into_array())
}
Expand Down
2 changes: 1 addition & 1 deletion vortex-array/src/array/varbin/serde.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ impl ArraySerde for VarBinArray {

impl EncodingSerde for VarBinEncoding {
fn read(&self, ctx: &mut ReadCtx) -> VortexResult<ArrayRef> {
let validity = ctx.read_optional_array()?;
let validity = ctx.validity().read_optional_array()?;
// TODO(robert): Stop writing this
let offsets_dtype = ctx.dtype()?;
let offsets = ctx.with_schema(&offsets_dtype).read()?;
Expand Down
2 changes: 1 addition & 1 deletion vortex-datetime/src/serde.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ impl EncodingSerde for DateTimeEncoding {
ctx.read()?,
ctx.read()?,
ctx.read()?,
ctx.read_optional_array()?,
ctx.validity().read_optional_array()?,
ctx.schema().clone(),
)
.into_array())
Expand Down
17 changes: 10 additions & 7 deletions vortex-fastlanes/src/bitpacking/serde.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,26 @@ impl ArraySerde for BitPackedArray {
ctx.write_optional_array(self.validity())?;
ctx.write_optional_array(self.patches())?;
ctx.write_usize(self.bit_width())?;
ctx.dtype(self.dtype())?;
ctx.write_usize(self.len())
}
}

impl EncodingSerde for BitPackedEncoding {
fn read(&self, ctx: &mut ReadCtx) -> VortexResult<ArrayRef> {
let encoded = ctx.bytes().read()?;
let validity = ctx.read_optional_array()?;
let validity = ctx.validity().read_optional_array()?;
let patches = ctx.read_optional_array()?;
let bit_width = ctx.read_usize()?;
let dtype = ctx.dtype()?;
let len = ctx.read_usize()?;
Ok(
BitPackedArray::try_new(encoded, validity, patches, bit_width, dtype, len)
.unwrap()
.into_array(),
Ok(BitPackedArray::try_new(
encoded,
validity,
patches,
bit_width,
ctx.schema().clone(),
len,
)
.unwrap()
.into_array())
}
}
2 changes: 1 addition & 1 deletion vortex-ree/src/serde.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ impl ArraySerde for REEArray {
impl EncodingSerde for REEEncoding {
fn read(&self, ctx: &mut ReadCtx) -> VortexResult<ArrayRef> {
let len = ctx.read_usize()?;
let validity = ctx.read_optional_array()?;
let validity = ctx.validity().read_optional_array()?;
let ends_dtype = ctx.dtype()?;
let ends = ctx.with_schema(&ends_dtype).read()?;
let values = ctx.read()?;
Expand Down

0 comments on commit b1f99bc

Please sign in to comment.