Skip to content

Commit 7c3a1e7

Browse files
committed
wip
Signed-off-by: Alexander Droste <[email protected]>
1 parent 0e23a21 commit 7c3a1e7

File tree

1 file changed

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

1 file changed

+4
-6
lines changed

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

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
use vortex_buffer::BitBufferMut;
55
use vortex_dtype::IntegerPType;
66
use vortex_dtype::Nullability;
7-
use vortex_dtype::match_each_integer_ptype;
7+
use vortex_dtype::{match_each_integer_ptype, match_smallest_offset_type};
88
use vortex_error::VortexExpect;
99
use vortex_error::VortexResult;
1010
use vortex_error::vortex_panic;
@@ -81,18 +81,16 @@ fn _take<I: IntegerPType, O: IntegerPType>(
8181
let mut current_offset = 0u64;
8282
new_offsets.append_zero();
8383

84-
// Approximate the total element count.
85-
let approx_total_count = indices
84+
// Total element count.
85+
let total_count = indices
8686
.iter()
8787
.map(|idx| {
8888
let idx = idx
8989
.to_usize()
9090
.unwrap_or_else(|| vortex_panic!("Failed to convert index to usize: {}", idx));
9191
(offsets[idx + 1] - offsets[idx]).as_() as usize
9292
})
93-
.max()
94-
.unwrap_or(0)
95-
* array.len();
93+
.sum::<usize>();
9694

9795
for &data_idx in indices {
9896
let data_idx = data_idx

0 commit comments

Comments
 (0)