Skip to main content

RowRef

Enum RowRef 

Source
pub enum RowRef {
    Owned(Row),
    Composite(CompositeRow),
    DirectBuildComposite(DirectBuildCompositeRow),
    Shared(SharedRow),
    Projected(ProjectedRow),
    Deferred(DeferredRow),
}
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.

§

Shared(SharedRow)

One row in an immutable shared build batch.

This lets a projected JOIN output retain the build row by Arc + index instead of cloning every value from that row.

§

Projected(ProjectedRow)

Projected virtual row over an existing outer row and one joined row.

Unlike an owned projected Row, this keeps the selected slots virtual across subsequent JOIN edges. Values are copied only when the final result consumer requests an owned row.

§

Deferred(DeferredRow)

Deferred row carried through an internal QueryResult boundary.

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.

Source

pub fn shared(rows: CompactArc<Vec<Row>>, row_idx: usize) -> Self

Reference one row in an immutable shared batch.

Source

pub fn projected( left: RowRef, right: RowRef, columns: CompactArc<[ColumnSource]>, ) -> Self

Create a deferred projected row for a JOIN output.

Source

pub fn deferred(row: DeferredRow) -> Self

Restore a compact row received from an internal QueryResult boundary.

Source

pub fn into_deferred(self) -> DeferredRow

Convert into the portable representation used between recursive JOINs.

Source

pub fn is_deferred(&self) -> bool

Whether this row still carries a deferred JOIN representation.

Source

pub fn estimated_retained_bytes(&self) -> usize

Conservative size of the request-local row graph retained by this handle. Arc-backed immutable batches are owned and charged elsewhere; this method accounts only for the handle/graph added by a pull batch.

Trait Implementations§

Source§

impl Clone for RowRef

Source§

fn clone(&self) -> RowRef

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
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§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> CompactArcDrop for T

Source§

unsafe fn drop_and_dealloc(ptr: *mut u8)

Drop the contained data and deallocate the header+data allocation. 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> 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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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