pub enum ReadBatchParams {
Range(Range<usize>),
RangeFull,
RangeTo(RangeTo<usize>),
RangeFrom(RangeFrom<usize>),
Indices(UInt32Array),
}
Expand description
Defines a selection of rows to read from a file/batch
Variants§
Range(Range<usize>)
Select a contiguous range of rows
RangeFull
Select all rows (this is the default)
RangeTo(RangeTo<usize>)
Select all rows up to a given index
RangeFrom(RangeFrom<usize>)
Select all rows starting at a given index
Indices(UInt32Array)
Select scattered non-contiguous rows
Implementations§
Source§impl ReadBatchParams
impl ReadBatchParams
Sourcepub fn valid_given_len(&self, len: usize) -> bool
pub fn valid_given_len(&self, len: usize) -> bool
Validate that the selection is valid given the length of the batch
Sourcepub fn slice(&self, start: usize, length: usize) -> Result<Self>
pub fn slice(&self, start: usize, length: usize) -> Result<Self>
Slice the selection
For example, given ReadBatchParams::RangeFull and slice(10, 20), the output will be ReadBatchParams::Range(10..20)
Given ReadBatchParams::Range(10..20) and slice(5, 3), the output will be ReadBatchParams::Range(15..18)
Given ReadBatchParams::RangeTo(20) and slice(10, 5), the output will be ReadBatchParams::Range(10..15)
Given ReadBatchParams::RangeFrom(20) and slice(10, 5), the output will be ReadBatchParams::Range(30..35)
Given ReadBatchParams::Indices([1, 3, 5, 7, 9]) and slice(1, 3), the output will be ReadBatchParams::Indices([3, 5, 7])
You cannot slice beyond the bounds of the selection and an attempt to do so will return an error.
Sourcepub fn to_offsets(&self) -> Result<PrimitiveArray<UInt32Type>>
pub fn to_offsets(&self) -> Result<PrimitiveArray<UInt32Type>>
Convert a read range into a vector of row offsets
RangeFull and RangeFrom are unbounded and cannot be converted into row offsets and any attempt to do so will return an error. Call slice first
Trait Implementations§
Source§impl<T: ByteArrayType> AsyncIndex<ReadBatchParams> for BinaryDecoder<'_, T>
impl<T: ByteArrayType> AsyncIndex<ReadBatchParams> for BinaryDecoder<'_, T>
Source§impl AsyncIndex<ReadBatchParams> for DictionaryDecoder<'_>
impl AsyncIndex<ReadBatchParams> for DictionaryDecoder<'_>
Source§impl AsyncIndex<ReadBatchParams> for PlainDecoder<'_>
impl AsyncIndex<ReadBatchParams> for PlainDecoder<'_>
Source§impl Clone for ReadBatchParams
impl Clone for ReadBatchParams
Source§fn clone(&self) -> ReadBatchParams
fn clone(&self) -> ReadBatchParams
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for ReadBatchParams
impl Debug for ReadBatchParams
Source§impl Default for ReadBatchParams
impl Default for ReadBatchParams
Source§impl Display for ReadBatchParams
impl Display for ReadBatchParams
Source§impl From<&[u32]> for ReadBatchParams
impl From<&[u32]> for ReadBatchParams
Source§impl From<&ReadBatchParams> for ReadBatchParams
impl From<&ReadBatchParams> for ReadBatchParams
Source§impl From<PrimitiveArray<UInt32Type>> for ReadBatchParams
impl From<PrimitiveArray<UInt32Type>> for ReadBatchParams
Source§fn from(value: UInt32Array) -> Self
fn from(value: UInt32Array) -> Self
Source§impl From<RangeFull> for ReadBatchParams
impl From<RangeFull> for ReadBatchParams
Auto Trait Implementations§
impl Freeze for ReadBatchParams
impl RefUnwindSafe for ReadBatchParams
impl Send for ReadBatchParams
impl Sync for ReadBatchParams
impl Unpin for ReadBatchParams
impl UnwindSafe for ReadBatchParams
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more