pub struct ScanArgs<'a> { /* private fields */ }Expand description
Arguments for scanning a table with TableProvider::scan_with_args.
Implementations§
Source§impl<'a> ScanArgs<'a>
impl<'a> ScanArgs<'a>
Sourcepub fn with_projection(self, projection: Option<&'a [usize]>) -> Self
pub fn with_projection(self, projection: Option<&'a [usize]>) -> Self
Set the column projection for the scan.
The projection is a list of column indices from TableProvider::schema
that should be included in the scan results. If None, all columns are included.
§Arguments
projection- Optional slice of column indices to project
Sourcepub fn projection(&self) -> Option<&'a [usize]>
pub fn projection(&self) -> Option<&'a [usize]>
Get the column projection for the scan.
Returns a reference to the projection column indices, or None if
no projection was specified (meaning all columns should be included).
Sourcepub fn with_filters(self, filters: Option<&'a [Expr]>) -> Self
pub fn with_filters(self, filters: Option<&'a [Expr]>) -> Self
Set the filter expressions for the scan.
Filters are boolean expressions that should be evaluated during the scan
to reduce the number of rows returned. All expressions are combined with AND logic.
Whether filters are actually pushed down depends on TableProvider::supports_filters_pushdown.
§Arguments
filters- Optional slice of filter expressions
Sourcepub fn filters(&self) -> Option<&'a [Expr]>
pub fn filters(&self) -> Option<&'a [Expr]>
Get the filter expressions for the scan.
Returns a reference to the filter expressions, or None if no filters were specified.
Sourcepub fn with_limit(self, limit: Option<usize>) -> Self
pub fn with_limit(self, limit: Option<usize>) -> Self
Set the maximum number of rows to return from the scan.
If specified, the scan should return at most this many rows. This is typically
used to optimize queries with LIMIT clauses.
§Arguments
limit- Optional maximum number of rows to return
Sourcepub fn limit(&self) -> Option<usize>
pub fn limit(&self) -> Option<usize>
Get the maximum number of rows to return from the scan.
Returns the row limit, or None if no limit was specified.
Sourcepub fn with_statistics_requests(
self,
statistics_requests: &'a [StatisticsRequest],
) -> Self
pub fn with_statistics_requests( self, statistics_requests: &'a [StatisticsRequest], ) -> Self
Specifies the statistics the caller may use when optimizing the query.
This is intended to allow the TableProvider to cheaply provide
statistics that may help, such as those it has in an in-memory catalog
or from some other metadata source.
TableProviders read these via Self::statistics_requests(); anything
a TableProvider cannot answer cheaply it simply ignores. DataFusion’s
own TableProviders ignore this field — it exists so a request can be
threaded from a custom optimizer rule (which annotates
TableScan::statistics_requests) through to a custom TableProvider.
Sourcepub fn statistics_requests(&self) -> &'a [StatisticsRequest]
pub fn statistics_requests(&self) -> &'a [StatisticsRequest]
Get the statistics requests for the scan. Empty if none were set.
See Self::with_statistics_requests for more details
Trait Implementations§
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for ScanArgs<'a>
impl<'a> !UnwindSafe for ScanArgs<'a>
impl<'a> Freeze for ScanArgs<'a>
impl<'a> Send for ScanArgs<'a>
impl<'a> Sync for ScanArgs<'a>
impl<'a> Unpin for ScanArgs<'a>
impl<'a> UnsafeUnpin for ScanArgs<'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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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