alamb commented on a change in pull request #1539:
URL: https://github.com/apache/arrow-datafusion/pull/1539#discussion_r788131456



##########
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:
       The long term way I hope to deal with it is via `ColumnarValue` which 
wraps either an `Array` or ` ScalarValue`. In this way the overhead of 
repeating the same `1.0` value should be entirely avoided
   
   
https://github.com/apache/arrow-datafusion/blob/master/datafusion/src/physical_plan/mod.rs#L408
   
   
   ```rust 
   /// Represents the result from an expression
   #[derive(Clone)]
   pub enum ColumnarValue {
       /// Array of values
       Array(ArrayRef),
       /// A single value
       Scalar(ScalarValue),
   }
   ```
   
   That being said, given the current `Aggregate` interface is in terms of 
`Array`s rather than `ColumnarValues` there would be some more work to make the 
idea a reality




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


Reply via email to