pub trait ScanStorage<P>: Send + Sync{
// Required methods
fn table_id(&self) -> u16;
fn field_data_type(&self, fid: LogicalFieldId) -> Result<DataType, Error>;
fn total_rows(&self) -> Result<u64, Error>;
fn all_row_ids(&self) -> Result<Treemap, Error>;
fn prepare_gather_context(
&self,
logical_fields: &[LogicalFieldId],
) -> Result<MultiGatherContext, Error>;
fn gather_row_window_with_context(
&self,
logical_fields: &[LogicalFieldId],
row_ids: &[u64],
null_policy: GatherNullPolicy,
ctx: Option<&mut MultiGatherContext>,
) -> Result<RecordBatch, Error>;
fn filter_row_ids<'expr>(
&self,
filter_expr: &Expr<'expr, u32>,
) -> Result<Treemap, Error>;
fn filter_leaf(&self, filter: &OwnedFilter) -> Result<Treemap, Error>;
fn filter_fused(
&self,
field_id: u32,
filters: &[OwnedFilter],
cache: &PredicateFusionCache,
) -> Result<RowIdSource, Error>;
fn sorted_row_ids_full_table(
&self,
order_spec: ScanOrderSpec,
) -> Result<Option<Vec<u64>>, Error>;
fn stream_row_ids(
&self,
chunk_size: usize,
on_chunk: &mut dyn FnMut(&[u64]) -> Result<(), Error>,
) -> Result<(), Error>;
fn as_any(&self) -> &(dyn Any + 'static);
}Expand description
Capabilities the scan executor needs from storage.
Required Methods§
fn table_id(&self) -> u16
fn field_data_type(&self, fid: LogicalFieldId) -> Result<DataType, Error>
fn total_rows(&self) -> Result<u64, Error>
fn all_row_ids(&self) -> Result<Treemap, Error>
fn prepare_gather_context( &self, logical_fields: &[LogicalFieldId], ) -> Result<MultiGatherContext, Error>
fn gather_row_window_with_context( &self, logical_fields: &[LogicalFieldId], row_ids: &[u64], null_policy: GatherNullPolicy, ctx: Option<&mut MultiGatherContext>, ) -> Result<RecordBatch, Error>
fn filter_row_ids<'expr>( &self, filter_expr: &Expr<'expr, u32>, ) -> Result<Treemap, Error>
Sourcefn filter_leaf(&self, filter: &OwnedFilter) -> Result<Treemap, Error>
fn filter_leaf(&self, filter: &OwnedFilter) -> Result<Treemap, Error>
Evaluate a leaf predicate (single column filter) against the storage.
Sourcefn filter_fused(
&self,
field_id: u32,
filters: &[OwnedFilter],
cache: &PredicateFusionCache,
) -> Result<RowIdSource, Error>
fn filter_fused( &self, field_id: u32, filters: &[OwnedFilter], cache: &PredicateFusionCache, ) -> Result<RowIdSource, Error>
Evaluate fused predicates against a single column.
Sourcefn sorted_row_ids_full_table(
&self,
order_spec: ScanOrderSpec,
) -> Result<Option<Vec<u64>>, Error>
fn sorted_row_ids_full_table( &self, order_spec: ScanOrderSpec, ) -> Result<Option<Vec<u64>>, Error>
Optionally return row IDs ordered by a column’s sorted permutation when the caller is scanning the entire table without additional filtering.
Implementations should return Ok(None) when the storage backend cannot
satisfy the request for the given ScanOrderSpec.
fn stream_row_ids( &self, chunk_size: usize, on_chunk: &mut dyn FnMut(&[u64]) -> Result<(), Error>, ) -> Result<(), Error>
fn as_any(&self) -> &(dyn Any + 'static)
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".