pub struct RequiredColumns {
columns: Vec<(Column, StatisticsType, Field)>,
}Expand description
Describes which columns statistics are necessary to evaluate a
PruningPredicate.
This structure permits reading and creating the minimum number statistics, which is important since statistics may be non trivial to read (e.g. large strings or when there are 1000s of columns).
Handles creating references to the min/max statistics for columns as well as recording which statistics are needed
Fields§
§columns: Vec<(Column, StatisticsType, Field)>The statistics required to evaluate this predicate:
- The unqualified column in the input schema
- Statistics type (e.g. Min or Max or Null_Count)
- The field the statistics value should be placed in for
pruning predicate evaluation (e.g.
min_valueormax_value)
Implementations§
Source§impl RequiredColumns
impl RequiredColumns
fn new() -> Self
Sourcepub fn single_column(&self) -> Option<&Column>
pub fn single_column(&self) -> Option<&Column>
Returns Some(column) if this is a single column predicate.
Returns None if this is a multi-column predicate.
Examples:
a > 5 OR a < 10returnsSome(a)a > 5 OR b < 10returnsNonetruereturns None
Sourcefn schema(&self) -> Schema
fn schema(&self) -> Schema
Returns a schema that describes the columns required to evaluate this
pruning predicate.
The schema contains the fields for each column in self.columns with
the appropriate data type for the statistics.
Order matters, this same order is used to evaluate the
pruning predicate.
Sourcepub(crate) fn iter(
&self,
) -> impl Iterator<Item = &(Column, StatisticsType, Field)>
pub(crate) fn iter( &self, ) -> impl Iterator<Item = &(Column, StatisticsType, Field)>
Returns an iterator over items in columns (see doc on
self.columns for details)
fn find_stat_column( &self, column: &Column, statistics_type: StatisticsType, ) -> Option<usize>
Sourcefn stat_column_expr(
&mut self,
column: &Column,
column_expr: &Arc<dyn PhysicalExpr>,
field: &Field,
stat_type: StatisticsType,
) -> Result<Arc<dyn PhysicalExpr>>
fn stat_column_expr( &mut self, column: &Column, column_expr: &Arc<dyn PhysicalExpr>, field: &Field, stat_type: StatisticsType, ) -> Result<Arc<dyn PhysicalExpr>>
Rewrites column_expr so that all appearances of column are replaced with a reference to either the min or max statistics column, while keeping track that a reference to the statistics column is required
for example, an expression like col("foo") > 5, when called
with Max would result in an expression like col("foo_max") > 5 with the appropriate entry noted in self.columns
Sourcefn min_column_expr(
&mut self,
column: &Column,
column_expr: &Arc<dyn PhysicalExpr>,
field: &Field,
) -> Result<Arc<dyn PhysicalExpr>>
fn min_column_expr( &mut self, column: &Column, column_expr: &Arc<dyn PhysicalExpr>, field: &Field, ) -> Result<Arc<dyn PhysicalExpr>>
rewrite col –> col_min
Sourcefn max_column_expr(
&mut self,
column: &Column,
column_expr: &Arc<dyn PhysicalExpr>,
field: &Field,
) -> Result<Arc<dyn PhysicalExpr>>
fn max_column_expr( &mut self, column: &Column, column_expr: &Arc<dyn PhysicalExpr>, field: &Field, ) -> Result<Arc<dyn PhysicalExpr>>
rewrite col –> col_max
Sourcefn null_count_column_expr(
&mut self,
column: &Column,
column_expr: &Arc<dyn PhysicalExpr>,
field: &Field,
) -> Result<Arc<dyn PhysicalExpr>>
fn null_count_column_expr( &mut self, column: &Column, column_expr: &Arc<dyn PhysicalExpr>, field: &Field, ) -> Result<Arc<dyn PhysicalExpr>>
rewrite col –> col_null_count
Sourcefn row_count_column_expr(
&mut self,
column: &Column,
column_expr: &Arc<dyn PhysicalExpr>,
field: &Field,
) -> Result<Arc<dyn PhysicalExpr>>
fn row_count_column_expr( &mut self, column: &Column, column_expr: &Arc<dyn PhysicalExpr>, field: &Field, ) -> Result<Arc<dyn PhysicalExpr>>
rewrite col –> col_row_count
Trait Implementations§
Source§impl Clone for RequiredColumns
impl Clone for RequiredColumns
Source§fn clone(&self) -> RequiredColumns
fn clone(&self) -> RequiredColumns
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for RequiredColumns
impl Debug for RequiredColumns
Source§impl Default for RequiredColumns
impl Default for RequiredColumns
Source§fn default() -> RequiredColumns
fn default() -> RequiredColumns
Source§impl From<Vec<(Column, StatisticsType, Field)>> for RequiredColumns
impl From<Vec<(Column, StatisticsType, Field)>> for RequiredColumns
Source§fn from(columns: Vec<(Column, StatisticsType, Field)>) -> Self
fn from(columns: Vec<(Column, StatisticsType, Field)>) -> Self
Auto Trait Implementations§
impl Freeze for RequiredColumns
impl RefUnwindSafe for RequiredColumns
impl Send for RequiredColumns
impl Sync for RequiredColumns
impl Unpin for RequiredColumns
impl UnwindSafe for RequiredColumns
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,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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