File tree Expand file tree Collapse file tree 1 file changed +15
-13
lines changed Expand file tree Collapse file tree 1 file changed +15
-13
lines changed Original file line number Diff line number Diff line change @@ -418,19 +418,21 @@ impl<'a> Simplifier<'a> {
418418
419419 /// Returns true if expr is nullable
420420 fn nullable ( & self , expr : & Expr ) -> Result < bool > {
421- for schema in & self . schemas {
422- if let Ok ( res) = expr. nullable ( schema. as_ref ( ) ) {
423- return Ok ( res) ;
424- }
425- // expr may be from another input, so keep trying
426- }
427-
428- // This means we weren't able to compule `Expr::nullable` with
429- // any input schemas, signalling a problem
430- Err ( DataFusionError :: Internal ( format ! (
431- "Could not find find columns in '{}' during simplify" ,
432- expr
433- ) ) )
421+ self . schemas
422+ . iter ( )
423+ . find_map ( |schema| {
424+ // expr may be from another input, so ignore errors
425+ // by converting to None to keep trying
426+ expr. nullable ( schema. as_ref ( ) ) . ok ( )
427+ } )
428+ . ok_or_else ( || {
429+ // This means we weren't able to compute `Expr::nullable` with
430+ // *any* input schemas, signalling a problem
431+ DataFusionError :: Internal ( format ! (
432+ "Could not find find columns in '{}' during simplify" ,
433+ expr
434+ ) )
435+ } )
434436 }
435437}
436438
You can’t perform that action at this time.
0 commit comments