pub trait TableVirtualUserIterator: Send + 'static {
// Required methods
fn columns(&self) -> Vec<TableVirtualUserColumnDef>;
fn initialize(
&mut self,
ctx: Option<&TableVirtualUserPushdownContext>,
) -> Result<()>;
fn next_batch(
&mut self,
batch_size: usize,
) -> Result<Option<Vec<Vec<Value>>>>;
}Expand description
Advanced trait for streaming virtual table implementations.
Implement this trait when your virtual table needs to:
- Stream large datasets in batches
- Take advantage of pushdown optimizations (limit, filters)
§Thread Safety
Unlike TableVirtualUser, implementations of this trait are instantiated
fresh for each query. The factory creates a new instance per query execution.
Required Methods§
Sourcefn columns(&self) -> Vec<TableVirtualUserColumnDef>
fn columns(&self) -> Vec<TableVirtualUserColumnDef>
Return the column definitions for this table.
Sourcefn initialize(
&mut self,
ctx: Option<&TableVirtualUserPushdownContext>,
) -> Result<()>
fn initialize( &mut self, ctx: Option<&TableVirtualUserPushdownContext>, ) -> Result<()>
Initialize the iterator with optional pushdown context.
Called once before iteration begins. Use the pushdown context to optimize data generation (e.g., limit the number of rows fetched).