Struct light_snowflake_connector::Partition
source · pub struct Partition { /* private fields */ }
Expand description
A single in-memory chunk of a query response
Most partitions are in the single digits of megabytes, so clones are not too expensive, but still should be avoided if possible.
The data returned from Snowflake is a list of lists of strings, so there
are many type conversions involved, see Cell
for more
Implementations§
source§impl Partition
impl Partition
sourcepub fn num_rows(&self) -> usize
pub fn num_rows(&self) -> usize
Get the number of rows in just this partition This is obtained from data.len() rather than the metadata because this partition may have been constructed by concatenating
sourcepub fn raw_cells(&self) -> &[Vec<Option<String>>]
pub fn raw_cells(&self) -> &[Vec<Option<String>>]
Get the cells in this partition as strings just as they were returned from Snowflake
This could be more efficient for some use cases than converting to Cell
s
but without the type information it could be difficult to work with
sourcepub fn cells(&self) -> Vec<Vec<Cell>>
pub fn cells(&self) -> Vec<Vec<Cell>>
Convert the response into Cell
s in a list of lists format
This most closely matches the format of the response from Snowflake
sourcepub fn json_table(&self) -> Vec<Vec<Value>>
pub fn json_table(&self) -> Vec<Vec<Value>>
Convert the response into serde_json::Value
s in a list of lists format
sourcepub fn json_objects(&self) -> Vec<Value>
pub fn json_objects(&self) -> Vec<Value>
Convert the response into serde_json::Value
s in a list of objects format