Skip to content

Commit daf1655

Browse files
author
Jiayu Liu
committed
use Ok(make_array(array.data_ref().clone()))
1 parent 20c4a74 commit daf1655

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

arrow/src/compute/kernels/window.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,11 @@
1818
//! Defines windowing functions, like `shift`ing
1919
2020
use crate::array::{Array, ArrayRef};
21-
use crate::{array::new_null_array, compute::concat};
2221
use crate::{array::PrimitiveArray, datatypes::ArrowPrimitiveType, error::Result};
22+
use crate::{
23+
array::{make_array, new_null_array},
24+
compute::concat,
25+
};
2326
use num::{abs, clamp};
2427

2528
/// Shifts array by defined number of items (to left or right)
@@ -59,7 +62,7 @@ where
5962
{
6063
let value_len = values.len() as i64;
6164
if offset == 0 {
62-
Ok(values.slice(0, values.len()))
65+
Ok(make_array(values.data_ref().clone()))
6366
} else if offset == i64::MIN || abs(offset) >= value_len {
6467
Ok(new_null_array(&T::DATA_TYPE, values.len()))
6568
} else {

0 commit comments

Comments
 (0)