Skip to content

Commit

Permalink
insert_descriptor_arrow2
Browse files Browse the repository at this point in the history
  • Loading branch information
emilk committed Jan 8, 2025
1 parent 32817ba commit d98fe58
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 16 deletions.
9 changes: 3 additions & 6 deletions crates/store/re_chunk/src/batcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -734,7 +734,7 @@ impl PendingRow {
for (component_desc, array) in components {
let list_array = arrow_util::arrays_to_list_array_opt(&[Some(&*array as _)]);
if let Some(list_array) = list_array {
per_name.insert_descriptor_arrow1(component_desc, list_array);
per_name.insert_descriptor(component_desc, list_array);
}
}

Expand Down Expand Up @@ -870,10 +870,7 @@ impl PendingRow {
let list_array =
arrow_util::arrays_to_list_array_opt(&arrays);
if let Some(list_array) = list_array {
per_name.insert_descriptor_arrow1(
component_desc,
list_array,
);
per_name.insert_descriptor(component_desc, list_array);
}
}
per_name
Expand Down Expand Up @@ -918,7 +915,7 @@ impl PendingRow {
for (component_desc, arrays) in components {
let list_array = arrow_util::arrays_to_list_array_opt(&arrays);
if let Some(list_array) = list_array {
per_name.insert_descriptor_arrow1(component_desc, list_array);
per_name.insert_descriptor(component_desc, list_array);
}
}
per_name
Expand Down
4 changes: 2 additions & 2 deletions crates/store/re_chunk/src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ impl ChunkBuilder {
.map(|list_array| (component_desc, list_array))
})
{
per_name.insert_descriptor(component_desc, list_array);
per_name.insert_descriptor_arrow2(component_desc, list_array);
}
per_name
};
Expand Down Expand Up @@ -303,7 +303,7 @@ impl ChunkBuilder {
}
})
{
per_name.insert_descriptor(component_desc, list_array);
per_name.insert_descriptor_arrow2(component_desc, list_array);
}
per_name
},
Expand Down
10 changes: 5 additions & 5 deletions crates/store/re_chunk/src/chunk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ pub struct ChunkComponents(
impl ChunkComponents {
/// Like `Self::insert`, but automatically infers the [`ComponentName`] layer.
#[inline]
pub fn insert_descriptor_arrow1(
pub fn insert_descriptor(
&mut self,
component_desc: ComponentDescriptor,
list_array: ArrowListArray,
Expand All @@ -79,7 +79,7 @@ impl ChunkComponents {

/// Like `Self::insert`, but automatically infers the [`ComponentName`] layer.
#[inline]
pub fn insert_descriptor(
pub fn insert_descriptor_arrow2(
&mut self,
component_desc: ComponentDescriptor,
list_array: Arrow2ListArray<i32>,
Expand Down Expand Up @@ -161,7 +161,7 @@ impl FromIterator<(ComponentDescriptor, ArrowListArray)> for ChunkComponents {
let mut this = Self::default();
{
for (component_desc, list_array) in iter {
this.insert_descriptor(component_desc, list_array.into());
this.insert_descriptor_arrow2(component_desc, list_array.into());
}
}
this
Expand Down Expand Up @@ -190,7 +190,7 @@ impl FromIterator<(ComponentDescriptor, Arrow2ListArray<i32>)> for ChunkComponen
let mut this = Self::default();
{
for (component_desc, list_array) in iter {
this.insert_descriptor(component_desc, list_array);
this.insert_descriptor_arrow2(component_desc, list_array);
}
}
this
Expand Down Expand Up @@ -959,7 +959,7 @@ impl Chunk {
list_array: Arrow2ListArray<i32>,
) -> ChunkResult<()> {
self.components
.insert_descriptor(component_desc, list_array);
.insert_descriptor_arrow2(component_desc, list_array);
self.sanity_check()
}

Expand Down
2 changes: 1 addition & 1 deletion crates/store/re_chunk/src/merge.rs
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ impl Chunk {
let components = {
let mut per_name = ChunkComponents::default();
for (component_desc, list_array) in components {
per_name.insert_descriptor(component_desc.clone(), list_array);
per_name.insert_descriptor_arrow2(component_desc.clone(), list_array);
}
per_name
};
Expand Down
2 changes: 1 addition & 1 deletion crates/store/re_chunk/src/migration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ impl Chunk {
}

for (desc, list_array) in components_patched {
chunk.components.insert_descriptor(desc, list_array);
chunk.components.insert_descriptor_arrow2(desc, list_array);
}

chunk
Expand Down
2 changes: 1 addition & 1 deletion crates/store/re_chunk/src/transport.rs
Original file line number Diff line number Diff line change
Expand Up @@ -651,7 +651,7 @@ impl Chunk {
let component_desc = TransportChunk::component_descriptor_from_field(field);

if components
.insert_descriptor(component_desc, column.clone())
.insert_descriptor_arrow2(component_desc, column.clone())
.is_some()
{
return Err(ChunkError::Malformed {
Expand Down

0 comments on commit d98fe58

Please sign in to comment.