pub struct CompositeRow { /* private fields */ }Expand description
A composite row that references values from two source rows.
This is the key optimization for joins - instead of cloning all values from both the left and right rows into a new row, we keep references to both and provide a unified view.
§Memory Layout
CompositeRow
├── left: Row (owned)
├── right: Row (owned)
└── left_cols: usize
Logical columns: [left_col_0, left_col_1, ..., right_col_0, right_col_1, ...]
|<--- left_cols --->|<--- right cols --->|Implementations§
Source§impl CompositeRow
impl CompositeRow
Sourcepub fn new(left: Row, right: Row) -> Self
pub fn new(left: Row, right: Row) -> Self
Create a new composite row from left and right parts.
Sourcepub fn get(&self, idx: usize) -> Option<&Value>
pub fn get(&self, idx: usize) -> Option<&Value>
Get a value by index without cloning.
Indexes 0..left_cols return from the left row. Indexes left_cols..total return from the right row.
Sourcepub fn materialize(&self) -> Row
pub fn materialize(&self) -> Row
Materialize into an owned Row (cloning version).
This creates a single Row by copying all values from both sides.
Only call this when the final result needs to be stored.
Prefer materialize_owned() when you can consume the CompositeRow.
Sourcepub fn materialize_owned(self) -> Row
pub fn materialize_owned(self) -> Row
Materialize into an owned Row by moving values (zero-copy).
This consumes the CompositeRow and moves all values without cloning.
Use this instead of materialize() when you no longer need the CompositeRow.
Sourcepub fn into_parts(self) -> (Row, Row)
pub fn into_parts(self) -> (Row, Row)
Decompose into the left and right rows.
Trait Implementations§
Source§impl Clone for CompositeRow
impl Clone for CompositeRow
Source§fn clone(&self) -> CompositeRow
fn clone(&self) -> CompositeRow
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more