pub struct QueryRow {
pub values: HashMap<String, Value>,
pub key: RowKey,
pub metadata: RowMetadata,
pub cell_metadata: Option<HashMap<String, CellWriteMetadata>>,
}Expand description
Individual row in query result
Fields§
§values: HashMap<String, Value>Column values mapped by column name
key: RowKeyOriginal row key
metadata: RowMetadataRow metadata
cell_metadata: Option<HashMap<String, CellWriteMetadata>>Per-cell write metadata (Issue #691).
Populated only when ProjectionFlags::include_cell_metadata is
true during query planning. None on the hot path — no allocation
is performed unless metadata is explicitly requested.
Map key = column name; value = write timestamp + optional expiration. Columns absent from this map either had no individual cell header in the SSTable (e.g. partition-key columns) or were not decoded under the current flag setting.
Implementations§
Source§impl QueryRow
impl QueryRow
Sourcepub fn with_values(key: RowKey, values: HashMap<String, Value>) -> Self
pub fn with_values(key: RowKey, values: HashMap<String, Value>) -> Self
Create a row with values
Sourcepub fn from_map(values: HashMap<String, Value>) -> Self
pub fn from_map(values: HashMap<String, Value>) -> Self
Create a row from a column name → value map, using a synthetic empty key.
Convenience constructor used by CLI utilities that do not track a raw partition key. The key is set to an empty byte vector.
Sourcepub fn column_names(&self) -> Vec<String>
pub fn column_names(&self) -> Vec<String>
Get all column names
Sourcepub fn metadata(&self) -> &RowMetadata
pub fn metadata(&self) -> &RowMetadata
Get row metadata
Sourcepub fn set_metadata(&mut self, metadata: RowMetadata)
pub fn set_metadata(&mut self, metadata: RowMetadata)
Set row metadata
Sourcepub fn set_cell_metadata(&mut self, map: HashMap<String, CellWriteMetadata>)
pub fn set_cell_metadata(&mut self, map: HashMap<String, CellWriteMetadata>)
Attach per-cell write metadata to this row.
Replaces any previously attached map. Intended to be called by the
scan/build path when ProjectionFlags::include_cell_metadata is set.
Sourcepub fn insert_cell_metadata(&mut self, column: String, meta: CellWriteMetadata)
pub fn insert_cell_metadata(&mut self, column: String, meta: CellWriteMetadata)
Insert a single column’s write metadata.
Initialises the map on first call; subsequent calls insert into the existing map. No-op when called on the hot path that never enables metadata (the caller guards on the flag).
Sourcepub fn get_cell_metadata(&self, column: &str) -> Option<&CellWriteMetadata>
pub fn get_cell_metadata(&self, column: &str) -> Option<&CellWriteMetadata>
Return the write metadata for column, if present.