pub struct LateralJoin<'a> { /* private fields */ }Expand description
Streaming physical implementation of a SQL LATERAL join.
The left child is pulled in batches. The correlated right relation is evaluated once per left row, and produced rows are drained in bounded output batches instead of materialising the complete join result.
Implementations§
Source§impl<'a> LateralJoin<'a>
impl<'a> LateralJoin<'a>
pub fn new( left: Box<dyn PhysicalOperator + 'a>, source: Box<dyn LateralSource<'a> + 'a>, kind: JoinKind, left_nulls: ResultRow, right_nulls: ResultRow, ) -> Self
pub fn new_with_right_schema( left: Box<dyn PhysicalOperator + 'a>, source: Box<dyn LateralSource<'a> + 'a>, kind: JoinKind, left_nulls: ResultRow, right_nulls: ResultRow, right_schema: RowSchema, ) -> Self
pub fn with_right_schema_with_control( left: Box<dyn PhysicalOperator + 'a>, source: Box<dyn LateralSource<'a> + 'a>, kind: JoinKind, left_nulls: ResultRow, right_nulls: ResultRow, right_schema: RowSchema, control: &ProductionControl<'_>, ) -> Result<Self, SQLError>
pub fn into_boxed( self, control: &ProductionControl<'_>, ) -> Result<Box<Self>, SQLError>
Trait Implementations§
Source§impl PhysicalOperator for LateralJoin<'_>
impl PhysicalOperator for LateralJoin<'_>
Source§fn row_schema(&self) -> &RowSchema
fn row_schema(&self) -> &RowSchema
Complete logical-to-physical row layout emitted by this operator. Every
Batch returned by Self::next must carry this exact schema; operators must reject a child that violates that invariant.fn open(&mut self) -> ExecResult<()>
fn next(&mut self) -> ExecResult<Option<Batch>>
Source§fn next_with_demand(&mut self, rows: NonZeroUsize) -> ExecResult<Option<Batch>>
fn next_with_demand(&mut self, rows: NonZeroUsize) -> ExecResult<Option<Batch>>
Pull at most
rows newly evaluated output rows. Pipelined expression producers must propagate demand before evaluating their inputs. A semantic materialization boundary may return a larger already-evaluated batch; its consumer retains that remainder without evaluating it again. The default preserves that materialized-batch contract, so an effectful streaming adapter must override this method.fn close(&mut self) -> ExecResult<()>
Source§fn estimated_cardinality(&self) -> Option<u64>
fn estimated_cardinality(&self) -> Option<u64>
Planner/runtime cardinality estimate for choosing physical strategies.
None means the operator cannot provide a useful estimate. The value
is advisory rather than a correctness bound.Source§fn output_ordering(&self) -> &[PhysicalOrder]
fn output_ordering(&self) -> &[PhysicalOrder]
Leading output ordering known to be preserved by this operator.
Source§fn consume_into_aggregate(
&mut self,
_executor: &mut dyn AggregateExecutor,
) -> ExecResult<bool>
fn consume_into_aggregate( &mut self, _executor: &mut dyn AggregateExecutor, ) -> ExecResult<bool>
Let a leaf consume its native projected rows directly into an
aggregate executor. Returning
false promises that no input was
consumed, so the caller can fall back to ordinary Batch pulls.Source§fn collect_materialized(
&mut self,
_sink: &mut MaterializedResultSink<'_>,
) -> ExecResult<bool>
fn collect_materialized( &mut self, _sink: &mut MaterializedResultSink<'_>, ) -> ExecResult<bool>
Fill a native public result from borrowed source values after opening the pipeline. Only complete, effect-free projection chains may forward this request.
false guarantees that no row was consumed; the caller retains ordinary pulls and always closes the pipeline.Source§fn backward_scan_support(&self) -> BackwardScanSupport
fn backward_scan_support(&self) -> BackwardScanSupport
Describe backwards-scan support without changing the operator tree. The default is deliberately conservative so a scrollable cursor freezes the complete output of unclassified plans.
Source§fn supports_batched_consumption(&self) -> bool
fn supports_batched_consumption(&self) -> bool
Whether a complete, effect-free consumer may use native batches without changing SQL expression, side-effect or first-error order relative to singleton demand. Unclassified pipelines retain singleton demand. A producer with additional per-row evaluation above its child must establish that ordering independently; row order alone is insufficient.
Source§fn next_direction(
&mut self,
direction: PhysicalScanDirection,
) -> ExecResult<Option<Batch>>
fn next_direction( &mut self, direction: PhysicalScanDirection, ) -> ExecResult<Option<Batch>>
Pull one directional batch. Native backwards-capable pipelines keep batches to one row so a consumer can reverse direction between adjacent fetches.
Source§fn rewind(&mut self) -> ExecResult<()>
fn rewind(&mut self) -> ExecResult<()>
Rewind a native backwards-capable pipeline without recomputing rows held by semantic materialization boundaries.
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for LateralJoin<'a>
impl<'a> !Sync for LateralJoin<'a>
impl<'a> !UnwindSafe for LateralJoin<'a>
impl<'a> Freeze for LateralJoin<'a>
impl<'a> Send for LateralJoin<'a>
impl<'a> Unpin for LateralJoin<'a>
impl<'a> UnsafeUnpin for LateralJoin<'a>
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
Mutably borrows from an owned value. Read more
impl<T> ErasedDestructor for Twhere
T: 'static,
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> ⓘ
Converts
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> ⓘ
Converts
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