AdamGS commented on code in PR #24258:
URL: https://github.com/apache/datafusion/pull/24258#discussion_r3915309468
##########
datafusion/optimizer/src/simplify_expressions/expr_simplifier.rs:
##########
@@ -2304,6 +2332,39 @@ fn inlist_except(mut l1: InList, l2: &InList) ->
Result<Expr> {
Ok(Expr::InList(l1))
}
+/// Set algebra on `IN` lists is only sound if nullable list items are not
+/// discarded. When the tested expression is nullable, preserve the NULL branch
+/// of an otherwise constant result explicitly.
+fn simplify_inlist_set_operation(
Review Comment:
How hard is it to make this function return `Result<Option<Expr>>`?
discarding the error cases seems weird to me.
If its acceptable, might be worth documenting why.
--
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]