realno commented on a change in pull request #1539:
URL: https://github.com/apache/arrow-datafusion/pull/1539#discussion_r787371225
##########
File path: datafusion/src/physical_plan/aggregates.rs
##########
@@ -331,17 +348,28 @@ pub fn signature(fun: &AggregateFunction) -> Signature {
| AggregateFunction::StddevPop => {
Signature::uniform(1, NUMERICS.to_vec(), Volatility::Immutable)
}
+ AggregateFunction::ApproxQuantile => Signature::one_of(
+ // Accept any numeric value paired with a float64 quantile
+ NUMERICS
+ .iter()
+ .map(|t| TypeSignature::Exact(vec![t.clone(),
DataType::Float64]))
Review comment:
I took another look, so for functions with literal arguments, it will be
filled into an array then passed inside the function. I believe this is normal
SQL behavior. For example `corr(col1, 1.0)` will take col1 and fill another
array with all `1.0`s then calculate the correlation.
For `quantile` this is not desired behavior though it should work as is. It
also consumes more memory. I am wondering if there is a more elegant way to
deal with function parameters. @alamb
--
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]