iajoiner commented on code in PR #3347:
URL: https://github.com/apache/arrow-datafusion/pull/3347#discussion_r962006492


##########
datafusion/physical-expr/src/aggregate/approx_percentile_cont.rs:
##########
@@ -272,79 +272,129 @@ impl ApproxPercentileAccumulator {
     ) -> Result<Vec<OrderedFloat<f64>>> {
         match values.data_type() {
             DataType::Float64 => {
-                let array = 
values.as_any().downcast_ref::<Float64Array>().unwrap();
+                let array = 
values.as_any().downcast_ref::<Float64Array>().ok_or(
+                    DataFusionError::Internal(format!(
+                        "A Float64 type array, {:?} is somehow not a 
Float64Array",
+                        values

Review Comment:
   This won't. The following function is usually used when implementing `Debug`.
   
https://github.com/apache/arrow-rs/blob/master/arrow/src/array/array.rs#L719-L757



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