pub struct RowNumberProvider { /* private fields */ }Expand description
Provides stable row numbers for keys with automatic Insert/Update detection
This component maintains:
- A sequential counter for generating new row numbers
- A mapping from keys to their assigned row numbers
When a key is seen for the first time, it gets a new row number and returns true. When a key is seen again, it returns the existing row number and false.
Implementations§
Source§impl RowNumberProvider
impl RowNumberProvider
pub fn new(node: FlowNodeId) -> Self
Sourcepub fn get_or_create_row_numbers_batch<'a, I>(
&self,
ctx: &mut OperatorContext,
keys: I,
) -> Result<Vec<(RowNumber, bool)>>where
I: IntoIterator<Item = &'a EncodedKey>,
pub fn get_or_create_row_numbers_batch<'a, I>(
&self,
ctx: &mut OperatorContext,
keys: I,
) -> Result<Vec<(RowNumber, bool)>>where
I: IntoIterator<Item = &'a EncodedKey>,
Get or create RowNumbers for a batch of keys Returns Vec<(RowNumber, is_new)> in the same order as input keys where is_new indicates if the row number was newly created
pub fn get_or_create_row_number( &self, ctx: &mut OperatorContext, key: &EncodedKey, ) -> Result<(RowNumber, bool)>
pub fn remove_by_prefix( &self, ctx: &mut OperatorContext, key_prefix: &[u8], ) -> Result<()>
Auto Trait Implementations§
impl Freeze for RowNumberProvider
impl RefUnwindSafe for RowNumberProvider
impl Send for RowNumberProvider
impl Sync for RowNumberProvider
impl Unpin for RowNumberProvider
impl UnsafeUnpin for RowNumberProvider
impl UnwindSafe for RowNumberProvider
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
Mutably borrows from an owned value. Read more
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>
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 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>
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