From 153b18634de473aeb6a43f9cbe043269707d23ef Mon Sep 17 00:00:00 2001 From: Joe Isaacs Date: Mon, 25 Nov 2024 12:20:57 +0000 Subject: [PATCH] fix --- datafusion/functions/src/datetime/date_bin.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/datafusion/functions/src/datetime/date_bin.rs b/datafusion/functions/src/datetime/date_bin.rs index 11817e248b66..c79468402841 100644 --- a/datafusion/functions/src/datetime/date_bin.rs +++ b/datafusion/functions/src/datetime/date_bin.rs @@ -508,7 +508,7 @@ mod tests { use crate::datetime::date_bin::{date_bin_nanos_interval, DateBinFunc}; use arrow::array::types::TimestampNanosecondType; - use arrow::array::{Array, IntervalDayTimeArray, TimestampNanosecondArray}; + use arrow::array::{Array, ArrayRef, IntervalDayTimeArray, TimestampNanosecondArray}; use arrow::compute::kernels::cast_utils::string_to_timestamp_nanos; use arrow::datatypes::{DataType, TimeUnit}; @@ -537,6 +537,7 @@ mod tests { assert!(res.is_ok()); let timestamps = Arc::new((1..6).map(Some).collect::()); + let batch_len = timestamps.len(); let res = DateBinFunc::new().invoke_batch( &[ ColumnarValue::Scalar(ScalarValue::IntervalDayTime(Some( @@ -545,10 +546,10 @@ mod tests { milliseconds: 1, }, ))), - ColumnarValue::Array(timestamps.clone()), + ColumnarValue::Array(timestamps), ColumnarValue::Scalar(ScalarValue::TimestampNanosecond(Some(1), None)), ], - timestamps.len(), + batch_len, ); assert!(res.is_ok());