pub struct QueryProcessor { /* private fields */ }Expand description
The query processor executes a physical plan and produces result chunks.
Implementations§
Source§impl QueryProcessor
impl QueryProcessor
pub fn new() -> Self
Sourcepub fn with_registry(registry: Arc<Mutex<FunctionRegistry>>) -> Self
pub fn with_registry(registry: Arc<Mutex<FunctionRegistry>>) -> Self
Create a processor with access to the function registry.
Sourcepub fn with_catalog(
registry: Arc<Mutex<FunctionRegistry>>,
table_catalog: Arc<TableCatalog>,
vfs: Arc<VirtualFileSystemRegistry>,
) -> Self
pub fn with_catalog( registry: Arc<Mutex<FunctionRegistry>>, table_catalog: Arc<TableCatalog>, vfs: Arc<VirtualFileSystemRegistry>, ) -> Self
Create a processor with function registry, table catalog access, and VFS.
Sourcepub fn with_standalone_call_handler(
self,
handler: Arc<dyn StandaloneCallHandler>,
) -> Self
pub fn with_standalone_call_handler( self, handler: Arc<dyn StandaloneCallHandler>, ) -> Self
Set the sequence operation callback (for nextval/currval).
pub fn with_sequence_fn(self, f: SequenceFn) -> Self
Sourcepub fn with_subquery_fn(self, f: SubqueryFn) -> Self
pub fn with_subquery_fn(self, f: SubqueryFn) -> Self
Set the subquery operation callback.
Sourcepub fn with_schema_ddl_fn(self, f: SchemaDdlFn) -> Self
pub fn with_schema_ddl_fn(self, f: SchemaDdlFn) -> Self
Set the schema DDL callback (for CREATE/DROP SEQUENCE, EXPORT/IMPORT DATABASE).
Sourcepub fn with_snapshot(
self,
snapshot_ts: Option<u64>,
commit_history: HashMap<u64, u64>,
) -> Self
pub fn with_snapshot( self, snapshot_ts: Option<u64>, commit_history: HashMap<u64, u64>, ) -> Self
Set MVCC snapshot parameters for read isolation.
Sourcepub fn with_txn_id(self, txn_id: Option<u64>) -> Self
pub fn with_txn_id(self, txn_id: Option<u64>) -> Self
Set the active transaction id for write operators.
When Some(txn_id), insert/delete write operators use the MVCC-aware
*_with_txn storage variants so uncommitted rows are invisible to other
snapshots, and record undo entries for rollback (P52.18).
Sourcepub fn record_insert_undo(&self, table_id: u64, row_id: u64)
pub fn record_insert_undo(&self, table_id: u64, row_id: u64)
Record an insert undo (rollback deletes the row).
Sourcepub fn record_update_undo(
&self,
table_id: u64,
row_id: u64,
column: u32,
old_data: Vec<u8>,
)
pub fn record_update_undo( &self, table_id: u64, row_id: u64, column: u32, old_data: Vec<u8>, )
Record an update undo (rollback restores the cell).
Sourcepub fn record_delete_undo(&self, table_id: u64, row_id: u64, old_data: Vec<u8>)
pub fn record_delete_undo(&self, table_id: u64, row_id: u64, old_data: Vec<u8>)
Record a delete undo (rollback restores the row/edge).
Sourcepub fn take_undo_records(&self) -> Vec<UndoRecord>
pub fn take_undo_records(&self) -> Vec<UndoRecord>
Take the accumulated undo records (drained by the connection layer).
Sourcepub fn undo_sink(&self) -> Arc<Mutex<Vec<UndoRecord>>> ⓘ
pub fn undo_sink(&self) -> Arc<Mutex<Vec<UndoRecord>>> ⓘ
Shared undo sink handed to write operators so they can record undo entries during execution (P52.18).
Sourcepub fn wal_sink(&self) -> WalSink
pub fn wal_sink(&self) -> WalSink
Shared WAL sink handed to write operators so they can log typed Insert/Delete/Update records during execution (P60.2).
Sourcepub fn take_wal_records(&self) -> Vec<WALRecord>
pub fn take_wal_records(&self) -> Vec<WALRecord>
Take the accumulated typed WAL records (drained by the connection layer after execution; empty when nothing was logged).
Sourcepub fn execute(
&self,
operators: &[LogicalOperator],
) -> Result<Vec<DataChunk>, ProcessorError>
pub fn execute( &self, operators: &[LogicalOperator], ) -> Result<Vec<DataChunk>, ProcessorError>
Execute a sequence of logical operators by mapping them to physical operators.
pub fn execute_internal( &self, operators: &[LogicalOperator], ) -> Result<Vec<DataChunk>, ProcessorError>
Sourcepub fn take_written_rows(&self) -> Vec<(u64, u64)>
pub fn take_written_rows(&self) -> Vec<(u64, u64)>
Take the accumulated write set from the processor. Returns all (table_id, row_id) pairs written during the last execution.
Sourcepub fn evaluate_expression(
_expr: &Expression,
_chunk: &DataChunk,
) -> Result<ValueVector, ProcessorError>
pub fn evaluate_expression( _expr: &Expression, _chunk: &DataChunk, ) -> Result<ValueVector, ProcessorError>
Execute a single expression against a DataChunk and return a ValueVector of results.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for QueryProcessor
impl !RefUnwindSafe for QueryProcessor
impl !UnwindSafe for QueryProcessor
impl Send for QueryProcessor
impl Sync for QueryProcessor
impl Unpin for QueryProcessor
impl UnsafeUnpin for QueryProcessor
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more