Skip to content

Commit

Permalink
remove unused cast
Browse files Browse the repository at this point in the history
  • Loading branch information
goldmedal committed Sep 4, 2024
1 parent 4f06d04 commit b56de3f
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions datafusion/functions-aggregate/src/kurtosis_pop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
// under the License.

use arrow::array::{Array, ArrayRef, Float64Array, UInt64Array};
use arrow::compute::cast;
use arrow_schema::{DataType, Field};
use datafusion_common::cast::as_float64_array;
use datafusion_common::{downcast_value, DataFusionError, Result, ScalarValue};
Expand Down Expand Up @@ -122,8 +121,7 @@ impl KurtosisPopAccumulator {

impl Accumulator for KurtosisPopAccumulator {
fn update_batch(&mut self, values: &[ArrayRef]) -> Result<()> {
let values = &cast(&values[0], &DataType::Float64)?;
let array = as_float64_array(&values)?;
let array = as_float64_array(&values[0])?;
for value in array.iter().flatten() {
self.count += 1;
self.sum += value;
Expand Down

0 comments on commit b56de3f

Please sign in to comment.