buraksenn commented on code in PR #14279:
URL: https://github.com/apache/datafusion/pull/14279#discussion_r1929595006


##########
datafusion/physical-expr/src/analysis.rs:
##########
@@ -235,16 +256,25 @@ fn shrink_boundaries(
 fn calculate_selectivity(
     target_boundaries: &[ExprBoundaries],
     initial_boundaries: &[ExprBoundaries],
-) -> f64 {
+) -> Result<f64> {
     // Since the intervals are assumed uniform and the values
     // are not correlated, we need to multiply the selectivities
     // of multiple columns to get the overall selectivity.
+    let mut acc: f64 = 1.0;
     initial_boundaries
         .iter()
         .zip(target_boundaries.iter())
-        .fold(1.0, |acc, (initial, target)| {
-            acc * cardinality_ratio(&initial.interval, &target.interval)
-        })
+        .for_each(|(initial, target)| {

Review Comment:
   Applied review same as above, thanks



##########
datafusion/physical-expr/src/analysis.rs:
##########
@@ -191,7 +201,18 @@ pub fn analyze(
             shrink_boundaries(graph, target_boundaries, 
target_expr_and_indices)
         }
         PropagationResult::Infeasible => {
-            Ok(AnalysisContext::new(target_boundaries).with_selectivity(0.0))
+            // If the propagation result is infeasible, map target boundary 
intervals to None
+            Ok(AnalysisContext::new(

Review Comment:
   thanks applied



-- 
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: github-unsubscr...@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org
For additional commands, e-mail: github-h...@datafusion.apache.org

Reply via email to