adriangb commented on code in PR #27736:
URL: https://github.com/apache/datafusion/pull/27736#discussion_r4735904478
##########
datafusion/datasource-parquet/src/bloom_filter.rs:
##########
@@ -23,6 +24,9 @@ use parquet::data_type::Decimal;
pub struct BloomFilterStatistics {
/// Per-column Bloom filters keyed by predicate column name.
column_sbbf: HashMap<String, ColumnBloomFilter>,
+ /// Bloom filters for expressions with their own statistics (such as
+ /// struct fields), by the leaf that the expression is bound to.
+ expr_sbbf: Vec<(usize, ColumnBloomFilter)>,
Review Comment:
Feels like something went wrong if we need `column_sbbf` AND `expr_sbbf`.
##########
datafusion/pruning/src/pruning_predicate.rs:
##########
@@ -857,6 +1079,11 @@ pub struct RequiredColumns {
/// * The field the statistics value should be placed in for
/// pruning predicate evaluation (e.g. `min_value` or `max_value`)
columns: Vec<(phys_expr::Column, StatisticsType, Field)>,
+ /// The expression of each entry in `columns`, at the same index, when
+ /// the statistics are for an expression with its own statistics (such
+ /// as `get_field(s, 'a')`) rather than for the column itself. The
+ /// column in `columns` is then the one column the expression reads.
+ stats_exprs: Vec<Option<StatsExpr>>,
Review Comment:
Why do we need this split? Should `RequiredColumns` be refactored into
something expression based? I.e. should this bemore like:
```rust
struct RequiredExprStatistics {
Vec<RequiredExprStatistic>,
}
struct RequiredExprStatistic {
exp: StatsExpr,
stats: StatisticsType,
field: Field,
}
```
##########
datafusion/pruning/src/pruning_predicate.rs:
##########
@@ -873,6 +1100,12 @@ impl RequiredColumns {
/// * `a > 5 OR b < 10` returns `None`
/// * `true` returns None
pub fn single_column(&self) -> Option<&phys_expr::Column> {
+ // An expression with its own statistics is not the column itself, so
+ // callers that read per-column statistics (such as the page index)
+ // must not treat it as one.
Review Comment:
This ain't pretty
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]