pub struct DataRowCursor { /* private fields */ }sea-ql only.Expand description
A cursor that emits dynamically-typed DataRows decoded from
RowBinaryWithNamesAndTypes.
Obtain one via crate::query::Query::fetch_rows.
Implementations§
Source§impl DataRowCursor
impl DataRowCursor
Sourcepub fn columns(&self) -> Option<&[Arc<str>]>
pub fn columns(&self) -> Option<&[Arc<str>]>
Returns column names after the header has been read (i.e., after the
first next call returns).
Sourcepub fn received_bytes(&self) -> u64
pub fn received_bytes(&self) -> u64
Returns the total size in bytes received from the CH server since the cursor was created.
This counts only the payload size (no HTTP headers).
Sourcepub fn decoded_bytes(&self) -> u64
pub fn decoded_bytes(&self) -> u64
Returns the total size in bytes decompressed since the cursor was created.
Sourcepub async fn next(&mut self) -> Result<Option<DataRow>>
pub async fn next(&mut self) -> Result<Option<DataRow>>
Emits the next row.
Returns Ok(None) when all rows have been consumed.
The result is unspecified if called after an Err is returned.
§Cancel safety
This method is cancellation safe.
Sourcepub async fn next_batch(&mut self, max_rows: usize) -> Result<Option<RowBatch>>
pub async fn next_batch(&mut self, max_rows: usize) -> Result<Option<RowBatch>>
Reads up to max_rows rows and returns them as a column-oriented RowBatch.
Returns Ok(None) when all rows have been consumed.
The result is unspecified if called after an Err is returned.
Sourcepub async fn next_arrow_batch(
&mut self,
max_rows: usize,
) -> Result<Option<RecordBatch>>
Available on crate feature arrow only.
pub async fn next_arrow_batch( &mut self, max_rows: usize, ) -> Result<Option<RecordBatch>>
arrow only.Reads up to max_rows rows and returns them as an Arrow RecordBatch.
The schema is derived from the RowBinaryWithNamesAndTypes header using
crate::arrow::schema::from_columns and is available on the returned
batch via [RecordBatch::schema].
Returns Ok(None) when all rows have been consumed.
The result is unspecified if called after an Err is returned.