Skip to content

Commit 5875c89

Browse files
committed
fix: Remove erroneous chunk offset calculation from Patches::take_search
Signed-off-by: Robert Kruszewski <[email protected]>
1 parent 84b2f96 commit 5875c89

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

vortex-array/src/patches.rs

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -730,17 +730,8 @@ impl Patches {
730730

731731
let new_indices = new_indices.into_array();
732732
let new_array_len = take_indices.len();
733-
let num_chunks = new_array_len.div_ceil(PATCH_CHUNK_SIZE);
734733
let values_validity = take_indices_validity.take(&new_indices)?;
735734

736-
// Indices are rewritten during take such that they are strictly
737-
// monotonically increasing, starting from 0. Therefore, we know
738-
// that there's 1024 entries per chunk, except for the last.
739-
let mut chunk_offsets_buf = BufferMut::<u64>::with_capacity(num_chunks);
740-
for chunk_idx in 0..num_chunks {
741-
chunk_offsets_buf.push((chunk_idx * PATCH_CHUNK_SIZE) as u64);
742-
}
743-
744735
Ok(Some(Self {
745736
array_len: new_array_len,
746737
offset: 0,
@@ -749,7 +740,7 @@ impl Patches {
749740
self.values(),
750741
&PrimitiveArray::new(values_indices, values_validity).into_array(),
751742
)?,
752-
chunk_offsets: Some(chunk_offsets_buf.into_array()),
743+
chunk_offsets: None,
753744
offset_within_chunk: Some(0), // Reset when creating new Patches.
754745
}))
755746
}

0 commit comments

Comments
 (0)