Sigma-Ma opened a new pull request, #24104:
URL: https://github.com/apache/datafusion/pull/24104

   ## Which issue does this PR close?
   
   - Closes #24077.
   
   ## Rationale for this change
   
   `median(NULL)` worked in DataFusion 53 but regressed in DataFusion 54. The 
untyped NULL argument remained `DataType::Null`, causing physical planning to 
create a median accumulator for an unsupported input type.
   
   ## What changes are included in this PR?
   
   - Use explicit type coercion for `median`.
   - Coerce untyped NULL and integer inputs to `Float64`.
   - Preserve Float and Decimal input types.
   - Add a SQL logic regression test for `median(NULL)`.
   
   ## Are these changes tested?
   
   Yes.
   
   - `cargo fmt --all -- --check`
   - `cargo test --profile=ci --test sqllogictests -- aggregate.slt`
   - `cargo test -p datafusion-functions-aggregate`
   - `cargo clippy -p datafusion-functions-aggregate --all-targets 
--all-features -- -D warnings`
   
   ## Are there any user-facing changes?
   
   Yes. `median(NULL)` now returns a typed `Float64` NULL instead of failing 
during physical execution.
   


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