andygrove opened a new pull request, #5285: URL: https://github.com/apache/datafusion-comet/pull/5285
## Which issue does this PR close? Follow-up to review feedback on #5138: https://github.com/apache/datafusion-comet/pull/5138#discussion_r3732929900 ## Rationale for this change The doc comment on `cast_and_stamp_schema` claims that reconciliation follows the declared schema in both directions, and that narrowing a nullable nested child to non-null is not silently lossy because arrow's `StructArray::try_new` rejects unmasked nulls under a non-nullable field. That claim was not covered by a test, so nothing would catch it if the narrowing direction ever started producing an array whose nullability flag misreports its own contents. ## What changes are included in this PR? One test in `native/common/src/schema.rs`, `narrowing_a_child_errors_only_when_it_holds_a_null`. It stamps a `List(Struct(nullable Boolean))` array against a schema declaring the child non-null, twice: - null-free data narrows successfully and comes back with the declared schema - the same shape carrying a real null in the child errors, and the message names the operator, the column index, and the dotted path `c0.element.flag` The two cases together pin that the child's `nullable` flag alone does not decide the outcome: the data does. No production code changes. ## How are these changes tested? `cargo test -p datafusion-comet-common schema::` (10 passed). -- 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]
