Dodothereal opened a new pull request, #26752: URL: https://github.com/apache/datafusion/pull/26752
Closes #26469. An explicit nullable cast target could be reported as nullable by the physical expression while the logical expression still kept the source's required nullability. Aggregates compare those input schemas, so casts to extension types such as UUID failed with `Physical input schema should be the same as the one converted from logical input schema`. This uses the execution rule in the logical and physical expressions: type-only casts preserve the input's nullability, explicit targets are nullable if either the input or target allows nulls, and safe casts are nullable because a failed cast produces NULL. `CastExpr::return_field()` keeps returning the exact target field for the schema adapter. The new sqllogictest covers `count`, `count(DISTINCT)`, and `GROUP BY` over a two-row UUID cast, along with the source-required case. I also left the existing extension metadata tests in place. Tests run: - `cargo test -p datafusion-sqllogictest --test sqllogictests -- cast_extension_type_metadata --test-threads 1` - `cargo test -p datafusion-expr --lib expr_schema::tests` - `cargo test -p datafusion-physical-expr --lib expressions::cast::tests` - `cargo test -p datafusion-physical-expr-adapter --lib` - union-nullability, aggregate-adapter, and recursive CTE integration tests - `cargo clippy -p datafusion-expr -p datafusion-physical-expr --lib -- -D warnings` - `cargo fmt --all -- --check` The checkout is shallow and lacks the test-data submodules, so I did not treat the full sqllogictest corpus as evidence. -- 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]
