Skip to main content

QueryNode

Trait QueryNode 

Source
pub trait QueryNode: Send + Sync {
    // Required methods
    fn initialize<'a>(
        &mut self,
        rx: &mut Transaction<'a>,
        ctx: &QueryContext,
    ) -> Result<()>;
    fn next<'a>(
        &mut self,
        rx: &mut Transaction<'a>,
        ctx: &mut QueryContext,
    ) -> Result<Option<Columns>>;
    fn headers(&self) -> Option<ColumnHeaders>;

    // Provided methods
    fn next_lazy<'a>(
        &mut self,
        _rx: &mut Transaction<'a>,
        _ctx: &mut QueryContext,
    ) -> Result<Option<LazyBatch>> { ... }
    fn set_scan_limit(&mut self, _limit: usize) { ... }
}
Expand description

Unified trait for query execution nodes following the volcano iterator pattern

Required Methods§

Source

fn initialize<'a>( &mut self, rx: &mut Transaction<'a>, ctx: &QueryContext, ) -> Result<()>

Initialize the operator with execution context Called once before iteration begins

Source

fn next<'a>( &mut self, rx: &mut Transaction<'a>, ctx: &mut QueryContext, ) -> Result<Option<Columns>>

Get the next batch of results (volcano iterator pattern) Returns None when exhausted

Source

fn headers(&self) -> Option<ColumnHeaders>

Get the headers of columns this node produces

Provided Methods§

Source

fn next_lazy<'a>( &mut self, _rx: &mut Transaction<'a>, _ctx: &mut QueryContext, ) -> Result<Option<LazyBatch>>

Get the next batch as a LazyBatch for deferred materialization Returns None if this node doesn’t support lazy evaluation or is exhausted Default implementation returns None (falls back to materialized evaluation)

Source

fn set_scan_limit(&mut self, _limit: usize)

Hint the maximum number of rows this scan needs to produce. Scan operators override this to cap their batch size. Non-scan operators ignore it (default no-op).

Trait Implementations§

Source§

impl QueryNode for Box<dyn QueryNode>

Source§

fn initialize<'a>( &mut self, rx: &mut Transaction<'a>, ctx: &QueryContext, ) -> Result<()>

Initialize the operator with execution context Called once before iteration begins
Source§

fn next<'a>( &mut self, rx: &mut Transaction<'a>, ctx: &mut QueryContext, ) -> Result<Option<Columns>>

Get the next batch of results (volcano iterator pattern) Returns None when exhausted
Source§

fn next_lazy<'a>( &mut self, rx: &mut Transaction<'a>, ctx: &mut QueryContext, ) -> Result<Option<LazyBatch>>

Get the next batch as a LazyBatch for deferred materialization Returns None if this node doesn’t support lazy evaluation or is exhausted Default implementation returns None (falls back to materialized evaluation)
Source§

fn headers(&self) -> Option<ColumnHeaders>

Get the headers of columns this node produces
Source§

fn set_scan_limit(&mut self, limit: usize)

Hint the maximum number of rows this scan needs to produce. Scan operators override this to cap their batch size. Non-scan operators ignore it (default no-op).

Implementations on Foreign Types§

Source§

impl QueryNode for Box<dyn QueryNode>

Source§

fn initialize<'a>( &mut self, rx: &mut Transaction<'a>, ctx: &QueryContext, ) -> Result<()>

Source§

fn next<'a>( &mut self, rx: &mut Transaction<'a>, ctx: &mut QueryContext, ) -> Result<Option<Columns>>

Source§

fn next_lazy<'a>( &mut self, rx: &mut Transaction<'a>, ctx: &mut QueryContext, ) -> Result<Option<LazyBatch>>

Source§

fn headers(&self) -> Option<ColumnHeaders>

Source§

fn set_scan_limit(&mut self, limit: usize)

Implementors§