pub struct Scan { /* private fields */ }Expand description
One exact table scan with fixed options, metadata, and execution placement.
Implementations§
Source§impl Scan
impl Scan
Sourcepub fn identity(&self) -> TableIdentity
pub fn identity(&self) -> TableIdentity
Immutable version read by this scan.
Sourcepub fn resolved_address(&self) -> Option<&ResourceAddress>
pub fn resolved_address(&self) -> Option<&ResourceAddress>
Canonical exact-version address inherited from a path-resolved Table.
ID-only scans expose their provenance through Self::identity.
Sourcepub fn options(&self) -> &ScanOptions
pub fn options(&self) -> &ScanOptions
Options fixed when the scan was opened.
Sourcepub fn schema(&self) -> SchemaRef
pub fn schema(&self) -> SchemaRef
Projected schema, available without reading batches or performing I/O.
Sourcepub fn source_fields(&self) -> Option<&BTreeMap<String, Uuid>>
pub fn source_fields(&self) -> Option<&BTreeMap<String, Uuid>>
This method returns stable IDs for top-level stored columns, independent of the output
projection. None marks scans without stable identities, such as change scans or scans
from older hosts.
Sourcepub fn write_layout(&self) -> Option<&WriteLayout>
pub fn write_layout(&self) -> Option<&WriteLayout>
Preferred storage partitioning and clustering for writes to this exact table.
Sourcepub fn statistics(&self) -> Option<&ScanStatistics>
pub fn statistics(&self) -> Option<&ScanStatistics>
Stored statistics for this scan, with explicit exactness for counts and bounds.
Sourcepub fn ordering(&self) -> &[SortColumn]
pub fn ordering(&self) -> &[SortColumn]
Ordering guaranteed independently within each execution stream, with no global order.
Sourcepub fn filter_clauses(&self) -> &[FilterClause]
pub fn filter_clauses(&self) -> &[FilterClause]
Exact support for the accepted predicate clauses.
Sourcepub fn estimated_rows(&self) -> Option<u64>
pub fn estimated_rows(&self) -> Option<u64>
An estimate of the stored rows this scan reads, known without reading any rows.
It counts every row of the splits planning kept, so the scan’s filter, limit, or emit can
return fewer rows. None when the plan does not estimate every split.
Sourcepub fn stream_count(&self) -> usize
pub fn stream_count(&self) -> usize
Number of execution lanes available through Self::into_streams.
Sourcepub fn splits(&self) -> &[ScanSplit]
pub fn splits(&self) -> &[ScanSplit]
The splits planning kept, in stored order: the units of work that Self::read_work
reads.
Sourcepub async fn read_work(&self, work: Vec<WorkItem>) -> Result<WorkStream, Error>
pub async fn read_work(&self, work: Vec<WorkItem>) -> Result<WorkStream, Error>
Read work in order, each item’s rows in stored order.
Each batch carries the index of its item in work and the stored row after the rows it
covered, so a reader resumes an item from that row without reading any row twice. Items
name splits of this scan by index and stored rows within them. Scans with a limit or an
emit read no work items.
Sourcepub async fn count_rows(&self, work: &[WorkItem]) -> Result<Vec<u64>, Error>
pub async fn count_rows(&self, work: &[WorkItem]) -> Result<Vec<u64>, Error>
The exact rows each item of work returns: stored rows that pass the filter and are not
deleted. Counting reads only the filter’s columns, and none without a filter.
Sourcepub async fn take(&self, takes: Vec<Take>) -> Result<BatchStream, Error>
pub async fn take(&self, takes: Vec<Take>) -> Result<BatchStream, Error>
Read rows of this scan’s splits by position, in request order: each take’s rows in the order of its positions, a repeated position’s row again, the takes one after another.
This is the read a sampler calls: plan the scan once, count each split’s rows with
Self::count_rows, then take the positions it draws. Each split’s rows are read in one
pass, so positions that share storage share its reads, and takes beyond one request’s
bounds are sent as several. A failed request is resumed from the rows it delivered.
A position past its split fails the call before any rows are delivered. Scans with a
filter, a limit or an emit take no rows.
Sourcepub fn into_stream(self) -> BatchStream
pub fn into_stream(self) -> BatchStream
Consume the scan as one batch stream. Reading starts on first poll. Unordered options permit unordered output even when using one consumer.
Sourcepub fn into_streams(self) -> Vec<ScanStream>
pub fn into_streams(self) -> Vec<ScanStream>
Consume the scan as disjoint streams that together contain its selected rows.
Ordered lanes merge fixed groups of fragments when Self::ordering is nonempty.
Other lanes share work dynamically. Consume all lanes concurrently for throughput.
A global limit or explicit split yields one lane. Clone the scan, not a lane,
to start a fresh execution without resolving metadata again.
Dropping the last active lane cancels remaining work, including idle lanes.
Sourcepub fn into_narrowed_streams(
self,
filter: Arc<dyn SplitFilter>,
) -> Vec<ScanStream>
pub fn into_narrowed_streams( self, filter: Arc<dyn SplitFilter>, ) -> Vec<ScanStream>
Self::into_streams, with each split narrowed by filter as it stands when the split
opens.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Scan
impl !UnwindSafe for Scan
impl Freeze for Scan
impl Send for Scan
impl Sync for Scan
impl Unpin for Scan
impl UnsafeUnpin for Scan
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FmtForward for T
impl<T> FmtForward for T
Source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.Source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.Source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.Source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.Source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.Source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.Source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.Source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.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 moreSource§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.