osipovartem opened a new pull request, #25381:
URL: https://github.com/apache/datafusion/pull/25381

   ## Which issue does this PR close?
   
   - Closes #25380.
   
   ## Rationale for this change
   
   `UPPER` and `LOWER` currently use the default scalar UDF result field, which 
is always nullable. Both functions return a non-null value for a non-null 
input, so this loses a provable schema property and exposes inaccurate result 
metadata to downstream consumers.
   
   ## What changes are included in this PR?
   
   - Implement `return_field_from_args` for `UpperFunc` and `LowerFunc`.
   - Preserve the input string type and nullability.
   - Add nullable and non-nullable unit cases for each function.
   
   The vectorized execution kernels are unchanged. This adds no per-row 
dispatch, conversion, allocation, or materialization.
   
   ## Are these changes tested?
   
   Yes:
   
   - `cargo +1.95.0 test -p datafusion-functions preserves_input_nullability`
   - `cargo +1.95.0 clippy -p datafusion-functions --lib --tests --all-features 
--no-deps -- -D warnings`
   - `cargo +1.95.0 fmt --all -- --check`
   
   ## Are there any user-facing changes?
   
   Planned result schemas now retain non-nullability through `UPPER` and 
`LOWER`. Runtime values and public APIs are unchanged.


-- 
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]

Reply via email to