pub struct Row { /* private fields */ }Expand description
A row of values.
Rows are the unit of data flowing through execution operators. Each row contains values that correspond to the schema columns.
Implementations§
Source§impl Row
impl Row
Sourcepub fn new(schema: Arc<Schema>, values: Vec<Value>) -> Self
pub fn new(schema: Arc<Schema>, values: Vec<Value>) -> Self
Creates a new row with the given schema and values.
§Panics
Panics if the number of values doesn’t match the schema.
Sourcepub fn single(name: impl Into<String>, value: Value) -> Self
pub fn single(name: impl Into<String>, value: Value) -> Self
Creates a row with a single value.
Sourcepub fn schema_arc(&self) -> Arc<Schema>
pub fn schema_arc(&self) -> Arc<Schema>
Returns the shared schema reference.
Sourcepub fn get_by_name(&self, name: &str) -> Option<&Value>
pub fn get_by_name(&self, name: &str) -> Option<&Value>
Gets a value by column name.
Sourcepub fn get_mut(&mut self, index: usize) -> Option<&mut Value>
pub fn get_mut(&mut self, index: usize) -> Option<&mut Value>
Gets a mutable value by column index.
Sourcepub fn set(&mut self, index: usize, value: Value) -> Option<Value>
pub fn set(&mut self, index: usize, value: Value) -> Option<Value>
Sets a value by column index.
Returns the old value if the index was valid.
Sourcepub fn project(&self, indices: &[usize]) -> Self
pub fn project(&self, indices: &[usize]) -> Self
Creates a new row by projecting to specific column indices.
Sourcepub fn merge_consume_left(self, other: &Row) -> Self
pub fn merge_consume_left(self, other: &Row) -> Self
Consumes self and merges with another row’s values (borrowed).
More efficient than merge when the left row can be consumed.
Sourcepub fn merge_consume_both(self, other: Row) -> Self
pub fn merge_consume_both(self, other: Row) -> Self
Consumes both rows and merges them. Most efficient merge operation when both rows can be consumed.
Sourcepub fn into_values(self) -> Vec<Value>
pub fn into_values(self) -> Vec<Value>
Consumes the row and returns the values.