pub struct PartitionPruningStatistics { /* private fields */ }👎Deprecated since 52.0.0:
This struct is no longer used internally. Use replace_columns_with_literals from datafusion-physical-expr-adapter to substitute partition column values before pruning. It will be removed in 58.0.0 or 6 months after 52.0.0 is released, whichever comes first.
Expand description
Prune files based on their partition values.
This is used both at planning time and execution time to prune
files based on their partition values.
This feeds into CompositePruningStatistics to allow pruning
with filters that depend both on partition columns and data columns
(e.g. WHERE partition_col = data_col).
Implementations§
Source§impl PartitionPruningStatistics
impl PartitionPruningStatistics
Sourcepub fn try_new(
partition_values: Vec<Vec<ScalarValue>>,
partition_fields: Vec<Arc<Field>>,
) -> Result<PartitionPruningStatistics, DataFusionError>
pub fn try_new( partition_values: Vec<Vec<ScalarValue>>, partition_fields: Vec<Arc<Field>>, ) -> Result<PartitionPruningStatistics, DataFusionError>
Create a new instance of PartitionPruningStatistics.
Args:
partition_values: A vector of vectors ofScalarValues. The outer vector represents the containers while the inner vector represents the partition values for each column. Note that this is the opposite of the order of the partition columns inPartitionPruningStatistics::partition_schema.partition_schema: The schema of the partition columns. This must not be the schema of the entire file or table: instead it must only be the schema of the partition columns, in the same order as the values inpartition_values.
§Example
To create PartitionPruningStatistics for two partition columns a and b,
for three containers like this:
| a | b |
|---|---|
| 1 | 2 |
| 3 | 4 |
| 5 | 6 |
let partition_values = vec![
vec![ScalarValue::from(1i32), ScalarValue::from(2i32)],
vec![ScalarValue::from(3i32), ScalarValue::from(4i32)],
vec![ScalarValue::from(5i32), ScalarValue::from(6i32)],
];
let partition_fields = vec![
Arc::new(Field::new("a", DataType::Int32, false)),
Arc::new(Field::new("b", DataType::Int32, false)),
];
let partition_stats =
PartitionPruningStatistics::try_new(partition_values, partition_fields).unwrap();Trait Implementations§
Source§impl Clone for PartitionPruningStatistics
impl Clone for PartitionPruningStatistics
Source§fn clone(&self) -> PartitionPruningStatistics
fn clone(&self) -> PartitionPruningStatistics
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl PruningStatistics for PartitionPruningStatistics
impl PruningStatistics for PartitionPruningStatistics
Source§fn min_values(&self, column: &Column) -> Option<Arc<dyn Array>>
fn min_values(&self, column: &Column) -> Option<Arc<dyn Array>>
Return the minimum values for the named column, if known. Read more
Source§fn max_values(&self, column: &Column) -> Option<Arc<dyn Array>>
fn max_values(&self, column: &Column) -> Option<Arc<dyn Array>>
Return the maximum values for the named column, if known. Read more
Source§fn num_containers(&self) -> usize
fn num_containers(&self) -> usize
Return the number of containers (e.g. Row Groups) being pruned with
these statistics. Read more
Source§fn null_counts(&self, _column: &Column) -> Option<Arc<dyn Array>>
fn null_counts(&self, _column: &Column) -> Option<Arc<dyn Array>>
Return the number of null values for the named column as an
UInt64Array Read moreSource§fn row_counts(&self) -> Option<Arc<dyn Array>>
fn row_counts(&self) -> Option<Arc<dyn Array>>
Return the number of rows in each container as an
UInt64Array. Read moreSource§fn contained(
&self,
column: &Column,
values: &HashSet<ScalarValue>,
) -> Option<BooleanArray>
fn contained( &self, column: &Column, values: &HashSet<ScalarValue>, ) -> Option<BooleanArray>
Returns
BooleanArray where each row represents information known
about specific literal values in a column. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for PartitionPruningStatistics
impl !UnwindSafe for PartitionPruningStatistics
impl Freeze for PartitionPruningStatistics
impl Send for PartitionPruningStatistics
impl Sync for PartitionPruningStatistics
impl Unpin for PartitionPruningStatistics
impl UnsafeUnpin for PartitionPruningStatistics
Blanket Implementations§
Source§impl<Source> AccessAs for Source
impl<Source> AccessAs for Source
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<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> 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> ⓘ
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