Skip to content

Commit

Permalink
Dataframe v2: new and improved chunk tools (#7649)
Browse files Browse the repository at this point in the history
Bunch of improvements and/or additions to the Chunk toolbox that
happened as part of the implementation of the dataframe v2 API.
  • Loading branch information
teh-cmc authored Oct 10, 2024
1 parent d66ce14 commit ab69022
Show file tree
Hide file tree
Showing 3 changed files with 548 additions and 6 deletions.
20 changes: 20 additions & 0 deletions crates/store/re_chunk/src/chunk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -705,6 +705,26 @@ impl Chunk {
}
}

/// Unconditionally inserts an [`ArrowListArray`] as a component column.
///
/// Removes and replaces the column if it already exists.
///
/// This will fail if the end result is malformed in any way -- see [`Self::sanity_check`].
#[inline]
pub fn add_component(
&mut self,
component_name: ComponentName,
list_array: ArrowListArray<i32>,
) -> ChunkResult<()> {
self.components.insert(component_name, list_array);
self.sanity_check()
}

/// Unconditionally inserts a [`TimeColumn`].
///
/// Removes and replaces the column if it already exists.
///
/// This will fail if the end result is malformed in any way -- see [`Self::sanity_check`].
#[inline]
pub fn add_timeline(&mut self, chunk_timeline: TimeColumn) -> ChunkResult<()> {
self.timelines
Expand Down
Loading

0 comments on commit ab69022

Please sign in to comment.