Sigma-Ma commented on code in PR #24104:
URL: https://github.com/apache/datafusion/pull/24104#discussion_r3725484267
##########
datafusion/functions-aggregate/src/median.rs:
##########
@@ -104,22 +104,7 @@ impl Median {
// Integer inputs are coerced to Float64 so the average of the two
// middle values is not truncated. This matches DuckDB /
PostgreSQL / Spark.
// Float and Decimal inputs preserve their type.
- signature: Signature::one_of(
- vec![
- TypeSignature::Coercible(vec![Coercion::new_exact(
- TypeSignatureClass::Decimal,
- )]),
- TypeSignature::Coercible(vec![Coercion::new_exact(
- TypeSignatureClass::Float,
- )]),
- TypeSignature::Coercible(vec![Coercion::new_implicit(
- TypeSignatureClass::Native(logical_float64()),
- vec![TypeSignatureClass::Integer],
- NativeType::Float64,
- )]),
- ],
- Volatility::Immutable,
- ),
+ signature: Signature::user_defined(Volatility::Immutable),
Review Comment:
Thanks for the suggestion. I restored the original declarative signature and
moved the Null handling to the physical execution path.
Null input now uses the existing NoopAccumulator pattern, has a matching
Null state field, and falls back to the generic groups accumulator adapter. I
also updated the regression test to expect `NULL` with `DataType::Null`.
--
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]