@@ -21,7 +21,7 @@ use std::sync::Arc;
2121use std:: { fmt, str:: FromStr } ;
2222
2323use crate :: utils;
24- use crate :: { type_coercion:: aggregates:: * , Signature , TypeSignature , Volatility } ;
24+ use crate :: { type_coercion:: aggregates:: * , Signature , Volatility } ;
2525
2626use arrow:: datatypes:: { DataType , Field } ;
2727use datafusion_common:: { plan_datafusion_err, plan_err, DataFusionError , Result } ;
@@ -45,10 +45,6 @@ pub enum AggregateFunction {
4545 NthValue ,
4646 /// Correlation
4747 Correlation ,
48- /// Approximate continuous percentile function
49- ApproxPercentileCont ,
50- /// Approximate continuous percentile function with weight
51- ApproxPercentileContWithWeight ,
5248 /// Grouping
5349 Grouping ,
5450 /// Bit And
@@ -75,8 +71,6 @@ impl AggregateFunction {
7571 ArrayAgg => "ARRAY_AGG" ,
7672 NthValue => "NTH_VALUE" ,
7773 Correlation => "CORR" ,
78- ApproxPercentileCont => "APPROX_PERCENTILE_CONT" ,
79- ApproxPercentileContWithWeight => "APPROX_PERCENTILE_CONT_WITH_WEIGHT" ,
8074 Grouping => "GROUPING" ,
8175 BitAnd => "BIT_AND" ,
8276 BitOr => "BIT_OR" ,
@@ -113,11 +107,6 @@ impl FromStr for AggregateFunction {
113107 "string_agg" => AggregateFunction :: StringAgg ,
114108 // statistical
115109 "corr" => AggregateFunction :: Correlation ,
116- // approximate
117- "approx_percentile_cont" => AggregateFunction :: ApproxPercentileCont ,
118- "approx_percentile_cont_with_weight" => {
119- AggregateFunction :: ApproxPercentileContWithWeight
120- }
121110 // other
122111 "grouping" => AggregateFunction :: Grouping ,
123112 _ => {
@@ -170,10 +159,6 @@ impl AggregateFunction {
170159 coerced_data_types[ 0 ] . clone ( ) ,
171160 true ,
172161 ) ) ) ) ,
173- AggregateFunction :: ApproxPercentileCont => Ok ( coerced_data_types[ 0 ] . clone ( ) ) ,
174- AggregateFunction :: ApproxPercentileContWithWeight => {
175- Ok ( coerced_data_types[ 0 ] . clone ( ) )
176- }
177162 AggregateFunction :: Grouping => Ok ( DataType :: Int32 ) ,
178163 AggregateFunction :: NthValue => Ok ( coerced_data_types[ 0 ] . clone ( ) ) ,
179164 AggregateFunction :: StringAgg => Ok ( DataType :: LargeUtf8 ) ,
@@ -230,39 +215,6 @@ impl AggregateFunction {
230215 AggregateFunction :: Correlation => {
231216 Signature :: uniform ( 2 , NUMERICS . to_vec ( ) , Volatility :: Immutable )
232217 }
233- AggregateFunction :: ApproxPercentileCont => {
234- let mut variants =
235- Vec :: with_capacity ( NUMERICS . len ( ) * ( INTEGERS . len ( ) + 1 ) ) ;
236- // Accept any numeric value paired with a float64 percentile
237- for num in NUMERICS {
238- variants
239- . push ( TypeSignature :: Exact ( vec ! [ num. clone( ) , DataType :: Float64 ] ) ) ;
240- // Additionally accept an integer number of centroids for T-Digest
241- for int in INTEGERS {
242- variants. push ( TypeSignature :: Exact ( vec ! [
243- num. clone( ) ,
244- DataType :: Float64 ,
245- int. clone( ) ,
246- ] ) )
247- }
248- }
249-
250- Signature :: one_of ( variants, Volatility :: Immutable )
251- }
252- AggregateFunction :: ApproxPercentileContWithWeight => Signature :: one_of (
253- // Accept any numeric value paired with a float64 percentile
254- NUMERICS
255- . iter ( )
256- . map ( |t| {
257- TypeSignature :: Exact ( vec ! [
258- t. clone( ) ,
259- t. clone( ) ,
260- DataType :: Float64 ,
261- ] )
262- } )
263- . collect ( ) ,
264- Volatility :: Immutable ,
265- ) ,
266218 AggregateFunction :: StringAgg => {
267219 Signature :: uniform ( 2 , STRINGS . to_vec ( ) , Volatility :: Immutable )
268220 }
0 commit comments