pub struct PermutationIndex { /* private fields */ }Expand description
A sorted permutation index over a columnar dataset.
permutation[virtual_row] = physical row ID in the source.
Internal storage is either in-memory (UInt32Array) or memory-mapped
(temp file), chosen automatically based on row count and feature flags.
Implementations§
Source§impl PermutationIndex
impl PermutationIndex
Sourcepub fn natural(n: u64) -> Result<Self, IndexError>
pub fn natural(n: u64) -> Result<Self, IndexError>
Identity permutation — natural (unsorted) order: [0, 1, 2, ..., n-1].
§Errors
Returns IndexError::TooManyRows if n > u32::MAX.
Sourcepub fn read_range(&self, start: usize, end: usize) -> Vec<u32>
pub fn read_range(&self, start: usize, end: usize) -> Vec<u32>
Read row IDs for virtual range [start, end).
This is the primary access method — works for both in-memory and mmap.
Clamped to [0, len).
Sourcepub fn slice(&self, offset: usize, length: usize) -> Self
pub fn slice(&self, offset: usize, length: usize) -> Self
Slice the permutation to a subrange.
Returns a new in-memory PermutationIndex covering [offset..offset+length].
§Panics
Panics if offset + length > self.len().
Sourcepub fn to_physical_selection(
&self,
start: usize,
end: usize,
) -> (PhysicalSelection, Vec<u32>)
pub fn to_physical_selection( &self, start: usize, end: usize, ) -> (PhysicalSelection, Vec<u32>)
Convert a virtual row range to a physical selection for late materialisation.
Given virtual rows [start, end), returns the corresponding physical
row IDs as sorted, merged ranges suitable for Parquet RowSelection.
Also returns the virtual-order IDs (the raw read_range output) that
callers need for reordering materialised rows back to sort order.
§Returns
(physical_selection, virtual_ids) where:
physical_selectionhas ranges in ascending physical ordervirtual_ids[i]= physical row ID at virtual positionstart + i
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PermutationIndex
impl RefUnwindSafe for PermutationIndex
impl Send for PermutationIndex
impl Sync for PermutationIndex
impl Unpin for PermutationIndex
impl UnsafeUnpin for PermutationIndex
impl UnwindSafe for PermutationIndex
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> 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