Skip to content

Commit f7d9e1c

Browse files
jprochazkteh-cmc
andauthored
Time panel chunkification (#6934)
Co-authored-by: Clement Rey <cr.rey.clement@gmail.com>
1 parent 763fc0e commit f7d9e1c

File tree

33 files changed

+802
-1448
lines changed

33 files changed

+802
-1448
lines changed

crates/store/re_chunk/src/chunk.rs

+8-8
Original file line numberDiff line numberDiff line change
@@ -227,14 +227,14 @@ impl Chunk {
227227
//
228228
// TODO(cmc): This needs to be stored in chunk metadata and transported across IPC.
229229
#[inline]
230-
pub fn num_events_cumulative(&self) -> usize {
230+
pub fn num_events_cumulative(&self) -> u64 {
231231
// Reminder: component columns are sparse, we must take a look at the validity bitmaps.
232232
self.components
233233
.values()
234234
.map(|list_array| {
235235
list_array.validity().map_or_else(
236-
|| list_array.len(),
237-
|validity| validity.len() - validity.unset_bits(),
236+
|| list_array.len() as u64,
237+
|validity| validity.len() as u64 - validity.unset_bits() as u64,
238238
)
239239
})
240240
.sum()
@@ -254,7 +254,7 @@ impl Chunk {
254254
re_tracing::profile_function!();
255255

256256
if self.is_static() {
257-
return vec![(TimeInt::STATIC, self.num_events_cumulative() as u64)];
257+
return vec![(TimeInt::STATIC, self.num_events_cumulative())];
258258
}
259259

260260
let Some(time_chunk) = self.timelines().get(timeline) else {
@@ -263,7 +263,7 @@ impl Chunk {
263263

264264
let time_range = time_chunk.time_range();
265265
if time_range.min() == time_range.max() {
266-
return vec![(time_range.min(), self.num_events_cumulative() as u64)];
266+
return vec![(time_range.min(), self.num_events_cumulative())];
267267
}
268268

269269
let counts = if time_chunk.is_sorted() {
@@ -363,12 +363,12 @@ impl Chunk {
363363
//
364364
// TODO(cmc): This needs to be stored in chunk metadata and transported across IPC.
365365
#[inline]
366-
pub fn num_events_for_component(&self, component_name: ComponentName) -> Option<usize> {
366+
pub fn num_events_for_component(&self, component_name: ComponentName) -> Option<u64> {
367367
// Reminder: component columns are sparse, we must check validity bitmap.
368368
self.components.get(&component_name).map(|list_array| {
369369
list_array.validity().map_or_else(
370-
|| list_array.len(),
371-
|validity| validity.len() - validity.unset_bits(),
370+
|| list_array.len() as u64,
371+
|validity| validity.len() as u64 - validity.unset_bits() as u64,
372372
)
373373
})
374374
}

0 commit comments

Comments
 (0)