Btrblocks overflow with custom row block size. #5843
-
Issue DescriptionI'm seeing a crash due to Expected BehaviorNo overflow. Actual BehaviorOverflow. Reproduction StepsThe following test reproduces the issue. use vortex::{
VortexSessionDefault,
array::{
IntoArray,
arrays::ListArray,
builders::{ArrayBuilder, PrimitiveBuilder},
validity::Validity,
},
dtype::Nullability,
io::session::RuntimeSessionExt,
session::VortexSession,
};
use vortex_file::{VortexWriteOptions, WriteStrategyBuilder};
const NUM_LISTS: usize = 10_000;
const ELEMENTS_PER_LIST: usize = 5_000;
#[tokio::test]
async fn btrblocks_overflow_list_f64() {
let total_elements = NUM_LISTS * ELEMENTS_PER_LIST;
let mut offsets =
PrimitiveBuilder::<u32>::with_capacity(Nullability::NonNullable, NUM_LISTS + 1);
for i in 0..=NUM_LISTS {
offsets.append_value((i * ELEMENTS_PER_LIST) as u32);
}
let mut values =
PrimitiveBuilder::<f64>::with_capacity(Nullability::NonNullable, total_elements);
for list_idx in 0..NUM_LISTS {
for elem_idx in 0..ELEMENTS_PER_LIST {
values.append_value((list_idx * 1000 + elem_idx) as f64);
}
}
let array = ListArray::try_new(
values.finish().into_array(),
offsets.finish().into_array(),
Validity::NonNullable,
)
.unwrap();
let strategy = WriteStrategyBuilder::new()
.with_row_block_size(array.len()) // This is important to set.
.build();
let session = VortexSession::default().with_tokio();
let mut buffer = Vec::new();
let result = VortexWriteOptions::new(session)
.with_strategy(strategy)
.write(&mut buffer, array.to_array_stream())
.await;
assert!(result.is_ok(), "Write should succeed: {:?}", result.err());
}OS Version InformationmacOS I acknowledge that:
|
Beta Was this translation helpful? Give feedback.
Answered by
joseph-isaacs
Jan 5, 2026
Replies: 1 comment
-
|
Thanks for this report. fix: #5854 |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
joseph-isaacs
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks for this report. fix: #5854