pub enum RowRef {
Owned(Row),
Composite(CompositeRow),
DirectBuildComposite(DirectBuildCompositeRow),
}Expand description
A row reference that can be borrowed, owned, or composite.
This enum allows operators to return rows without always cloning:
Borrowed: Reference to an existing row (zero-copy)Owned: An owned row (when materialization is needed)Composite: Virtual row combining left and right join sides
§Performance
The key optimization is that Composite allows hash joins to
return combined rows without actually copying values from both sides.
Values are only copied when the final result is materialized.
Variants§
Owned(Row)
Owned row - the row data is owned by this RowRef.
Composite(CompositeRow)
Composite row - combines two rows without copying. Used by join operators to avoid materializing combined rows.
DirectBuildComposite(DirectBuildCompositeRow)
Direct build composite - combines owned probe row with Arc-referenced build rows. OPTIMIZATION: Avoids Arc allocation for probe row (saves 1 allocation per match). Used for hash joins where build rows are shared via Arc.
Implementations§
Source§impl RowRef
impl RowRef
Sourcepub fn composite(left: Row, right: Row) -> Self
pub fn composite(left: Row, right: Row) -> Self
Create a composite RowRef from left and right rows.
Sourcepub fn into_owned(self) -> Row
pub fn into_owned(self) -> Row
Convert to an owned Row.
For Owned, this is a no-op move.
For Composite and DirectBuildComposite, this materializes the combined row.
Sourcepub fn to_owned(&self) -> Row
pub fn to_owned(&self) -> Row
Clone to an owned Row.
Use into_owned() when possible to avoid cloning.
Sourcepub fn direct_build_composite(
probe: Row,
build_rows: CompactArc<Vec<Row>>,
build_idx: usize,
probe_is_left: bool,
) -> Self
pub fn direct_build_composite( probe: Row, build_rows: CompactArc<Vec<Row>>, build_idx: usize, probe_is_left: bool, ) -> Self
Create a direct-build composite RowRef.
OPTIMIZATION: Avoids Arc allocation for probe row. Use this for 1:1 joins where probe row is owned and not shared.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RowRef
impl RefUnwindSafe for RowRef
impl Send for RowRef
impl Sync for RowRef
impl Unpin for RowRef
impl UnwindSafe for RowRef
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> 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