Skip to content

Commit de46787

Browse files
committed
wip
Signed-off-by: Alexander Droste <[email protected]>
1 parent bcac437 commit de46787

File tree

1 file changed

+6
-7
lines changed
  • vortex-array/src/arrays/list/compute

1 file changed

+6
-7
lines changed

vortex-array/src/arrays/list/compute/take.rs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,18 +43,17 @@ impl TakeKernel for ListVTable {
4343
match_each_integer_ptype!(indices.ptype(), |I| {
4444
let offsets_slice = offsets.as_slice::<O>();
4545
let indices_slice: &[I] = indices.as_slice::<I>();
46-
47-
// Calculate total count to determine appropriate accumulation type
48-
let total_count = indices_slice
46+
let approx_total_count = indices_slice
4947
.iter()
5048
.map(|idx| {
5149
let idx: usize = idx.as_();
52-
let diff: usize = (offsets_slice[idx + 1] - offsets_slice[idx]).as_();
53-
diff
50+
let length: usize = (offsets_slice[idx + 1] - offsets_slice[idx]).as_();
51+
length
5452
})
55-
.sum::<usize>();
53+
.max()
54+
.unwrap_or(0);
5655

57-
match_smallest_offset_type!(total_count, |AccumType| {
56+
match_smallest_offset_type!(approx_total_count, |AccumType| {
5857
_take::<I, O, AccumType>(
5958
array,
6059
offsets_slice,

0 commit comments

Comments
 (0)