From 70f57ffda660f2a98a4477f1d86bf82b299a318c Mon Sep 17 00:00:00 2001 From: Clement Rey Date: Tue, 27 Aug 2024 18:04:01 +0200 Subject: [PATCH 1/2] Chunk::component_batch_raw should check the bitmap first --- crates/store/re_chunk/src/helpers.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/crates/store/re_chunk/src/helpers.rs b/crates/store/re_chunk/src/helpers.rs index 26397291cfc8..30d5ead1d9f8 100644 --- a/crates/store/re_chunk/src/helpers.rs +++ b/crates/store/re_chunk/src/helpers.rs @@ -21,15 +21,17 @@ impl Chunk { component_name: &ComponentName, row_index: usize, ) -> Option>> { - self.components.get(component_name).map(|list_array| { + self.components.get(component_name).and_then(|list_array| { if list_array.len() > row_index { - Ok(list_array.value(row_index)) + list_array + .is_valid(row_index) + .then(|| Ok(list_array.value(row_index))) } else { - Err(crate::ChunkError::IndexOutOfBounds { + Some(Err(crate::ChunkError::IndexOutOfBounds { kind: "row".to_owned(), len: list_array.len(), index: row_index, - }) + })) } }) } From 9db13450506dfc0d7c6e55680d86e14f5b9cb3c2 Mon Sep 17 00:00:00 2001 From: Clement Rey Date: Tue, 27 Aug 2024 18:14:38 +0200 Subject: [PATCH 2/2] UnitChunk too --- crates/store/re_chunk/src/helpers.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/store/re_chunk/src/helpers.rs b/crates/store/re_chunk/src/helpers.rs index 30d5ead1d9f8..f02b4b299d5c 100644 --- a/crates/store/re_chunk/src/helpers.rs +++ b/crates/store/re_chunk/src/helpers.rs @@ -260,7 +260,7 @@ impl UnitChunkShared { debug_assert!(self.num_rows() == 1); self.components .get(component_name) - .map(|list_array| list_array.value(0)) + .and_then(|list_array| list_array.is_valid(0).then(|| list_array.value(0))) } /// Returns the deserialized data for the specified component.