martin-g commented on code in PR #18647:
URL: https://github.com/apache/datafusion/pull/18647#discussion_r2523640335
##########
datafusion/sqllogictest/test_files/aggregate.slt:
##########
@@ -910,6 +910,16 @@ SELECT approx_median(col_f64_nan) FROM median_table
----
NaN
+query RT
+select approx_median(arrow_cast(col_f32, 'Float16')),
arrow_typeof(approx_median(arrow_cast(col_f32, 'Float16'))) from median_table;
+----
+2.75 Float16
+
+query ?T
+select approx_median(NULL), arrow_typeof(approx_median(NULL)) from
median_table;
+----
+NULL Null
+
Review Comment:
Test for approx_percentile_cont + Float16.
```
query RT
select
approx_percentile_cont(0.5) within group (order by arrow_cast(col_f32,
'Float16')),
arrow_typeof(approx_percentile_cont(0.5) within group (order by
arrow_cast(col_f32, 'Float16')))
from median_table;
----
2.75 Float16
```
##########
datafusion/functions-aggregate/src/approx_percentile_cont.rs:
##########
@@ -197,6 +186,7 @@ impl ApproxPercentileCont {
| DataType::Int16
| DataType::Int32
| DataType::Int64
+ | DataType::Float16
Review Comment:
Should Float16 be added to NUMERICS at
https://github.com/Jefffrey/datafusion/blob/d3630a45272a604f912cbd05ab80de25b7f7c8bc/datafusion/expr-common/src/type_coercion/aggregates.rs#L46
too ?
They are planned for removal but probably should be added until then.
--
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]