From cc869e89c05f8fefad14a318a5eee568e6a01bb7 Mon Sep 17 00:00:00 2001 From: Emil Ernerfeldt Date: Thu, 21 Nov 2024 17:19:35 +0100 Subject: [PATCH] Import arrow2-stuff under the `Arrow2*` name prefix --- crates/store/re_chunk/src/batcher.rs | 42 ++++++------ crates/store/re_chunk/src/builder.rs | 14 ++-- crates/store/re_chunk/src/chunk.rs | 56 ++++++++-------- crates/store/re_chunk/src/helpers.rs | 14 ++-- crates/store/re_chunk/src/iter.rs | 26 ++++---- crates/store/re_chunk/src/latest_at.rs | 2 +- crates/store/re_chunk/src/lib.rs | 2 +- crates/store/re_chunk/src/merge.rs | 12 ++-- crates/store/re_chunk/src/shuffle.rs | 12 ++-- crates/store/re_chunk/src/slice.rs | 38 +++++------ crates/store/re_chunk/src/transport.rs | 66 +++++++++---------- crates/store/re_chunk/src/util.rs | 18 ++--- crates/store/re_chunk/tests/memory_test.rs | 4 +- crates/store/re_chunk_store/tests/gc.rs | 4 +- crates/store/re_chunk_store/tests/reads.rs | 4 +- crates/store/re_dataframe/src/query.rs | 12 ++-- crates/store/re_log_types/src/arrow_msg.rs | 18 ++--- crates/store/re_protos/src/codec.rs | 28 ++++---- crates/store/re_query/src/latest_at.rs | 16 ++--- crates/top/rerun_c/src/arrow_utils.rs | 2 +- .../viewer/re_chunk_store_ui/src/chunk_ui.rs | 2 +- .../re_selection_panel/src/visualizer_ui.rs | 2 +- crates/viewer/re_space_view/src/query.rs | 6 +- .../viewer/re_space_view/src/results_ext.rs | 4 +- .../re_space_view/src/view_property_ui.rs | 8 +-- .../src/dataframe_ui.rs | 4 +- .../src/display_record_batch.rs | 28 ++++---- .../src/blueprint_helpers.rs | 6 +- .../src/component_ui_registry.rs | 8 +-- .../src/space_view/view_context.rs | 4 +- .../re_viewer_context/src/viewer_context.rs | 2 +- rerun_py/src/remote.rs | 2 +- 32 files changed, 234 insertions(+), 232 deletions(-) diff --git a/crates/store/re_chunk/src/batcher.rs b/crates/store/re_chunk/src/batcher.rs index 3e09dbb81c2d..f74f4dbfa221 100644 --- a/crates/store/re_chunk/src/batcher.rs +++ b/crates/store/re_chunk/src/batcher.rs @@ -5,7 +5,7 @@ use std::{ time::{Duration, Instant}, }; -use arrow2::array::{Array as ArrowArray, PrimitiveArray as ArrowPrimitiveArray}; +use arrow2::array::{Array as Arrow2Array, PrimitiveArray as Arrow2PrimitiveArray}; use crossbeam::channel::{Receiver, Sender}; use nohash_hasher::IntMap; @@ -679,14 +679,14 @@ pub struct PendingRow { /// The component data. /// /// Each array is a single component, i.e. _not_ a list array. - pub components: BTreeMap>, + pub components: BTreeMap>, } impl PendingRow { #[inline] pub fn new( timepoint: TimePoint, - components: BTreeMap>, + components: BTreeMap>, ) -> Self { Self { row_id: RowId::new(), @@ -726,7 +726,7 @@ impl PendingRow { let timelines = timepoint .into_iter() .map(|(timeline, time)| { - let times = ArrowPrimitiveArray::::from_vec(vec![time.as_i64()]); + let times = Arrow2PrimitiveArray::::from_vec(vec![time.as_i64()]); let time_column = TimeColumn::new(Some(true), timeline, times); (timeline, time_column) }) @@ -826,7 +826,7 @@ impl PendingRow { // Create all the logical list arrays that we're going to need, accounting for the // possibility of sparse components in the data. - let mut all_components: IntMap>> = + let mut all_components: IntMap>> = IntMap::default(); for row in &rows { for component_name in row.components.keys() { @@ -893,7 +893,7 @@ impl PendingRow { arrays.push( row_components .get(component_name) - .map(|array| &**array as &dyn ArrowArray), + .map(|array| &**array as &dyn Arrow2Array), ); } } @@ -967,7 +967,7 @@ impl PendingTimeColumn { TimeColumn { timeline, - times: ArrowPrimitiveArray::::from_vec(times).to(timeline.datatype()), + times: Arrow2PrimitiveArray::::from_vec(times).to(timeline.datatype()), is_sorted, time_range, } @@ -1047,7 +1047,7 @@ mod tests { TimeColumn::new( Some(true), timeline1, - ArrowPrimitiveArray::from_vec(vec![42, 43, 44]), + Arrow2PrimitiveArray::from_vec(vec![42, 43, 44]), ), )]; let expected_components = [( @@ -1203,7 +1203,7 @@ mod tests { TimeColumn::new( Some(true), timeline1, - ArrowPrimitiveArray::from_vec(vec![42, 44]), + Arrow2PrimitiveArray::from_vec(vec![42, 44]), ), )]; let expected_components = [( @@ -1231,7 +1231,7 @@ mod tests { TimeColumn::new( Some(true), timeline1, - ArrowPrimitiveArray::from_vec(vec![43]), + Arrow2PrimitiveArray::from_vec(vec![43]), ), )]; let expected_components = [( @@ -1318,7 +1318,7 @@ mod tests { TimeColumn::new( Some(true), timeline1, - ArrowPrimitiveArray::from_vec(vec![42]), + Arrow2PrimitiveArray::from_vec(vec![42]), ), )]; let expected_components = [( @@ -1347,7 +1347,7 @@ mod tests { TimeColumn::new( Some(true), timeline1, - ArrowPrimitiveArray::from_vec(vec![43, 44]), + Arrow2PrimitiveArray::from_vec(vec![43, 44]), ), ), ( @@ -1355,7 +1355,7 @@ mod tests { TimeColumn::new( Some(true), timeline2, - ArrowPrimitiveArray::from_vec(vec![1000, 1001]), + Arrow2PrimitiveArray::from_vec(vec![1000, 1001]), ), ), ]; @@ -1439,7 +1439,7 @@ mod tests { TimeColumn::new( Some(true), timeline1, - ArrowPrimitiveArray::from_vec(vec![42, 44]), + Arrow2PrimitiveArray::from_vec(vec![42, 44]), ), )]; let expected_components = [( @@ -1467,7 +1467,7 @@ mod tests { TimeColumn::new( Some(true), timeline1, - ArrowPrimitiveArray::from_vec(vec![43]), + Arrow2PrimitiveArray::from_vec(vec![43]), ), )]; let expected_components = [( @@ -1569,7 +1569,7 @@ mod tests { TimeColumn::new( Some(false), timeline1, - ArrowPrimitiveArray::from_vec(vec![45, 42, 43, 44]), + Arrow2PrimitiveArray::from_vec(vec![45, 42, 43, 44]), ), ), ( @@ -1577,7 +1577,7 @@ mod tests { TimeColumn::new( Some(false), timeline2, - ArrowPrimitiveArray::from_vec(vec![1003, 1000, 1001, 1002]), + Arrow2PrimitiveArray::from_vec(vec![1003, 1000, 1001, 1002]), ), ), ]; @@ -1683,7 +1683,7 @@ mod tests { TimeColumn::new( Some(false), timeline1, - ArrowPrimitiveArray::from_vec(vec![45, 42, 43]), + Arrow2PrimitiveArray::from_vec(vec![45, 42, 43]), ), ), ( @@ -1691,7 +1691,7 @@ mod tests { TimeColumn::new( Some(false), timeline2, - ArrowPrimitiveArray::from_vec(vec![1003, 1000, 1001]), + Arrow2PrimitiveArray::from_vec(vec![1003, 1000, 1001]), ), ), ]; @@ -1722,7 +1722,7 @@ mod tests { TimeColumn::new( Some(true), timeline1, - ArrowPrimitiveArray::from_vec(vec![44]), + Arrow2PrimitiveArray::from_vec(vec![44]), ), ), ( @@ -1730,7 +1730,7 @@ mod tests { TimeColumn::new( Some(true), timeline2, - ArrowPrimitiveArray::from_vec(vec![1002]), + Arrow2PrimitiveArray::from_vec(vec![1002]), ), ), ]; diff --git a/crates/store/re_chunk/src/builder.rs b/crates/store/re_chunk/src/builder.rs index 9da99f0924e8..306ccc369f1f 100644 --- a/crates/store/re_chunk/src/builder.rs +++ b/crates/store/re_chunk/src/builder.rs @@ -1,8 +1,8 @@ use std::collections::BTreeMap; use arrow2::{ - array::{Array as ArrowArray, PrimitiveArray as ArrowPrimitiveArray}, - datatypes::DataType as ArrowDatatype, + array::{Array as Arrow2Array, PrimitiveArray as Arrow2PrimitiveArray}, + datatypes::DataType as Arrow2Datatype, }; use itertools::Itertools; @@ -23,7 +23,7 @@ pub struct ChunkBuilder { row_ids: Vec, timelines: BTreeMap, - components: BTreeMap>>>, + components: BTreeMap>>>, } impl Chunk { @@ -63,7 +63,7 @@ impl ChunkBuilder { mut self, row_id: RowId, timepoint: impl Into, - components: impl IntoIterator>)>, + components: impl IntoIterator>)>, ) -> Self { let components = components.into_iter().collect_vec(); @@ -107,7 +107,7 @@ impl ChunkBuilder { self, row_id: RowId, timepoint: impl Into, - components: impl IntoIterator)>, + components: impl IntoIterator)>, ) -> Self { self.with_sparse_row( row_id, @@ -258,7 +258,7 @@ impl ChunkBuilder { #[inline] pub fn build_with_datatypes( self, - datatypes: &IntMap, + datatypes: &IntMap, ) -> ChunkResult { let Self { id, @@ -343,7 +343,7 @@ impl TimeColumnBuilder { pub fn build(self) -> TimeColumn { let Self { timeline, times } = self; - let times = ArrowPrimitiveArray::::from_vec(times).to(timeline.datatype()); + let times = Arrow2PrimitiveArray::::from_vec(times).to(timeline.datatype()); TimeColumn::new(None, timeline, times) } } diff --git a/crates/store/re_chunk/src/chunk.rs b/crates/store/re_chunk/src/chunk.rs index 26847f60e28f..4bbfaf833c12 100644 --- a/crates/store/re_chunk/src/chunk.rs +++ b/crates/store/re_chunk/src/chunk.rs @@ -5,8 +5,8 @@ use std::{ use arrow2::{ array::{ - Array as ArrowArray, ListArray as ArrowListArray, PrimitiveArray as ArrowPrimitiveArray, - StructArray as ArrowStructArray, + Array as Arrow2Array, ListArray as Arrow2ListArray, PrimitiveArray as Arrow2PrimitiveArray, + StructArray as Arrow2StructArray, }, Either, }; @@ -74,7 +74,7 @@ pub struct Chunk { pub(crate) is_sorted: bool, /// The respective [`RowId`]s for each row of data. - pub(crate) row_ids: ArrowStructArray, + pub(crate) row_ids: Arrow2StructArray, /// The time columns. /// @@ -90,7 +90,7 @@ pub struct Chunk { /// Sparse so that we can e.g. log a `Position` at one timestamp but not a `Color`. // // TODO(#6576): support non-list based columns? - pub(crate) components: BTreeMap>, + pub(crate) components: BTreeMap>, } impl PartialEq for Chunk { @@ -269,7 +269,7 @@ impl Chunk { // Unwrap: native RowIds cannot fail to serialize. .unwrap() .as_any() - .downcast_ref::() + .downcast_ref::() // Unwrap: RowId schema is known in advance to be a struct array -- always. .unwrap() .clone(); @@ -299,7 +299,7 @@ impl Chunk { // Unwrap: native RowIds cannot fail to serialize. .unwrap() .as_any() - .downcast_ref::() + .downcast_ref::() // Unwrap: RowId schema is known in advance to be a struct array -- always. .unwrap() .clone(); @@ -555,7 +555,7 @@ pub struct TimeColumn { /// * This is guaranteed to always be dense, because chunks are split anytime a timeline is /// added or removed. /// * This cannot ever contain `TimeInt::STATIC`, since static data doesn't even have timelines. - pub(crate) times: ArrowPrimitiveArray, + pub(crate) times: Arrow2PrimitiveArray, /// Is [`Self::times`] sorted? /// @@ -583,9 +583,9 @@ impl Chunk { id: ChunkId, entity_path: EntityPath, is_sorted: Option, - row_ids: ArrowStructArray, + row_ids: Arrow2StructArray, timelines: BTreeMap, - components: BTreeMap>, + components: BTreeMap>, ) -> ChunkResult { let mut chunk = Self { id, @@ -619,7 +619,7 @@ impl Chunk { is_sorted: Option, row_ids: &[RowId], timelines: BTreeMap, - components: BTreeMap>, + components: BTreeMap>, ) -> ChunkResult { re_tracing::profile_function!(); let row_ids = row_ids @@ -629,7 +629,7 @@ impl Chunk { reason: format!("RowIds failed to serialize: {err}"), })? .as_any() - .downcast_ref::() + .downcast_ref::() // NOTE: impossible, but better safe than sorry. .ok_or_else(|| ChunkError::Malformed { reason: "RowIds failed to downcast".to_owned(), @@ -650,7 +650,7 @@ impl Chunk { id: ChunkId, entity_path: EntityPath, timelines: BTreeMap, - components: BTreeMap>, + components: BTreeMap>, ) -> ChunkResult { let count = components .iter() @@ -680,8 +680,8 @@ impl Chunk { id: ChunkId, entity_path: EntityPath, is_sorted: Option, - row_ids: ArrowStructArray, - components: BTreeMap>, + row_ids: Arrow2StructArray, + components: BTreeMap>, ) -> ChunkResult { Self::new( id, @@ -700,13 +700,13 @@ impl Chunk { entity_path, heap_size_bytes: Default::default(), is_sorted: true, - row_ids: ArrowStructArray::new_empty(RowId::arrow2_datatype()), + row_ids: Arrow2StructArray::new_empty(RowId::arrow2_datatype()), timelines: Default::default(), components: Default::default(), } } - /// Unconditionally inserts an [`ArrowListArray`] as a component column. + /// Unconditionally inserts an [`Arrow2ListArray`] as a component column. /// /// Removes and replaces the column if it already exists. /// @@ -715,7 +715,7 @@ impl Chunk { pub fn add_component( &mut self, component_name: ComponentName, - list_array: ArrowListArray, + list_array: Arrow2ListArray, ) -> ChunkResult<()> { self.components.insert(component_name, list_array); self.sanity_check() @@ -744,7 +744,7 @@ impl TimeColumn { pub fn new( is_sorted: Option, timeline: Timeline, - times: ArrowPrimitiveArray, + times: Arrow2PrimitiveArray, ) -> Self { re_tracing::profile_function_if!(1000 < times.len(), format!("{} times", times.len())); @@ -811,7 +811,7 @@ impl TimeColumn { Self::new( None, Timeline::new_sequence(name.into()), - ArrowPrimitiveArray::::from_vec(time_vec), + Arrow2PrimitiveArray::::from_vec(time_vec), ) } @@ -838,7 +838,7 @@ impl TimeColumn { Self::new( None, Timeline::new_temporal(name.into()), - ArrowPrimitiveArray::::from_vec(time_vec), + Arrow2PrimitiveArray::::from_vec(time_vec), ) } @@ -868,7 +868,7 @@ impl TimeColumn { Self::new( None, Timeline::new_temporal(name.into()), - ArrowPrimitiveArray::::from_vec(time_vec), + Arrow2PrimitiveArray::::from_vec(time_vec), ) } } @@ -929,13 +929,13 @@ impl Chunk { } #[inline] - pub fn row_ids_array(&self) -> &ArrowStructArray { + pub fn row_ids_array(&self) -> &Arrow2StructArray { &self.row_ids } /// Returns the [`RowId`]s in their raw-est form: a tuple of (times, counters) arrays. #[inline] - pub fn row_ids_raw(&self) -> (&ArrowPrimitiveArray, &ArrowPrimitiveArray) { + pub fn row_ids_raw(&self) -> (&Arrow2PrimitiveArray, &Arrow2PrimitiveArray) { let [times, counters] = self.row_ids.values() else { panic!("RowIds are corrupt -- this should be impossible (sanity checked)"); }; @@ -943,13 +943,13 @@ impl Chunk { #[allow(clippy::unwrap_used)] let times = times .as_any() - .downcast_ref::>() + .downcast_ref::>() .unwrap(); // sanity checked #[allow(clippy::unwrap_used)] let counters = counters .as_any() - .downcast_ref::>() + .downcast_ref::>() .unwrap(); // sanity checked (times, counters) @@ -1055,7 +1055,7 @@ impl Chunk { } #[inline] - pub fn components(&self) -> &BTreeMap> { + pub fn components(&self) -> &BTreeMap> { &self.components } @@ -1098,7 +1098,7 @@ impl TimeColumn { } #[inline] - pub fn times_array(&self) -> &ArrowPrimitiveArray { + pub fn times_array(&self) -> &Arrow2PrimitiveArray { &self.times } @@ -1137,7 +1137,7 @@ impl TimeColumn { // TODO(cmc): This needs to be stored in chunk metadata and transported across IPC. pub fn time_range_per_component( &self, - components: &BTreeMap>, + components: &BTreeMap>, ) -> BTreeMap { let times = self.times_raw(); components diff --git a/crates/store/re_chunk/src/helpers.rs b/crates/store/re_chunk/src/helpers.rs index 43f89fab2bd7..c27613137e6d 100644 --- a/crates/store/re_chunk/src/helpers.rs +++ b/crates/store/re_chunk/src/helpers.rs @@ -1,6 +1,6 @@ use std::sync::Arc; -use arrow2::array::Array as ArrowArray; +use arrow2::array::Array as Arrow2Array; use re_log_types::{TimeInt, Timeline}; use re_types_core::{Component, ComponentName, SizeBytes}; @@ -20,7 +20,7 @@ impl Chunk { &self, component_name: &ComponentName, row_index: usize, - ) -> Option>> { + ) -> Option>> { self.components.get(component_name).and_then(|list_array| { if list_array.len() > row_index { list_array @@ -63,7 +63,7 @@ impl Chunk { component_name: &ComponentName, row_index: usize, instance_index: usize, - ) -> Option>> { + ) -> Option>> { let res = self.component_batch_raw(component_name, row_index)?; let array = match res { @@ -116,7 +116,7 @@ impl Chunk { &self, component_name: &ComponentName, row_index: usize, - ) -> Option>> { + ) -> Option>> { let res = self.component_batch_raw(component_name, row_index)?; let array = match res { @@ -256,7 +256,7 @@ impl UnitChunkShared { pub fn component_batch_raw( &self, component_name: &ComponentName, - ) -> Option> { + ) -> Option> { debug_assert!(self.num_rows() == 1); self.components .get(component_name) @@ -282,7 +282,7 @@ impl UnitChunkShared { &self, component_name: &ComponentName, instance_index: usize, - ) -> Option>> { + ) -> Option>> { let array = self.component_batch_raw(component_name)?; if array.len() > instance_index { Some(Ok(array.sliced(instance_index, 1))) @@ -325,7 +325,7 @@ impl UnitChunkShared { pub fn component_mono_raw( &self, component_name: &ComponentName, - ) -> Option>> { + ) -> Option>> { let array = self.component_batch_raw(component_name)?; if array.len() == 1 { Some(Ok(array.sliced(0, 1))) diff --git a/crates/store/re_chunk/src/iter.rs b/crates/store/re_chunk/src/iter.rs index 6668dcb47a46..647e311aefa8 100644 --- a/crates/store/re_chunk/src/iter.rs +++ b/crates/store/re_chunk/src/iter.rs @@ -2,9 +2,9 @@ use std::sync::Arc; use arrow2::{ array::{ - Array as ArrowArray, FixedSizeListArray as ArrowFixedSizeListArray, - ListArray as ArrowListArray, PrimitiveArray as ArrowPrimitiveArray, - Utf8Array as ArrowUtf8Array, + Array as Arrow2Array, FixedSizeListArray as Arrow2FixedSizeListArray, + ListArray as Arrow2ListArray, PrimitiveArray as Arrow2PrimitiveArray, + Utf8Array as Arrow2Utf8Array, }, Either, }; @@ -212,7 +212,7 @@ impl Chunk { pub fn iter_component_arrays( &self, component_name: &ComponentName, - ) -> impl Iterator> + '_ { + ) -> impl Iterator> + '_ { let Some(list_array) = self.components.get(component_name) else { return Either::Left(std::iter::empty()); }; @@ -246,7 +246,7 @@ impl Chunk { let Some(values) = list_array .values() .as_any() - .downcast_ref::>() + .downcast_ref::>() else { if cfg!(debug_assertions) { panic!("downcast failed for {component_name}, data discarded"); @@ -291,7 +291,7 @@ impl Chunk { let Some(fixed_size_list_array) = list_array .values() .as_any() - .downcast_ref::() + .downcast_ref::() else { if cfg!(debug_assertions) { panic!("downcast failed for {component_name}, data discarded"); @@ -304,7 +304,7 @@ impl Chunk { let Some(values) = fixed_size_list_array .values() .as_any() - .downcast_ref::>() + .downcast_ref::>() else { if cfg!(debug_assertions) { panic!("downcast failed for {component_name}, data discarded"); @@ -353,7 +353,7 @@ impl Chunk { let Some(inner_list_array) = list_array .values() .as_any() - .downcast_ref::>() + .downcast_ref::>() else { if cfg!(debug_assertions) { panic!("downcast failed for {component_name}, data discarded"); @@ -369,7 +369,7 @@ impl Chunk { let Some(fixed_size_list_array) = inner_list_array .values() .as_any() - .downcast_ref::() + .downcast_ref::() else { if cfg!(debug_assertions) { panic!("downcast failed for {component_name}, data discarded"); @@ -382,7 +382,7 @@ impl Chunk { let Some(values) = fixed_size_list_array .values() .as_any() - .downcast_ref::>() + .downcast_ref::>() else { if cfg!(debug_assertions) { panic!("downcast failed for {component_name}, data discarded"); @@ -435,7 +435,7 @@ impl Chunk { let Some(utf8_array) = list_array .values() .as_any() - .downcast_ref::>() + .downcast_ref::>() else { if cfg!(debug_assertions) { panic!("downcast failed for {component_name}, data discarded"); @@ -486,7 +486,7 @@ impl Chunk { let Some(inner_list_array) = list_array .values() .as_any() - .downcast_ref::>() + .downcast_ref::>() else { if cfg!(debug_assertions) { panic!("downcast failed for {component_name}, data discarded"); @@ -499,7 +499,7 @@ impl Chunk { let Some(values) = inner_list_array .values() .as_any() - .downcast_ref::>() + .downcast_ref::>() else { if cfg!(debug_assertions) { panic!("downcast failed for {component_name}, data discarded"); diff --git a/crates/store/re_chunk/src/latest_at.rs b/crates/store/re_chunk/src/latest_at.rs index e4427a7e3a81..c9aa831f6085 100644 --- a/crates/store/re_chunk/src/latest_at.rs +++ b/crates/store/re_chunk/src/latest_at.rs @@ -1,4 +1,4 @@ -use arrow2::array::Array as ArrowArray; +use arrow2::array::Array as Arrow2Array; use re_log_types::{TimeInt, Timeline}; use re_types_core::ComponentName; diff --git a/crates/store/re_chunk/src/lib.rs b/crates/store/re_chunk/src/lib.rs index d04bada784bb..f239dc416266 100644 --- a/crates/store/re_chunk/src/lib.rs +++ b/crates/store/re_chunk/src/lib.rs @@ -40,7 +40,7 @@ pub use self::batcher::{ // Re-exports #[doc(no_inline)] -pub use arrow2::array::Array as ArrowArray; +pub use arrow2::array::Array as Arrow2Array; #[doc(no_inline)] pub use re_log_types::{EntityPath, TimeInt, TimePoint, Timeline, TimelineName}; #[doc(no_inline)] diff --git a/crates/store/re_chunk/src/merge.rs b/crates/store/re_chunk/src/merge.rs index 4ba2ceba41a9..c4f0e2e8c4b4 100644 --- a/crates/store/re_chunk/src/merge.rs +++ b/crates/store/re_chunk/src/merge.rs @@ -1,8 +1,8 @@ use std::collections::BTreeMap; use arrow2::array::{ - Array as ArrowArray, ListArray as ArrowListArray, PrimitiveArray as ArrowPrimitiveArray, - StructArray as ArrowStructArray, + Array as Arrow2Array, ListArray as Arrow2ListArray, PrimitiveArray as Arrow2PrimitiveArray, + StructArray as Arrow2StructArray, }; use itertools::{izip, Itertools}; @@ -52,7 +52,7 @@ impl Chunk { // concatenating 2 RowId arrays must yield another RowId array row_ids .as_any() - .downcast_ref::() + .downcast_ref::() .unwrap() .clone() }; @@ -90,7 +90,7 @@ impl Chunk { crate::util::concat_arrays(&[lhs_list_array, rhs_list_array]).ok()?; let list_array = list_array .as_any() - .downcast_ref::>()? + .downcast_ref::>()? .clone(); Some((*component_name, list_array)) @@ -132,7 +132,7 @@ impl Chunk { crate::util::concat_arrays(&[lhs_list_array, rhs_list_array]).ok()?; let list_array = list_array .as_any() - .downcast_ref::>()? + .downcast_ref::>()? .clone(); Some((*component_name, list_array)) @@ -257,7 +257,7 @@ impl TimeColumn { let times = crate::util::concat_arrays(&[&self.times, &rhs.times]).ok()?; let times = times .as_any() - .downcast_ref::>()? + .downcast_ref::>()? .clone(); Some(Self { diff --git a/crates/store/re_chunk/src/shuffle.rs b/crates/store/re_chunk/src/shuffle.rs index c0df428cb24b..8600964576da 100644 --- a/crates/store/re_chunk/src/shuffle.rs +++ b/crates/store/re_chunk/src/shuffle.rs @@ -1,6 +1,6 @@ use arrow2::{ array::{ - Array as ArrowArray, ListArray as ArrowListArray, PrimitiveArray as ArrowPrimitiveArray, + Array as Arrow2Array, ListArray as Arrow2ListArray, PrimitiveArray as Arrow2PrimitiveArray, StructArray, }, offset::Offsets as ArrowOffsets, @@ -212,8 +212,8 @@ impl Chunk { sorted_counters[to] = counters[from]; } - let times = ArrowPrimitiveArray::::from_vec(sorted_times).boxed(); - let counters = ArrowPrimitiveArray::::from_vec(sorted_counters).boxed(); + let times = Arrow2PrimitiveArray::::from_vec(sorted_times).boxed(); + let counters = Arrow2PrimitiveArray::::from_vec(sorted_counters).boxed(); self.row_ids = StructArray::new( self.row_ids.data_type().clone(), @@ -250,7 +250,7 @@ impl Chunk { } *is_sorted = sorted.windows(2).all(|times| times[0] <= times[1]); - *times = ArrowPrimitiveArray::::from_vec(sorted).to(timeline.datatype()); + *times = Arrow2PrimitiveArray::::from_vec(sorted).to(timeline.datatype()); } } @@ -267,7 +267,7 @@ impl Chunk { .collect_vec(); let sorted_arrays = sorted_arrays .iter() - .map(|array| &**array as &dyn ArrowArray) + .map(|array| &**array as &dyn Arrow2Array) .collect_vec(); let datatype = original.data_type().clone(); @@ -281,7 +281,7 @@ impl Chunk { .validity() .map(|validity| swaps.iter().map(|&from| validity.get_bit(from)).collect()); - *original = ArrowListArray::::new(datatype, offsets.into(), values, validity); + *original = Arrow2ListArray::::new(datatype, offsets.into(), values, validity); } } diff --git a/crates/store/re_chunk/src/slice.rs b/crates/store/re_chunk/src/slice.rs index 8e7f3fe4a427..6a3728c3fcef 100644 --- a/crates/store/re_chunk/src/slice.rs +++ b/crates/store/re_chunk/src/slice.rs @@ -1,6 +1,6 @@ use arrow2::array::{ - Array as ArrowArray, BooleanArray as ArrowBooleanArray, ListArray as ArrowListArray, - PrimitiveArray as ArrowPrimitiveArray, StructArray as ArrowStructArray, + Array as Arrow2Array, BooleanArray as Arrow2BooleanArray, ListArray as Arrow2ListArray, + PrimitiveArray as Arrow2PrimitiveArray, StructArray as Arrow2StructArray, }; use itertools::Itertools; @@ -26,7 +26,7 @@ impl Chunk { &self, row_id: RowId, component_name: &ComponentName, - ) -> Option> { + ) -> Option> { let list_array = self.components.get(component_name)?; if self.is_sorted() { @@ -352,7 +352,7 @@ impl Chunk { let mask = validity.iter().collect_vec(); let is_sorted = *is_sorted || (mask.iter().filter(|&&b| b).count() < 2); - let validity_filter = ArrowBooleanArray::from_slice(mask); + let validity_filter = Arrow2BooleanArray::from_slice(mask); let mut chunk = Self { id: *id, @@ -378,7 +378,7 @@ impl Chunk { filtered .with_validity(None) .as_any() - .downcast_ref::>() + .downcast_ref::>() // Unwrap: cannot possibly fail -- going from a ListArray back to a ListArray. .unwrap() .clone() @@ -440,7 +440,7 @@ impl Chunk { entity_path: entity_path.clone(), heap_size_bytes: Default::default(), is_sorted: true, - row_ids: ArrowStructArray::new_empty(row_ids.data_type().clone()), + row_ids: Arrow2StructArray::new_empty(row_ids.data_type().clone()), timelines: timelines .iter() .map(|(&timeline, time_column)| (timeline, time_column.emptied())) @@ -450,7 +450,7 @@ impl Chunk { .map(|(&component_name, list_array)| { ( component_name, - ArrowListArray::new_empty(list_array.data_type().clone()), + Arrow2ListArray::new_empty(list_array.data_type().clone()), ) }) .collect(), @@ -528,7 +528,7 @@ impl Chunk { i.saturating_sub(1) as i32 }) .collect_vec(); - ArrowPrimitiveArray::::from_vec(indices) + Arrow2PrimitiveArray::::from_vec(indices) }; let chunk = Self { @@ -575,7 +575,7 @@ impl Chunk { /// WARNING: the returned chunk has the same old [`crate::ChunkId`]! Change it with [`Self::with_id`]. #[must_use] #[inline] - pub fn filtered(&self, filter: &ArrowBooleanArray) -> Option { + pub fn filtered(&self, filter: &Arrow2BooleanArray) -> Option { let Self { id, entity_path, @@ -661,7 +661,7 @@ impl Chunk { /// WARNING: the returned chunk has the same old [`crate::ChunkId`]! Change it with [`Self::with_id`]. #[must_use] #[inline] - pub fn taken(&self, indices: &ArrowPrimitiveArray) -> Self { + pub fn taken(&self, indices: &Arrow2PrimitiveArray) -> Self { let Self { id, entity_path, @@ -785,7 +785,7 @@ impl TimeColumn { Self::new( is_sorted_opt, *timeline, - ArrowPrimitiveArray::sliced(times.clone(), index, len), + Arrow2PrimitiveArray::sliced(times.clone(), index, len), ) } @@ -804,7 +804,7 @@ impl TimeColumn { Self::new( Some(true), *timeline, - ArrowPrimitiveArray::new_empty(times.data_type().clone()), + Arrow2PrimitiveArray::new_empty(times.data_type().clone()), ) } @@ -812,7 +812,7 @@ impl TimeColumn { /// /// [filter]: arrow2::compute::filter::filter #[inline] - pub(crate) fn filtered(&self, filter: &ArrowBooleanArray) -> Self { + pub(crate) fn filtered(&self, filter: &Arrow2BooleanArray) -> Self { let Self { timeline, times, @@ -850,7 +850,7 @@ impl TimeColumn { /// /// [take]: arrow2::compute::take::take #[inline] - pub(crate) fn taken(&self, indices: &ArrowPrimitiveArray) -> Self { + pub(crate) fn taken(&self, indices: &Arrow2PrimitiveArray) -> Self { let Self { timeline, times, @@ -1363,7 +1363,7 @@ mod tests { // basic { - let filter = ArrowBooleanArray::from_slice( + let filter = Arrow2BooleanArray::from_slice( (0..chunk.num_rows()).map(|i| i % 2 == 0).collect_vec(), ); let got = chunk.filtered(&filter).unwrap(); @@ -1394,7 +1394,7 @@ mod tests { // shorter { - let filter = ArrowBooleanArray::from_slice( + let filter = Arrow2BooleanArray::from_slice( (0..chunk.num_rows() / 2).map(|i| i % 2 == 0).collect_vec(), ); let got = chunk.filtered(&filter); @@ -1403,7 +1403,7 @@ mod tests { // longer { - let filter = ArrowBooleanArray::from_slice( + let filter = Arrow2BooleanArray::from_slice( (0..chunk.num_rows() * 2).map(|i| i % 2 == 0).collect_vec(), ); let got = chunk.filtered(&filter); @@ -1508,7 +1508,7 @@ mod tests { // basic { - let indices = ArrowPrimitiveArray::::from_vec( + let indices = Arrow2PrimitiveArray::::from_vec( (0..chunk.num_rows() as i32) .filter(|i| i % 2 == 0) .collect_vec(), @@ -1541,7 +1541,7 @@ mod tests { // repeated { - let indices = ArrowPrimitiveArray::::from_vec( + let indices = Arrow2PrimitiveArray::::from_vec( std::iter::repeat(2i32) .take(chunk.num_rows() * 2) .collect_vec(), diff --git a/crates/store/re_chunk/src/transport.rs b/crates/store/re_chunk/src/transport.rs index c00753caa556..57d0a70a063f 100644 --- a/crates/store/re_chunk/src/transport.rs +++ b/crates/store/re_chunk/src/transport.rs @@ -2,13 +2,13 @@ use std::collections::BTreeMap; use arrow2::{ array::{ - Array as ArrowArray, ListArray, PrimitiveArray as ArrowPrimitiveArray, - StructArray as ArrowStructArray, + Array as Arrow2Array, ListArray, PrimitiveArray as Arrow2PrimitiveArray, + StructArray as Arrow2StructArray, }, - chunk::Chunk as ArrowChunk, + chunk::Chunk as Arrow2Chunk, datatypes::{ DataType as ArrowDatatype, Field as ArrowField, Metadata as ArrowMetadata, - Schema as ArrowSchema, TimeUnit as ArrowTimeUnit, + Schema as Arrow2Schema, TimeUnit as ArrowTimeUnit, }, }; @@ -36,10 +36,10 @@ pub struct TransportChunk { /// /// Take a look at the `TransportChunk::CHUNK_METADATA_*` and `TransportChunk::FIELD_METADATA_*` /// constants for more information about available metadata. - pub schema: ArrowSchema, + pub schema: Arrow2Schema, /// All the control, time and component data. - pub data: ArrowChunk>, + pub data: Arrow2Chunk>, } impl std::fmt::Display for TransportChunk { @@ -57,38 +57,38 @@ impl std::fmt::Display for TransportChunk { // TODO(#6572): Relying on Arrow's native schema metadata feature is bound to fail, we need to // switch to something more powerful asap. impl TransportChunk { - /// The key used to identify a Rerun [`ChunkId`] in chunk-level [`ArrowSchema`] metadata. + /// The key used to identify a Rerun [`ChunkId`] in chunk-level [`Arrow2Schema`] metadata. pub const CHUNK_METADATA_KEY_ID: &'static str = "rerun.id"; - /// The key used to identify a Rerun [`EntityPath`] in chunk-level [`ArrowSchema`] metadata. + /// The key used to identify a Rerun [`EntityPath`] in chunk-level [`Arrow2Schema`] metadata. pub const CHUNK_METADATA_KEY_ENTITY_PATH: &'static str = "rerun.entity_path"; /// The key used to identify the size in bytes of the data, once loaded in memory, in chunk-level - /// [`ArrowSchema`] metadata. + /// [`Arrow2Schema`] metadata. pub const CHUNK_METADATA_KEY_HEAP_SIZE_BYTES: &'static str = "rerun.heap_size_bytes"; - /// The marker used to identify whether a chunk is sorted in chunk-level [`ArrowSchema`] metadata. + /// The marker used to identify whether a chunk is sorted in chunk-level [`Arrow2Schema`] metadata. /// /// The associated value is irrelevant -- if this marker is present, then it is true. /// /// Chunks are ascendingly sorted by their `RowId` column. pub const CHUNK_METADATA_MARKER_IS_SORTED_BY_ROW_ID: &'static str = "rerun.is_sorted"; - /// The key used to identify the kind of a Rerun column in field-level [`ArrowSchema`] metadata. + /// The key used to identify the kind of a Rerun column in field-level [`Arrow2Schema`] metadata. /// /// That is: control columns (e.g. `row_id`), time columns or component columns. pub const FIELD_METADATA_KEY_KIND: &'static str = "rerun.kind"; - /// The value used to identify a Rerun time column in field-level [`ArrowSchema`] metadata. + /// The value used to identify a Rerun time column in field-level [`Arrow2Schema`] metadata. pub const FIELD_METADATA_VALUE_KIND_TIME: &'static str = "time"; - /// The value used to identify a Rerun control column in field-level [`ArrowSchema`] metadata. + /// The value used to identify a Rerun control column in field-level [`Arrow2Schema`] metadata. pub const FIELD_METADATA_VALUE_KIND_CONTROL: &'static str = "control"; - /// The value used to identify a Rerun data column in field-level [`ArrowSchema`] metadata. + /// The value used to identify a Rerun data column in field-level [`Arrow2Schema`] metadata. pub const FIELD_METADATA_VALUE_KIND_DATA: &'static str = "data"; - /// The marker used to identify whether a column is sorted in field-level [`ArrowSchema`] metadata. + /// The marker used to identify whether a column is sorted in field-level [`Arrow2Schema`] metadata. /// /// The associated value is irrelevant -- if this marker is present, then it is true. /// @@ -98,7 +98,7 @@ impl TransportChunk { pub const FIELD_METADATA_MARKER_IS_SORTED_BY_TIME: &'static str = Self::CHUNK_METADATA_MARKER_IS_SORTED_BY_ROW_ID; - /// Returns the appropriate chunk-level [`ArrowSchema`] metadata for a Rerun [`ChunkId`]. + /// Returns the appropriate chunk-level [`Arrow2Schema`] metadata for a Rerun [`ChunkId`]. #[inline] pub fn chunk_metadata_id(id: ChunkId) -> ArrowMetadata { [ @@ -110,7 +110,7 @@ impl TransportChunk { .into() } - /// Returns the appropriate chunk-level [`ArrowSchema`] metadata for the in-memory size in bytes. + /// Returns the appropriate chunk-level [`Arrow2Schema`] metadata for the in-memory size in bytes. #[inline] pub fn chunk_metadata_heap_size_bytes(heap_size_bytes: u64) -> ArrowMetadata { [ @@ -122,7 +122,7 @@ impl TransportChunk { .into() } - /// Returns the appropriate chunk-level [`ArrowSchema`] metadata for a Rerun [`EntityPath`]. + /// Returns the appropriate chunk-level [`Arrow2Schema`] metadata for a Rerun [`EntityPath`]. #[inline] pub fn chunk_metadata_entity_path(entity_path: &EntityPath) -> ArrowMetadata { [ @@ -134,7 +134,7 @@ impl TransportChunk { .into() } - /// Returns the appropriate chunk-level [`ArrowSchema`] metadata for an `IS_SORTED` marker. + /// Returns the appropriate chunk-level [`Arrow2Schema`] metadata for an `IS_SORTED` marker. #[inline] pub fn chunk_metadata_is_sorted() -> ArrowMetadata { [ @@ -146,7 +146,7 @@ impl TransportChunk { .into() } - /// Returns the appropriate field-level [`ArrowSchema`] metadata for a Rerun time column. + /// Returns the appropriate field-level [`Arrow2Schema`] metadata for a Rerun time column. #[inline] pub fn field_metadata_time_column() -> ArrowMetadata { [ @@ -158,7 +158,7 @@ impl TransportChunk { .into() } - /// Returns the appropriate field-level [`ArrowSchema`] metadata for a Rerun control column. + /// Returns the appropriate field-level [`Arrow2Schema`] metadata for a Rerun control column. #[inline] pub fn field_metadata_control_column() -> ArrowMetadata { [ @@ -170,7 +170,7 @@ impl TransportChunk { .into() } - /// Returns the appropriate field-level [`ArrowSchema`] metadata for a Rerun data column. + /// Returns the appropriate field-level [`Arrow2Schema`] metadata for a Rerun data column. #[inline] pub fn field_metadata_data_column() -> ArrowMetadata { [ @@ -182,7 +182,7 @@ impl TransportChunk { .into() } - /// Returns the appropriate field-level [`ArrowSchema`] metadata for an `IS_SORTED` marker. + /// Returns the appropriate field-level [`Arrow2Schema`] metadata for an `IS_SORTED` marker. #[inline] pub fn field_metadata_is_sorted() -> ArrowMetadata { [ @@ -259,7 +259,7 @@ impl TransportChunk { pub fn columns<'a>( &'a self, kind: &'a str, - ) -> impl Iterator)> + 'a { + ) -> impl Iterator)> + 'a { self.schema .fields .iter() @@ -273,7 +273,7 @@ impl TransportChunk { } #[inline] - pub fn all_columns(&self) -> impl Iterator)> + '_ { + pub fn all_columns(&self) -> impl Iterator)> + '_ { self.schema .fields .iter() @@ -283,19 +283,19 @@ impl TransportChunk { /// Iterates all control columns present in this chunk. #[inline] - pub fn controls(&self) -> impl Iterator)> { + pub fn controls(&self) -> impl Iterator)> { self.columns(Self::FIELD_METADATA_VALUE_KIND_CONTROL) } /// Iterates all data columns present in this chunk. #[inline] - pub fn components(&self) -> impl Iterator)> { + pub fn components(&self) -> impl Iterator)> { self.columns(Self::FIELD_METADATA_VALUE_KIND_DATA) } /// Iterates all timeline columns present in this chunk. #[inline] - pub fn timelines(&self) -> impl Iterator)> { + pub fn timelines(&self) -> impl Iterator)> { self.columns(Self::FIELD_METADATA_VALUE_KIND_TIME) } @@ -349,7 +349,7 @@ impl Chunk { components, } = self; - let mut schema = ArrowSchema::default(); + let mut schema = Arrow2Schema::default(); let mut columns = Vec::with_capacity(1 /* row_ids */ + timelines.len() + components.len()); // Chunk-level metadata @@ -437,7 +437,7 @@ impl Chunk { Ok(TransportChunk { schema, - data: ArrowChunk::new(columns), + data: Arrow2Chunk::new(columns), }) } @@ -472,7 +472,7 @@ impl Chunk { row_ids .as_any() - .downcast_ref::() + .downcast_ref::() .ok_or_else(|| ChunkError::Malformed { reason: format!( "RowId data has the wrong datatype: expected {:?} but got {:?} instead", @@ -509,7 +509,7 @@ impl Chunk { let times = column .as_any() - .downcast_ref::>() + .downcast_ref::>() .ok_or_else(|| ChunkError::Malformed { reason: format!( "time column '{}' is not deserializable ({:?})", @@ -653,7 +653,7 @@ mod tests { TimeColumn::new( Some(true), timeline1, - ArrowPrimitiveArray::::from_vec(vec![42, 43, 44, 45]), + Arrow2PrimitiveArray::::from_vec(vec![42, 43, 44, 45]), ), )) .collect(); diff --git a/crates/store/re_chunk/src/util.rs b/crates/store/re_chunk/src/util.rs index dbbe5ffc786b..32004a473ecc 100644 --- a/crates/store/re_chunk/src/util.rs +++ b/crates/store/re_chunk/src/util.rs @@ -1,6 +1,6 @@ use arrow2::{ array::{ - Array as ArrowArray, BooleanArray as ArrowBooleanArray, + Array as Arrow2Array, BooleanArray as ArrowBooleanArray, DictionaryArray as ArrowDictionaryArray, ListArray as ArrowListArray, PrimitiveArray as ArrowPrimitiveArray, }, @@ -42,7 +42,9 @@ pub fn is_list_array_semantically_empty(list_array: &ArrowListArray) -> boo /// /// Returns `None` if `arrays` is empty. #[inline] -pub fn arrays_to_list_array_opt(arrays: &[Option<&dyn ArrowArray>]) -> Option> { +pub fn arrays_to_list_array_opt( + arrays: &[Option<&dyn Arrow2Array>], +) -> Option> { let datatype = arrays .iter() .flatten() @@ -58,7 +60,7 @@ pub fn arrays_to_list_array_opt(arrays: &[Option<&dyn ArrowArray>]) -> Option], + arrays: &[Option<&dyn Arrow2Array>], ) -> Option> { let arrays_dense = arrays.iter().flatten().copied().collect_vec(); @@ -108,7 +110,7 @@ pub fn arrays_to_list_array( // on the cardinality of the input arrays. pub fn arrays_to_dictionary( array_datatype: &ArrowDatatype, - arrays: &[Option<(Idx, &dyn ArrowArray)>], + arrays: &[Option<(Idx, &dyn Arrow2Array)>], ) -> Option> { // Dedupe the input arrays based on the given primary key. let arrays_dense_deduped = arrays @@ -329,7 +331,7 @@ pub fn new_list_array_of_empties(child_datatype: ArrowDatatype, len: usize) -> A /// Returns an error if the arrays don't share the exact same datatype. /// /// [concatenate]: arrow2::compute::concatenate::concatenate -pub fn concat_arrays(arrays: &[&dyn ArrowArray]) -> arrow2::error::Result> { +pub fn concat_arrays(arrays: &[&dyn Arrow2Array]) -> arrow2::error::Result> { if arrays.len() == 1 { return Ok(arrays[0].to_boxed()); } @@ -350,7 +352,7 @@ pub fn concat_arrays(arrays: &[&dyn ArrowArray]) -> arrow2::error::Result(array: &A, filter: &ArrowBooleanArray) -> A { +pub fn filter_array(array: &A, filter: &ArrowBooleanArray) -> A { assert_eq!( array.len(), filter.len(), "the length of the filter must match the length of the array (the underlying kernel will panic otherwise)", @@ -388,7 +390,7 @@ pub fn filter_array(array: &A, filter: &ArrowBooleanArray // That is not possible with vanilla `ListArray`s since they don't expose any way to encode optional lengths, // in addition to offsets. // For internal stuff, we could perhaps provide a custom implementation that returns a `DictionaryArray` instead? -pub fn take_array( +pub fn take_array( array: &A, indices: &ArrowPrimitiveArray, ) -> A { @@ -453,7 +455,7 @@ pub fn concatenate_record_batches( let array = concat_arrays( &batches .iter() - .map(|batch| &*batch.data[i] as &dyn ArrowArray) + .map(|batch| &*batch.data[i] as &dyn Arrow2Array) .collect_vec(), )?; arrays.push(array); diff --git a/crates/store/re_chunk/tests/memory_test.rs b/crates/store/re_chunk/tests/memory_test.rs index 53cab3fbf2e7..227db18de96b 100644 --- a/crates/store/re_chunk/tests/memory_test.rs +++ b/crates/store/re_chunk/tests/memory_test.rs @@ -56,7 +56,7 @@ fn memory_use(run: impl Fn() -> R) -> (R, usize) { use arrow2::{ array::{ - Array as ArrowArray, BooleanArray as ArrowBooleanArray, ListArray as ArrowListArray, + Array as Arrow2Array, BooleanArray as ArrowBooleanArray, ListArray as ArrowListArray, PrimitiveArray as ArrowPrimitiveArray, }, offset::Offsets as ArrowOffsets, @@ -86,7 +86,7 @@ fn concat_does_allocate() { let unconcatenated_refs = unconcatenated .0 .iter() - .map(|a| &**a as &dyn ArrowArray) + .map(|a| &**a as &dyn Arrow2Array) .collect_vec(); let concatenated = diff --git a/crates/store/re_chunk_store/tests/gc.rs b/crates/store/re_chunk_store/tests/gc.rs index 9e1bd7d0463f..cc3e0601b170 100644 --- a/crates/store/re_chunk_store/tests/gc.rs +++ b/crates/store/re_chunk_store/tests/gc.rs @@ -1,6 +1,6 @@ use std::sync::Arc; -use arrow2::array::Array as ArrowArray; +use arrow2::array::Array as Arrow2Array; use rand::Rng as _; use re_chunk::{Chunk, ChunkId, ComponentName, LatestAtQuery, RowId, TimeInt, TimePoint}; @@ -23,7 +23,7 @@ fn query_latest_array( entity_path: &EntityPath, component_name: ComponentName, query: &LatestAtQuery, -) -> Option<(TimeInt, RowId, Box)> { +) -> Option<(TimeInt, RowId, Box)> { re_tracing::profile_function!(); let ((data_time, row_id), unit) = store diff --git a/crates/store/re_chunk_store/tests/reads.rs b/crates/store/re_chunk_store/tests/reads.rs index e94eb426183e..d8c6370bfc2e 100644 --- a/crates/store/re_chunk_store/tests/reads.rs +++ b/crates/store/re_chunk_store/tests/reads.rs @@ -1,6 +1,6 @@ use std::sync::Arc; -use arrow2::array::Array as ArrowArray; +use arrow2::array::Array as Arrow2Array; use itertools::Itertools; use re_chunk::{Chunk, ChunkId, RowId, TimePoint}; @@ -23,7 +23,7 @@ fn query_latest_array( entity_path: &EntityPath, component_name: ComponentName, query: &LatestAtQuery, -) -> Option<(TimeInt, RowId, Box)> { +) -> Option<(TimeInt, RowId, Box)> { re_tracing::profile_function!(); let ((data_time, row_id), unit) = store diff --git a/crates/store/re_dataframe/src/query.rs b/crates/store/re_dataframe/src/query.rs index ae0d24f26dbd..3e8e4ce726b9 100644 --- a/crates/store/re_dataframe/src/query.rs +++ b/crates/store/re_dataframe/src/query.rs @@ -8,7 +8,7 @@ use std::{ use arrow2::{ array::{ - Array as ArrowArray, BooleanArray as ArrowBooleanArray, + Array as Arrow2Array, BooleanArray as ArrowBooleanArray, PrimitiveArray as ArrowPrimitiveArray, }, chunk::Chunk as ArrowChunk, @@ -791,7 +791,7 @@ impl QueryHandle { /// } /// ``` #[inline] - pub fn next_row(&self) -> Option>> { + pub fn next_row(&self) -> Option>> { self.engine .with(|store, cache| self._next_row(store, cache)) } @@ -814,7 +814,7 @@ impl QueryHandle { #[cfg(not(target_arch = "wasm32"))] pub fn next_row_async( &self, - ) -> impl std::future::Future>>> + ) -> impl std::future::Future>>> where E: 'static + Send + Clone, { @@ -853,7 +853,7 @@ impl QueryHandle { &self, store: &ChunkStore, cache: &QueryCache, - ) -> Option>> { + ) -> Option>> { re_tracing::profile_function!(); /// Temporary state used to resolve the streaming join for the current iteration. @@ -1253,13 +1253,13 @@ impl QueryHandle { impl QueryHandle { /// Returns an iterator backed by [`Self::next_row`]. #[allow(clippy::should_implement_trait)] // we need an anonymous closure, this won't work - pub fn iter(&self) -> impl Iterator>> + '_ { + pub fn iter(&self) -> impl Iterator>> + '_ { std::iter::from_fn(move || self.next_row()) } /// Returns an iterator backed by [`Self::next_row`]. #[allow(clippy::should_implement_trait)] // we need an anonymous closure, this won't work - pub fn into_iter(self) -> impl Iterator>> { + pub fn into_iter(self) -> impl Iterator>> { std::iter::from_fn(move || self.next_row()) } diff --git a/crates/store/re_log_types/src/arrow_msg.rs b/crates/store/re_log_types/src/arrow_msg.rs index 09fdc9eeac7b..d680ec5aa2b0 100644 --- a/crates/store/re_log_types/src/arrow_msg.rs +++ b/crates/store/re_log_types/src/arrow_msg.rs @@ -1,17 +1,17 @@ //! [`ArrowMsg`] is the [`crate::LogMsg`] sub-type containing an Arrow payload. //! //! We have custom implementations of [`serde::Serialize`] and [`serde::Deserialize`] that wraps -//! the inner Arrow serialization of [`ArrowSchema`] and [`ArrowChunk`]. +//! the inner Arrow serialization of [`Arrow2Schema`] and [`Arrow2Chunk`]. use std::sync::Arc; use crate::TimePoint; use arrow2::{ - array::Array as ArrowArray, chunk::Chunk as ArrowChunk, datatypes::Schema as ArrowSchema, + array::Array as Arrow2Array, chunk::Chunk as Arrow2Chunk, datatypes::Schema as Arrow2Schema, }; /// An arbitrary callback to be run when an [`ArrowMsg`], and more specifically the -/// [`ArrowChunk`] within it, goes out of scope. +/// [`Arrow2Chunk`] within it, goes out of scope. /// /// If the [`ArrowMsg`] has been cloned in a bunch of places, the callback will run for each and /// every instance. @@ -20,10 +20,10 @@ use arrow2::{ // TODO(#6412): probably don't need this anymore. #[allow(clippy::type_complexity)] #[derive(Clone)] -pub struct ArrowChunkReleaseCallback(Arc>) + Send + Sync>); +pub struct ArrowChunkReleaseCallback(Arc>) + Send + Sync>); impl std::ops::Deref for ArrowChunkReleaseCallback { - type Target = dyn Fn(ArrowChunk>) + Send + Sync; + type Target = dyn Fn(Arrow2Chunk>) + Send + Sync; #[inline] fn deref(&self) -> &Self::Target { @@ -33,7 +33,7 @@ impl std::ops::Deref for ArrowChunkReleaseCallback { impl From for ArrowChunkReleaseCallback where - F: Fn(ArrowChunk>) + Send + Sync + 'static, + F: Fn(Arrow2Chunk>) + Send + Sync + 'static, { #[inline] fn from(f: F) -> Self { @@ -80,10 +80,10 @@ pub struct ArrowMsg { pub timepoint_max: TimePoint, /// Schema for all control & data columns. - pub schema: ArrowSchema, + pub schema: Arrow2Schema, /// Data for all control & data columns. - pub chunk: ArrowChunk>, + pub chunk: Arrow2Chunk>, // pub on_release: Option>, pub on_release: Option, @@ -183,7 +183,7 @@ impl<'de> serde::Deserialize<'de> for ArrowMsg { .map_err(|err| serde::de::Error::custom(format!("Arrow error: {err}")))?; if chunks.is_empty() { - return Err(serde::de::Error::custom("No ArrowChunk found in stream")); + return Err(serde::de::Error::custom("No Arrow2Chunk found in stream")); } if chunks.len() > 1 { return Err(serde::de::Error::custom(format!( diff --git a/crates/store/re_protos/src/codec.rs b/crates/store/re_protos/src/codec.rs index 9b7317d7e92d..9503246efc10 100644 --- a/crates/store/re_protos/src/codec.rs +++ b/crates/store/re_protos/src/codec.rs @@ -1,7 +1,7 @@ -use arrow2::array::Array as ArrowArray; -use arrow2::chunk::Chunk as ArrowChunk; -use arrow2::datatypes::Schema as ArrowSchema; -use arrow2::error::Error as ArrowError; +use arrow2::array::Array as Arrow2Array; +use arrow2::chunk::Chunk as Arrow2Chunk; +use arrow2::datatypes::Schema as Arrow2Schema; +use arrow2::error::Error as Arrow2Error; use arrow2::io::ipc::{read, write}; use re_dataframe::TransportChunk; @@ -10,7 +10,7 @@ use crate::v0::{EncoderVersion, RecordingMetadata}; #[derive(Debug, thiserror::Error)] pub enum CodecError { #[error("Arrow serialization error: {0}")] - ArrowSerialization(ArrowError), + ArrowSerialization(Arrow2Error), #[error("Failed to decode message header {0}")] HeaderDecoding(std::io::Error), @@ -215,8 +215,8 @@ impl RecordingMetadata { /// using Arrow IPC format. fn write_arrow_to_bytes( writer: &mut W, - schema: &ArrowSchema, - data: &ArrowChunk>, + schema: &Arrow2Schema, + data: &Arrow2Chunk>, ) -> Result<(), CodecError> { let options = write::WriteOptions { compression: None }; let mut sw = write::StreamWriter::new(writer, options); @@ -234,7 +234,7 @@ fn write_arrow_to_bytes( /// using Arrow IPC format. fn read_arrow_from_bytes( reader: &mut R, -) -> Result<(ArrowSchema, ArrowChunk>), CodecError> { +) -> Result<(Arrow2Schema, Arrow2Chunk>), CodecError> { let metadata = read::read_stream_metadata(reader).map_err(CodecError::ArrowSerialization)?; let mut stream = read::StreamReader::new(reader, metadata, None); @@ -255,10 +255,10 @@ fn read_arrow_from_bytes( mod tests { use arrow2::array::Utf8Array as ArrowUtf8Array; - use arrow2::chunk::Chunk as ArrowChunk; + use arrow2::chunk::Chunk as Arrow2Chunk; use arrow2::{ array::Int32Array as ArrowInt32Array, datatypes::Field as ArrowField, - datatypes::Schema as ArrowSchema, + datatypes::Schema as Arrow2Schema, }; use re_dataframe::external::re_chunk::{Chunk, RowId}; use re_dataframe::TransportChunk; @@ -360,14 +360,14 @@ mod tests { #[test] fn test_recording_metadata_serialization() { - let expected_schema = ArrowSchema::from(vec![ + let expected_schema = Arrow2Schema::from(vec![ ArrowField::new("id", arrow2::datatypes::DataType::Utf8, false), ArrowField::new("my_int", arrow2::datatypes::DataType::Int32, false), ]); let id = ArrowUtf8Array::::from_slice(["some_id"]); let my_ints = ArrowInt32Array::from_slice([42]); - let expected_chunk = ArrowChunk::new(vec![Box::new(id) as _, Box::new(my_ints) as _]); + let expected_chunk = Arrow2Chunk::new(vec![Box::new(id) as _, Box::new(my_ints) as _]); let metadata_tc = TransportChunk { schema: expected_schema.clone(), data: expected_chunk.clone(), @@ -387,7 +387,7 @@ mod tests { #[test] fn test_recording_metadata_fails_with_non_unit_batch() { - let expected_schema = ArrowSchema::from(vec![ArrowField::new( + let expected_schema = Arrow2Schema::from(vec![ArrowField::new( "my_int", arrow2::datatypes::DataType::Int32, false, @@ -395,7 +395,7 @@ mod tests { // more than 1 row in the batch let my_ints = ArrowInt32Array::from_slice([41, 42]); - let expected_chunk = ArrowChunk::new(vec![Box::new(my_ints) as _]); + let expected_chunk = Arrow2Chunk::new(vec![Box::new(my_ints) as _]); let metadata_tc = TransportChunk { schema: expected_schema.clone(), data: expected_chunk, diff --git a/crates/store/re_query/src/latest_at.rs b/crates/store/re_query/src/latest_at.rs index 90c65dce7031..8a9c5966022d 100644 --- a/crates/store/re_query/src/latest_at.rs +++ b/crates/store/re_query/src/latest_at.rs @@ -3,7 +3,7 @@ use std::{ sync::Arc, }; -use arrow2::array::Array as ArrowArray; +use arrow2::array::Array as Arrow2Array; use nohash_hasher::IntMap; use parking_lot::RwLock; @@ -308,7 +308,7 @@ impl LatestAtResults { pub fn component_batch_raw( &self, component_name: &ComponentName, - ) -> Option> { + ) -> Option> { self.components .get(component_name) .and_then(|unit| unit.component_batch_raw(component_name)) @@ -354,7 +354,7 @@ impl LatestAtResults { log_level: re_log::Level, component_name: &ComponentName, instance_index: usize, - ) -> Option> { + ) -> Option> { self.components.get(component_name).and_then(|unit| { self.ok_or_log_err( log_level, @@ -372,7 +372,7 @@ impl LatestAtResults { &self, component_name: &ComponentName, instance_index: usize, - ) -> Option> { + ) -> Option> { self.component_instance_raw_with_log_level( re_log::Level::Error, component_name, @@ -386,7 +386,7 @@ impl LatestAtResults { &self, component_name: &ComponentName, instance_index: usize, - ) -> Option> { + ) -> Option> { self.components.get(component_name).and_then(|unit| { unit.component_instance_raw(component_name, instance_index)? .ok() @@ -440,7 +440,7 @@ impl LatestAtResults { &self, log_level: re_log::Level, component_name: &ComponentName, - ) -> Option> { + ) -> Option> { self.components.get(component_name).and_then(|unit| { self.ok_or_log_err( log_level, @@ -457,7 +457,7 @@ impl LatestAtResults { pub fn component_mono_raw( &self, component_name: &ComponentName, - ) -> Option> { + ) -> Option> { self.component_mono_raw_with_log_level(re_log::Level::Error, component_name) } @@ -468,7 +468,7 @@ impl LatestAtResults { pub fn component_mono_raw_quiet( &self, component_name: &ComponentName, - ) -> Option> { + ) -> Option> { self.components .get(component_name) .and_then(|unit| unit.component_mono_raw(component_name)?.ok()) diff --git a/crates/top/rerun_c/src/arrow_utils.rs b/crates/top/rerun_c/src/arrow_utils.rs index b3f0b15ca81f..660a2ba21387 100644 --- a/crates/top/rerun_c/src/arrow_utils.rs +++ b/crates/top/rerun_c/src/arrow_utils.rs @@ -12,7 +12,7 @@ pub unsafe fn arrow_array_from_c_ffi( array: &arrow2::ffi::ArrowArray, datatype: arrow2::datatypes::DataType, ) -> Result, CError> { - // Arrow2 implements drop for ArrowArray and ArrowSchema. + // Arrow2 implements drop for Arrow2Array and ArrowSchema. // // Therefore, for things to work correctly we have to take ownership of the array! // All methods passing arrow arrays through our C interface are documented to take ownership of the component batch. diff --git a/crates/viewer/re_chunk_store_ui/src/chunk_ui.rs b/crates/viewer/re_chunk_store_ui/src/chunk_ui.rs index d2a48ffa642e..5017d683b534 100644 --- a/crates/viewer/re_chunk_store_ui/src/chunk_ui.rs +++ b/crates/viewer/re_chunk_store_ui/src/chunk_ui.rs @@ -4,7 +4,7 @@ use std::sync::Arc; use egui_extras::{Column, TableRow}; use itertools::Itertools; -use re_chunk_store::external::re_chunk::{ArrowArray, TransportChunk}; +use re_chunk_store::external::re_chunk::{Arrow2Array, TransportChunk}; use re_chunk_store::Chunk; use re_log_types::external::re_types_core::SizeBytes; use re_log_types::{TimeZone, Timeline}; diff --git a/crates/viewer/re_selection_panel/src/visualizer_ui.rs b/crates/viewer/re_selection_panel/src/visualizer_ui.rs index 858551140af8..c6e4711f8927 100644 --- a/crates/viewer/re_selection_panel/src/visualizer_ui.rs +++ b/crates/viewer/re_selection_panel/src/visualizer_ui.rs @@ -160,7 +160,7 @@ fn visualizer_components( fn non_empty_component_batch_raw( unit: Option<&UnitChunkShared>, component_name: &ComponentName, - ) -> Option<(Option, Box)> { + ) -> Option<(Option, Box)> { let unit = unit?; let batch = unit.component_batch_raw(component_name)?; if batch.is_empty() { diff --git a/crates/viewer/re_space_view/src/query.rs b/crates/viewer/re_space_view/src/query.rs index 5cd32417210b..4c41a2274d89 100644 --- a/crates/viewer/re_space_view/src/query.rs +++ b/crates/viewer/re_space_view/src/query.rs @@ -4,7 +4,7 @@ use crate::{ results_ext::{HybridLatestAtResults, HybridRangeResults}, HybridResults, }; -use re_chunk_store::{external::re_chunk::ArrowArray, LatestAtQuery, RangeQuery, RowId}; +use re_chunk_store::{external::re_chunk::Arrow2Array, LatestAtQuery, RangeQuery, RowId}; use re_log_types::{TimeInt, Timeline}; use re_query::LatestAtResults; use re_types_core::{Archetype, ComponentName}; @@ -245,7 +245,7 @@ pub trait DataResultQuery { query_ctx: &'a QueryContext<'a>, visualizer_collection: &'a re_viewer_context::VisualizerCollection, component: re_types_core::ComponentName, - ) -> Box; + ) -> Box; } impl DataResultQuery for DataResult { @@ -285,7 +285,7 @@ impl DataResultQuery for DataResult { query_ctx: &'a QueryContext<'a>, visualizer_collection: &'a re_viewer_context::VisualizerCollection, component: re_types_core::ComponentName, - ) -> Box { + ) -> Box { // TODO(jleibs): This should be cached somewhere for vis in &self.visualizers { let Ok(vis) = visualizer_collection.get_by_identifier(*vis) else { diff --git a/crates/viewer/re_space_view/src/results_ext.rs b/crates/viewer/re_space_view/src/results_ext.rs index c894e27c7fa8..8f0da5517cec 100644 --- a/crates/viewer/re_space_view/src/results_ext.rs +++ b/crates/viewer/re_space_view/src/results_ext.rs @@ -4,7 +4,7 @@ use std::sync::Arc; use itertools::Itertools as _; use re_chunk_store::{Chunk, LatestAtQuery, RangeQuery, UnitChunkShared}; -use re_log_types::external::arrow2::array::Array as ArrowArray; +use re_log_types::external::arrow2::array::Array as Arrow2Array; use re_log_types::hash::Hash64; use re_query::{LatestAtResults, RangeResults}; use re_types_core::ComponentName; @@ -50,7 +50,7 @@ impl<'a> HybridLatestAtResults<'a> { .or_else(|| self.defaults.get(&component_name)) } - pub fn fallback_raw(&self, component_name: ComponentName) -> Box { + pub fn fallback_raw(&self, component_name: ComponentName) -> Box { let query_context = QueryContext { viewer_ctx: self.ctx.viewer_ctx, target_entity_path: &self.data_result.entity_path, diff --git a/crates/viewer/re_space_view/src/view_property_ui.rs b/crates/viewer/re_space_view/src/view_property_ui.rs index 1d976fda61d6..5136494bc590 100644 --- a/crates/viewer/re_space_view/src/view_property_ui.rs +++ b/crates/viewer/re_space_view/src/view_property_ui.rs @@ -1,4 +1,4 @@ -use re_chunk_store::{external::re_chunk::ArrowArray, RowId}; +use re_chunk_store::{external::re_chunk::Arrow2Array, RowId}; use re_types_core::{ reflection::{ArchetypeFieldReflection, ArchetypeReflection}, Archetype, ArchetypeName, ArchetypeReflectionMarker, ComponentName, @@ -120,7 +120,7 @@ fn view_property_component_ui( field: &ArchetypeFieldReflection, blueprint_path: &re_log_types::EntityPath, row_id: Option, - component_array: Option<&dyn ArrowArray>, + component_array: Option<&dyn Arrow2Array>, fallback_provider: &dyn ComponentFallbackProvider, ) { let singleline_list_item_content = singleline_list_item_content( @@ -179,7 +179,7 @@ fn menu_more( ui: &mut egui::Ui, blueprint_path: &re_log_types::EntityPath, component_name: ComponentName, - component_array: Option<&dyn ArrowArray>, + component_array: Option<&dyn Arrow2Array>, ) { let property_differs_from_default = component_array != ctx @@ -228,7 +228,7 @@ fn singleline_list_item_content<'a>( blueprint_path: &'a re_log_types::EntityPath, component_name: ComponentName, row_id: Option, - component_array: Option<&'a dyn ArrowArray>, + component_array: Option<&'a dyn Arrow2Array>, fallback_provider: &'a dyn ComponentFallbackProvider, ) -> list_item::PropertyContent<'a> { list_item::PropertyContent::new(display_name) diff --git a/crates/viewer/re_space_view_dataframe/src/dataframe_ui.rs b/crates/viewer/re_space_view_dataframe/src/dataframe_ui.rs index 64c2b3a3d570..c0d65cb8bb1c 100644 --- a/crates/viewer/re_space_view_dataframe/src/dataframe_ui.rs +++ b/crates/viewer/re_space_view_dataframe/src/dataframe_ui.rs @@ -5,7 +5,7 @@ use anyhow::Context; use egui::NumExt as _; use itertools::Itertools; -use re_chunk_store::external::re_chunk::ArrowArray; +use re_chunk_store::external::re_chunk::Arrow2Array; use re_chunk_store::{ColumnDescriptor, LatestAtQuery}; use re_dataframe::external::re_query::StorageEngineArcReadGuard; use re_dataframe::QueryHandle; @@ -142,7 +142,7 @@ struct RowsDisplayData { impl RowsDisplayData { fn try_new( row_indices: &Range, - row_data: Vec>>, + row_data: Vec>>, selected_columns: &[ColumnDescriptor], query_timeline: &Timeline, ) -> Result { diff --git a/crates/viewer/re_space_view_dataframe/src/display_record_batch.rs b/crates/viewer/re_space_view_dataframe/src/display_record_batch.rs index 36763ddc2968..accdd4ed4b07 100644 --- a/crates/viewer/re_space_view_dataframe/src/display_record_batch.rs +++ b/crates/viewer/re_space_view_dataframe/src/display_record_batch.rs @@ -5,11 +5,11 @@ use thiserror::Error; use re_chunk_store::external::arrow2::{ array::{ - Array as ArrowArray, DictionaryArray as ArrowDictionaryArray, ListArray as ArrowListArray, - PrimitiveArray as ArrowPrimitiveArray, + Array as Arrow2Array, DictionaryArray as Arrow2DictionaryArray, + ListArray as Arrow2ListArray, PrimitiveArray as ArrowPrimitiveArray, }, datatypes::DataType, - datatypes::DataType as ArrowDataType, + datatypes::DataType as Arrow2DataType, }; use re_chunk_store::{ColumnDescriptor, ComponentColumnDescriptor, LatestAtQuery}; use re_log_types::{EntityPath, TimeInt, Timeline}; @@ -21,10 +21,10 @@ use re_viewer_context::{UiLayout, ViewerContext}; #[derive(Error, Debug)] pub(crate) enum DisplayRecordBatchError { #[error("Unexpected column data type for timeline '{0}': {1:?}")] - UnexpectedTimeColumnDataType(String, ArrowDataType), + UnexpectedTimeColumnDataType(String, Arrow2DataType), #[error("Unexpected column data type for component '{0}': {1:?}")] - UnexpectedComponentColumnDataType(String, ArrowDataType), + UnexpectedComponentColumnDataType(String, Arrow2DataType), } /// A single column of component data. @@ -33,10 +33,10 @@ pub(crate) enum DisplayRecordBatchError { #[derive(Debug)] pub(crate) enum ComponentData { Null, - ListArray(ArrowListArray), + ListArray(Arrow2ListArray), DictionaryArray { - dict: ArrowDictionaryArray, - values: ArrowListArray, + dict: Arrow2DictionaryArray, + values: Arrow2ListArray, }, } @@ -44,27 +44,27 @@ impl ComponentData { #[allow(clippy::borrowed_box)] // https://github.com/rust-lang/rust-clippy/issues/11940 fn try_new( descriptor: &ComponentColumnDescriptor, - column_data: &Box, + column_data: &Box, ) -> Result { match column_data.data_type() { DataType::Null => Ok(Self::Null), DataType::List(_) => Ok(Self::ListArray( column_data .as_any() - .downcast_ref::>() + .downcast_ref::>() .expect("`data_type` checked, failure is a bug in re_dataframe") .clone(), )), DataType::Dictionary(IntegerType::Int32, _, _) => { let dict = column_data .as_any() - .downcast_ref::>() + .downcast_ref::>() .expect("`data_type` checked, failure is a bug in re_dataframe") .clone(); let values = dict .values() .as_any() - .downcast_ref::>() + .downcast_ref::>() .expect("`data_type` checked, failure is a bug in re_dataframe") .clone(); Ok(Self::DictionaryArray { dict, values }) @@ -180,7 +180,7 @@ impl DisplayColumn { #[allow(clippy::borrowed_box)] // https://github.com/rust-lang/rust-clippy/issues/11940 fn try_new( column_descriptor: &ColumnDescriptor, - column_data: &Box, + column_data: &Box, ) -> Result { match column_descriptor { ColumnDescriptor::Time(desc) => { @@ -305,7 +305,7 @@ impl DisplayRecordBatch { /// The columns in the record batch must match the selected columns. This is guaranteed by /// `re_datastore`. pub(crate) fn try_new( - row_data: &Vec>, + row_data: &Vec>, selected_columns: &[ColumnDescriptor], ) -> Result { let num_rows = row_data.first().map(|arr| arr.len()).unwrap_or(0); diff --git a/crates/viewer/re_viewer_context/src/blueprint_helpers.rs b/crates/viewer/re_viewer_context/src/blueprint_helpers.rs index e2612d9871ad..d447a74a811e 100644 --- a/crates/viewer/re_viewer_context/src/blueprint_helpers.rs +++ b/crates/viewer/re_viewer_context/src/blueprint_helpers.rs @@ -1,4 +1,4 @@ -use re_chunk::{ArrowArray, RowId}; +use re_chunk::{Arrow2Array, RowId}; use re_chunk_store::external::re_chunk::Chunk; use re_log_types::{EntityPath, TimeInt, TimePoint, Timeline}; use re_types::{AsComponents, ComponentBatch, ComponentName}; @@ -86,7 +86,7 @@ impl ViewerContext<'_> { &self, entity_path: &EntityPath, component_name: ComponentName, - array: Box, + array: Box, ) { let timepoint = self.store_context.blueprint_timepoint_for_writes(); @@ -122,7 +122,7 @@ impl ViewerContext<'_> { &self, entity_path: &EntityPath, component_name: ComponentName, - ) -> Option> { + ) -> Option> { self.store_context .default_blueprint .and_then(|default_blueprint| { diff --git a/crates/viewer/re_viewer_context/src/component_ui_registry.rs b/crates/viewer/re_viewer_context/src/component_ui_registry.rs index 6898c448451c..d6a37d5d1020 100644 --- a/crates/viewer/re_viewer_context/src/component_ui_registry.rs +++ b/crates/viewer/re_viewer_context/src/component_ui_registry.rs @@ -1,6 +1,6 @@ use std::collections::BTreeMap; -use re_chunk::{ArrowArray, RowId, UnitChunkShared}; +use re_chunk::{Arrow2Array, RowId, UnitChunkShared}; use re_chunk_store::LatestAtQuery; use re_entity_db::{EntityDb, EntityPath}; use re_log::ResultExt; @@ -522,7 +522,7 @@ impl ComponentUiRegistry { blueprint_write_path: &EntityPath, component_name: ComponentName, row_id: Option, - component_array: Option<&dyn ArrowArray>, + component_array: Option<&dyn Arrow2Array>, fallback_provider: &dyn ComponentFallbackProvider, ) { let multiline = true; @@ -553,7 +553,7 @@ impl ComponentUiRegistry { blueprint_write_path: &EntityPath, component_name: ComponentName, row_id: Option, - component_query_result: Option<&dyn ArrowArray>, + component_query_result: Option<&dyn Arrow2Array>, fallback_provider: &dyn ComponentFallbackProvider, ) { let multiline = false; @@ -579,7 +579,7 @@ impl ComponentUiRegistry { blueprint_write_path: &EntityPath, component_name: ComponentName, row_id: Option, - component_array: Option<&dyn ArrowArray>, + component_array: Option<&dyn Arrow2Array>, fallback_provider: &dyn ComponentFallbackProvider, allow_multiline: bool, ) { diff --git a/crates/viewer/re_viewer_context/src/space_view/view_context.rs b/crates/viewer/re_viewer_context/src/space_view/view_context.rs index 6eb27627f06b..6ed6a3e30595 100644 --- a/crates/viewer/re_viewer_context/src/space_view/view_context.rs +++ b/crates/viewer/re_viewer_context/src/space_view/view_context.rs @@ -1,6 +1,6 @@ use std::sync::Arc; -use re_chunk::ArrowArray; +use re_chunk::Arrow2Array; use re_chunk_store::LatestAtQuery; use re_log_types::{EntityPath, TimePoint}; use re_query::StorageEngineReadGuard; @@ -107,7 +107,7 @@ impl<'a> ViewContext<'a> { &self, entity_path: &EntityPath, component_name: ComponentName, - array: Box, + array: Box, ) { self.viewer_ctx .save_blueprint_array(entity_path, component_name, array); diff --git a/crates/viewer/re_viewer_context/src/viewer_context.rs b/crates/viewer/re_viewer_context/src/viewer_context.rs index fc8073df28b1..87ca4c28e453 100644 --- a/crates/viewer/re_viewer_context/src/viewer_context.rs +++ b/crates/viewer/re_viewer_context/src/viewer_context.rs @@ -176,7 +176,7 @@ impl<'a> ViewerContext<'a> { pub fn placeholder_for( &self, component: re_chunk::ComponentName, - ) -> Box { + ) -> Box { let datatype = if let Some(reflection) = self.reflection.components.get(&component) { // It's a builtin type with reflection. We either have custom place holder, or can rely on the known datatype. if let Some(placeholder) = reflection.custom_placeholder.as_ref() { diff --git a/rerun_py/src/remote.rs b/rerun_py/src/remote.rs index ca71c68a6be8..87db9ca7bf59 100644 --- a/rerun_py/src/remote.rs +++ b/rerun_py/src/remote.rs @@ -156,7 +156,7 @@ enum MetadataLike { } impl MetadataLike { - fn to_arrow2(&self) -> PyResult> { + fn to_arrow2(&self) -> PyResult> { match self { Self::PyArrow(array) => { let array = arrow2::array::from_data(&array.0);