niebayes opened a new issue, #24077:
URL: https://github.com/apache/datafusion/issues/24077

   
   `SELECT median(NULL)` worked in DataFusion v53 (53.1.0) but fails in v54 
(54.0.0 / 54.1.0) with:
   
   ```
   MedianAccumulator not supported for median(NULL) with Null
   ```
   
   This is a **regression** introduced by PR 
[#21988](https://github.com/apache/datafusion/pull/21988).
   
   ## Root cause
   
   PR #21988 changed `median`'s signature from `Signature::numeric` to 
`Signature::one_of` with three coercible arms. The integer arm uses:
   
   ```rust
   // datafusion/functions-aggregate/src/median.rs
   Coercion::new_implicit(
       TypeSignatureClass::Native(logical_float64()),
       vec![TypeSignatureClass::Integer],   // ← should be Numeric
       NativeType::Float64,
   ),
   ```
   
   `TypeSignatureClass::Integer` does **not** include `DataType::Null`, so 
`median(NULL)` (whose input is `Null`) falls through to the accumulator's `_ => 
Err(...)` branch.
   


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