pub struct KeyAligner { /* private fields */ }Expand description
Decodes opaque lookup keys and realigns fetched rows to the input key order.
Implementations§
Source§impl KeyAligner
impl KeyAligner
Sourcepub fn new(
pk_sort_fields: Vec<SortField>,
pk_columns: Vec<String>,
) -> Result<Self, LookupError>
pub fn new( pk_sort_fields: Vec<SortField>, pk_columns: Vec<String>, ) -> Result<Self, LookupError>
Build an aligner from the primary-key sort fields and column names (same order).
§Errors
Returns LookupError::Internal if the key is empty or the converter
cannot be built for the given sort fields.
Sourcepub fn pk_columns(&self) -> &[String]
pub fn pk_columns(&self) -> &[String]
The primary-key column names, in key order.
Sourcepub fn decode_keys(&self, keys: &[&[u8]]) -> Result<Vec<ArrayRef>, LookupError>
pub fn decode_keys(&self, keys: &[&[u8]]) -> Result<Vec<ArrayRef>, LookupError>
Decode opaque key bytes into the primary-key columns (column-major: one
array per PK column, each keys.len() long) for building a source
filter.
§Errors
Returns LookupError::Internal if the bytes cannot be decoded.
Sourcepub fn align(
&self,
keys: &[&[u8]],
fetched: &[RecordBatch],
) -> Result<Vec<Option<RecordBatch>>, LookupError>
pub fn align( &self, keys: &[&[u8]], fetched: &[RecordBatch], ) -> Result<Vec<Option<RecordBatch>>, LookupError>
Realign fetched rows to the input key order. Each fetched row is matched
to its key by re-encoding its PK columns; the first row wins per key,
duplicate input keys each resolve to their own single-row slice, and
misses are None.
§Errors
Returns LookupError::Internal if a PK column is absent from a fetched
batch or cannot be re-encoded.
Auto Trait Implementations§
impl Freeze for KeyAligner
impl RefUnwindSafe for KeyAligner
impl Send for KeyAligner
impl Sync for KeyAligner
impl Unpin for KeyAligner
impl UnsafeUnpin for KeyAligner
impl UnwindSafe for KeyAligner
Blanket Implementations§
impl<T> Allocation for T
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].