RowRef

Enum RowRef 

Source
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

Source

pub fn owned(row: Row) -> Self

Create an owned RowRef from a Row.

Source

pub fn composite(left: Row, right: Row) -> Self

Create a composite RowRef from left and right rows.

Source

pub fn len(&self) -> usize

Get the number of columns in this row.

Source

pub fn is_empty(&self) -> bool

Check if this row is empty.

Source

pub fn get(&self, idx: usize) -> Option<&Value>

Get a value by index without cloning.

Source

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.

Source

pub fn to_owned(&self) -> Row

Clone to an owned Row.

Use into_owned() when possible to avoid cloning.

Source

pub fn as_row(&self) -> Option<&Row>

Get a reference to the underlying Row if this is Owned.

Source

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§

Source§

impl Debug for RowRef

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V