neilconway commented on code in PR #22718:
URL: https://github.com/apache/datafusion/pull/22718#discussion_r3345371546


##########
datafusion/physical-plan/src/filter.rs:
##########
@@ -846,6 +850,35 @@ fn collect_equality_columns(predicate: &Arc<dyn 
PhysicalExpr>) -> (HashSet<usize
     (eq_values.into_keys().collect(), infeasible)
 }
 
+/// Collects columns that cannot be NULL in any surviving row.
+///
+/// A filter keeps only rows where the predicate is TRUE. If a direct column
+/// operand appears in an AND conjunct whose operator returns NULL on NULL
+/// input, rows where that column is NULL cannot survive.
+///
+/// This analysis is conservative; for example, OR clauses are not considered
+/// null-rejecting; neither are indirect operands like `a + 1 < 10`.

Review Comment:
   Sure, that's pretty easy to add.
   
   It's a shame that there is `extract_null_rejecting_columns` in the logical 
planner, but we can't easily reuse it...



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