Skip to content

Commit

Permalink
nit
Browse files Browse the repository at this point in the history
  • Loading branch information
jdcasale committed Apr 23, 2024
1 parent ebc52a0 commit e7a7ff4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
1 change: 0 additions & 1 deletion pyvortex/src/array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ use vortex_roaring::{
RoaringBoolEncoding, RoaringInt, RoaringIntArray, RoaringIntEncoding,
};


use crate::dtype::PyDType;
use crate::error::PyVortexError;
use crate::vortex_arrow;
Expand Down
10 changes: 6 additions & 4 deletions vortex-roaring/src/boolean/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,13 @@ impl_encoding!("vortex.roaring_bool", RoaringBool);

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct RoaringBoolMetadata {
// NB: this is stored because we want to avoid the overhead of deserializing the bitmap
// on every len() call. It's CRITICAL that this is kept up-to date.
length: usize,
}

impl RoaringBoolArray<'_> {
pub fn try_new(bitmap: Bitmap, length: usize) -> VortexResult<Self> {
if length > bitmap.cardinality() as usize {
vortex_bail!("RoaringBoolArray length is greater than bitmap cardinality")
if length < bitmap.cardinality() as usize {
vortex_bail!("RoaringBoolArray length is less than bitmap cardinality")
} else {
Ok(Self {
typed: TypedArray::try_from_parts(
Expand Down Expand Up @@ -64,6 +62,10 @@ impl RoaringBoolArray<'_> {
}
impl AcceptArrayVisitor for RoaringBoolArray<'_> {
fn accept(&self, _visitor: &mut dyn ArrayVisitor) -> VortexResult<()> {
// TODO(ngates): should we store a buffer in memory? Or delay serialization?
// Or serialize into metadata? The only reason we support buffers is so we can write to
// the wire without copying into FlatBuffers. But if we need to allocate to serialize
// the bitmap anyway, then may as well shove it into metadata.
todo!()
}
}
Expand Down
2 changes: 2 additions & 0 deletions vortex-roaring/src/integer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ impl_encoding!("vortex.roaring_int", RoaringInt);
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct RoaringIntMetadata {
ptype: PType,
// NB: this is stored because we want to avoid the overhead of deserializing the bitmap
// on every len() call. It's CRITICAL that this is kept up-to date.
length: usize,
}

Expand Down

0 comments on commit e7a7ff4

Please sign in to comment.