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
Sourcepub fn new(node: FlowNodeId) -> Self
pub fn new(node: FlowNodeId) -> Self
Create a new RowNumberProvider for the given operator
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
Sourcepub fn get_or_create_row_number(
&self,
ctx: &mut OperatorContext,
key: &EncodedKey,
) -> Result<(RowNumber, bool)>
pub fn get_or_create_row_number( &self, ctx: &mut OperatorContext, key: &EncodedKey, ) -> Result<(RowNumber, bool)>
Get or create a RowNumber for a given key Returns (RowNumber, is_new) where is_new indicates if it was newly created
Sourcepub fn remove_by_prefix(
&self,
ctx: &mut OperatorContext,
key_prefix: &[u8],
) -> Result<()>
pub fn remove_by_prefix( &self, ctx: &mut OperatorContext, key_prefix: &[u8], ) -> Result<()>
Remove all row number mappings with the given prefix This is useful for cleaning up all join results from a specific left row
Auto Trait Implementations§
impl Freeze for RowNumberProvider
impl RefUnwindSafe for RowNumberProvider
impl Send for RowNumberProvider
impl Sync for RowNumberProvider
impl Unpin 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