findepi commented on code in PR #14519: URL: https://github.com/apache/datafusion/pull/14519#discussion_r1946883460
########## datafusion/core/src/physical_planner.rs: ########## @@ -689,7 +693,7 @@ impl DefaultPhysicalPlanner { if physical_field.data_type() != logical_field.data_type() { differences.push(format!("field data type at index {} [{}]: (physical) {} vs (logical) {}", i, physical_field.name(), physical_field.data_type(), logical_field.data_type())); } - if physical_field.is_nullable() != logical_field.is_nullable() { + if physical_field.is_nullable() && !logical_field.is_nullable() { Review Comment: > logical a physical schema can be derived differently and nullable sometimes derived in different way as well. agreed, but the earlier delivered schema acts as a contract (promise) for a later delivered schema if we told the world that `expr` won't contain null values, we can't change the mind at physical planning time. it violates the constraint (promise / contract) if we told the world that `expr` _may_ contain null values, we didn't promise that it _will_ contain null values, and we may happen to produce no null values (and even be aware of that) -- 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