Enum lance_io::ReadBatchParams

source ·
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

source

pub fn valid_given_len(&self, len: usize) -> bool

Validate that the selection is valid given the length of the batch

source

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.

source

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<'a, T: ByteArrayType> AsyncIndex<ReadBatchParams> for BinaryDecoder<'a, T>

§

type Output = Result<Arc<dyn Array>, Error>

source§

fn get<'life0, 'async_trait>( &'life0 self, params: ReadBatchParams, ) -> Pin<Box<dyn Future<Output = Self::Output> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

source§

impl<'a> AsyncIndex<ReadBatchParams> for DictionaryDecoder<'a>

§

type Output = Result<Arc<dyn Array>, Error>

source§

fn get<'life0, 'async_trait>( &'life0 self, params: ReadBatchParams, ) -> Pin<Box<dyn Future<Output = Self::Output> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

source§

impl AsyncIndex<ReadBatchParams> for PlainDecoder<'_>

§

type Output = Result<Arc<dyn Array>, Error>

source§

fn get<'life0, 'async_trait>( &'life0 self, params: ReadBatchParams, ) -> Pin<Box<dyn Future<Output = Self::Output> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

source§

impl Clone for ReadBatchParams

source§

fn clone(&self) -> ReadBatchParams

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ReadBatchParams

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for ReadBatchParams

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Display for ReadBatchParams

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<&[u32]> for ReadBatchParams

source§

fn from(value: &[u32]) -> Self

Converts to this type from the input type.
source§

impl From<&ReadBatchParams> for ReadBatchParams

source§

fn from(params: &Self) -> Self

Converts to this type from the input type.
source§

impl From<PrimitiveArray<UInt32Type>> for ReadBatchParams

source§

fn from(value: UInt32Array) -> Self

Converts to this type from the input type.
source§

impl From<Range<usize>> for ReadBatchParams

source§

fn from(r: Range<usize>) -> Self

Converts to this type from the input type.
source§

impl From<RangeFrom<usize>> for ReadBatchParams

source§

fn from(r: RangeFrom<usize>) -> Self

Converts to this type from the input type.
source§

impl From<RangeFull> for ReadBatchParams

source§

fn from(_: RangeFull) -> Self

Converts to this type from the input type.
source§

impl From<RangeTo<usize>> for ReadBatchParams

source§

fn from(r: RangeTo<usize>) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoEither for T

source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
source§

impl<T> Pointable for T

source§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,