Skip to content

Commit 35ad7c1

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

File tree

1 file changed

+13
-0
lines changed
  • vortex-array/src/arrays/list/compute

1 file changed

+13
-0
lines changed

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

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,19 @@ 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
86+
.iter()
87+
.map(|idx| {
88+
let idx = idx
89+
.to_usize()
90+
.unwrap_or_else(|| vortex_panic!("Failed to convert index to usize: {}", idx));
91+
(offsets[idx + 1] - offsets[idx]).as_() as usize
92+
})
93+
.max()
94+
.unwrap_or(0)
95+
* array.len();
96+
8497
for &data_idx in indices {
8598
let data_idx = data_idx
8699
.to_usize()

0 commit comments

Comments
 (0)