pub trait ScanStorage<P>: Send + Sync{
// Required methods
fn table_id(&self) -> TableId;
fn field_data_type(&self, fid: LogicalFieldId) -> LlkvResult<DataType>;
fn total_rows(&self) -> LlkvResult<u64>;
fn all_row_ids(&self) -> LlkvResult<Treemap>;
fn prepare_gather_context(
&self,
logical_fields: &[LogicalFieldId],
) -> LlkvResult<MultiGatherContext>;
fn gather_row_window_with_context(
&self,
logical_fields: &[LogicalFieldId],
row_ids: &[u64],
null_policy: GatherNullPolicy,
ctx: Option<&mut MultiGatherContext>,
) -> LlkvResult<RecordBatch>;
fn filter_row_ids<'expr>(
&self,
filter_expr: &Expr<'expr, FieldId>,
) -> LlkvResult<Treemap>;
fn filter_leaf(&self, filter: &OwnedFilter) -> LlkvResult<Treemap>;
fn filter_fused(
&self,
field_id: FieldId,
filters: &[OwnedFilter],
cache: &PredicateFusionCache,
) -> LlkvResult<RowIdSource>;
fn sorted_row_ids_full_table(
&self,
order_spec: ScanOrderSpec,
) -> LlkvResult<Option<Vec<u64>>>;
fn stream_row_ids(
&self,
chunk_size: usize,
on_chunk: &mut dyn FnMut(&[RowId]) -> LlkvResult<()>,
) -> LlkvResult<()>;
fn as_any(&self) -> &dyn Any;
}Expand description
Capabilities the scan executor needs from storage.
Required Methods§
fn table_id(&self) -> TableId
fn field_data_type(&self, fid: LogicalFieldId) -> LlkvResult<DataType>
fn total_rows(&self) -> LlkvResult<u64>
fn all_row_ids(&self) -> LlkvResult<Treemap>
fn prepare_gather_context( &self, logical_fields: &[LogicalFieldId], ) -> LlkvResult<MultiGatherContext>
fn gather_row_window_with_context( &self, logical_fields: &[LogicalFieldId], row_ids: &[u64], null_policy: GatherNullPolicy, ctx: Option<&mut MultiGatherContext>, ) -> LlkvResult<RecordBatch>
fn filter_row_ids<'expr>( &self, filter_expr: &Expr<'expr, FieldId>, ) -> LlkvResult<Treemap>
Sourcefn filter_leaf(&self, filter: &OwnedFilter) -> LlkvResult<Treemap>
fn filter_leaf(&self, filter: &OwnedFilter) -> LlkvResult<Treemap>
Evaluate a leaf predicate (single column filter) against the storage.
Sourcefn filter_fused(
&self,
field_id: FieldId,
filters: &[OwnedFilter],
cache: &PredicateFusionCache,
) -> LlkvResult<RowIdSource>
fn filter_fused( &self, field_id: FieldId, filters: &[OwnedFilter], cache: &PredicateFusionCache, ) -> LlkvResult<RowIdSource>
Evaluate fused predicates against a single column.
Sourcefn sorted_row_ids_full_table(
&self,
order_spec: ScanOrderSpec,
) -> LlkvResult<Option<Vec<u64>>>
fn sorted_row_ids_full_table( &self, order_spec: ScanOrderSpec, ) -> LlkvResult<Option<Vec<u64>>>
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.