Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: rework LayoutBatchStream for legibility #1245

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bench-vortex/benches/compress_noci.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ fn vortex_decompress_read(runtime: &Runtime, buf: Arc<Vec<u8>>) -> VortexResult<
);

let stream = builder.build().await?;
let dtype = stream.schema().clone().into();
let dtype = stream.dtype().clone();
let vecs: Vec<Array> = stream.try_collect().await?;

ChunkedArray::try_new(vecs, dtype).map(|e| e.into())
Expand Down
11 changes: 8 additions & 3 deletions vortex-serde/src/layouts/read/mask.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,12 @@ impl RowMask {
Ok(Self { values, begin, end })
}

/// Construct a RowMask from given bitmap and begin
/// Construct a RowMask which is valid in the given range.
pub fn new_valid_between(begin: usize, end: usize) -> Self {
unsafe { RowMask::new_unchecked(Bitmap::from_range(0..(end - begin) as u32), begin, end) }
}

/// Construct a RowMask from given bitmap and begin.
///
/// # Safety
///
Expand Down Expand Up @@ -158,12 +163,12 @@ impl RowMask {
return Ok(Some(sliced.clone()));
}

let predicate = self.to_predicate_array()?;
let predicate = self.to_array()?;

filter(sliced, predicate).map(Some)
}

pub fn to_predicate_array(&self) -> VortexResult<Array> {
pub fn to_array(&self) -> VortexResult<Array> {
let bitset = self
.values
.to_bitset()
Expand Down
2 changes: 1 addition & 1 deletion vortex-serde/src/layouts/read/recordbatchreader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ where
stream: LayoutBatchStream<R>,
runtime: &'a AR,
) -> VortexResult<VortexRecordBatchReader<'a, R, AR>> {
let arrow_schema = Arc::new(infer_schema(stream.schema().dtype())?);
let arrow_schema = Arc::new(infer_schema(stream.dtype())?);
Ok(VortexRecordBatchReader {
stream,
arrow_schema,
Expand Down
Loading
Loading