adriangb commented on code in PR #27734:
URL: https://github.com/apache/datafusion/pull/27734#discussion_r4689930573


##########
datafusion/common/src/pruning.rs:
##########
@@ -127,6 +127,47 @@ pub trait PruningStatistics {
         column: &Column,
         values: &HashSet<ScalarValue>,
     ) -> Option<BooleanArray>;
+
+    /// Return the minimum values for the struct field reached from `column`
+    /// by `path`, if known.
+    ///
+    /// For example, `get_field(s, 'a', 'b')` has `column` `s` and `path`
+    /// `["a", "b"]`. The path is never empty. The contract matches
+    /// [`Self::min_values`].
+    ///
+    /// The default returns `None`, so pruning keeps every container.
+    fn min_values_for_field(

Review Comment:
   Open question: should this take an expression instead of a column + path?
   
   An expression would also cover `lower(col)` backed by a precomputed column, 
or `variant_get`. A path only covers struct fields.
   
   I used a path because `PruningStatistics` lives in `datafusion-common`, 
which cannot name `PhysicalExpr` (`physical-expr-common` depends on `common`). 
An expression-keyed API means moving this trait (and `PrunableStatistics` / 
`CompositePruningStatistics`) to `physical-expr-common`, with a re-export here.
   
   A path can be widened later: expression methods with a default that maps 
`get_field(col, ...)` to these path methods. Should we move the trait now 
instead?



-- 
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]

Reply via email to