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<FieldRef>,
) -> Result<Self, DataFusionError>
pub fn try_new( partition_values: Vec<Vec<ScalarValue>>, partition_fields: Vec<FieldRef>, ) -> Result<Self, 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 ยท 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<ArrayRef>
fn min_values(&self, column: &Column) -> Option<ArrayRef>
Return the minimum values for the named column, if known. Read more
Sourceยงfn max_values(&self, column: &Column) -> Option<ArrayRef>
fn max_values(&self, column: &Column) -> Option<ArrayRef>
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<ArrayRef>
fn null_counts(&self, _column: &Column) -> Option<ArrayRef>
Return the number of null values for the named column as an
UInt64Array Read moreSourceยงfn row_counts(&self, _column: &Column) -> Option<ArrayRef>
fn row_counts(&self, _column: &Column) -> Option<ArrayRef>
Return the number of rows for the named column 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 Freeze for PartitionPruningStatistics
impl !RefUnwindSafe for PartitionPruningStatistics
impl Send for PartitionPruningStatistics
impl Sync for PartitionPruningStatistics
impl Unpin for PartitionPruningStatistics
impl !UnwindSafe for PartitionPruningStatistics
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
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>
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