diff --git a/crates/re_entity_db/src/blueprint/components/entity_properties_component.rs b/crates/re_entity_db/src/blueprint/components/entity_properties_component.rs index 1d87be85bb798..2c34446123260 100644 --- a/crates/re_entity_db/src/blueprint/components/entity_properties_component.rs +++ b/crates/re_entity_db/src/blueprint/components/entity_properties_component.rs @@ -55,7 +55,7 @@ impl ::re_types_core::Loggable for EntityPropertiesComponent { #[inline] fn arrow_datatype() -> arrow2::datatypes::DataType { use arrow2::datatypes::*; - DataType::List(Box::new(Field { + DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::UInt8, is_nullable: false, @@ -146,7 +146,7 @@ impl ::re_types_core::Loggable for EntityPropertiesComponent { .downcast_ref::>() .ok_or_else(|| { DeserializationError::datatype_mismatch( - DataType::List(Box::new(Field { + DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::UInt8, is_nullable: false, diff --git a/crates/re_format/src/arrow.rs b/crates/re_format/src/arrow.rs index 66e37e07f1580..2ae6e4080f615 100644 --- a/crates/re_format/src/arrow.rs +++ b/crates/re_format/src/arrow.rs @@ -180,7 +180,10 @@ impl std::fmt::Display for DisplayDataType { DataType::Decimal(_, _) => "decimal", DataType::Decimal256(_, _) => "decimal256", DataType::Extension(name, data_type, _) => { - let s = format!("extension<{name}>[{}]", DisplayDataType(*data_type.clone())); + let s = format!( + "extension<{name}>[{}]", + DisplayDataType((**data_type).clone()) + ); return f.write_str(&s); } }; diff --git a/crates/re_log_types/src/data_table.rs b/crates/re_log_types/src/data_table.rs index dcb0f7c69e0fc..2580327e64363 100644 --- a/crates/re_log_types/src/data_table.rs +++ b/crates/re_log_types/src/data_table.rs @@ -1,4 +1,7 @@ -use std::collections::{BTreeMap, VecDeque}; +use std::{ + collections::{BTreeMap, VecDeque}, + sync::Arc, +}; use ahash::HashMap; use itertools::{izip, Itertools as _}; @@ -810,7 +813,7 @@ impl DataTable { field }; - let datatype = DataType::List(Box::new(field)); + let datatype = DataType::List(Arc::new(field)); let offsets = Offsets::try_from_lengths(column.iter().map(|cell| { cell.as_ref() .map_or(0, |cell| cell.num_instances() as usize) diff --git a/crates/re_log_types/src/example_components.rs b/crates/re_log_types/src/example_components.rs index 5bdf898019c4d..dc7bd44da0cae 100644 --- a/crates/re_log_types/src/example_components.rs +++ b/crates/re_log_types/src/example_components.rs @@ -1,5 +1,7 @@ //! Example components to be used for tests and docs +use std::sync::Arc; + use re_types_core::{components::InstanceKey, Loggable, SizeBytes}; // ---------------------------------------------------------------------------- @@ -67,10 +69,10 @@ impl Loggable for MyPoint { fn arrow_datatype() -> arrow2::datatypes::DataType { use arrow2::datatypes::DataType::Float32; - arrow2::datatypes::DataType::Struct(vec![ + arrow2::datatypes::DataType::Struct(Arc::new(vec![ arrow2::datatypes::Field::new("x", Float32, false), arrow2::datatypes::Field::new("y", Float32, false), - ]) + ])) } fn to_arrow_opt<'a>( diff --git a/crates/re_types/src/blueprint/components/column_shares.rs b/crates/re_types/src/blueprint/components/column_shares.rs index 96082dd81ee89..98a4df87a3fba 100644 --- a/crates/re_types/src/blueprint/components/column_shares.rs +++ b/crates/re_types/src/blueprint/components/column_shares.rs @@ -68,7 +68,7 @@ impl ::re_types_core::Loggable for ColumnShares { #[inline] fn arrow_datatype() -> arrow2::datatypes::DataType { use arrow2::datatypes::*; - DataType::List(Box::new(Field { + DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::Float32, is_nullable: false, @@ -146,7 +146,7 @@ impl ::re_types_core::Loggable for ColumnShares { .downcast_ref::>() .ok_or_else(|| { DeserializationError::datatype_mismatch( - DataType::List(Box::new(Field { + DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::Float32, is_nullable: false, diff --git a/crates/re_types/src/blueprint/components/included_contents.rs b/crates/re_types/src/blueprint/components/included_contents.rs index c79f0b67461af..9a0ac5f9cbdb8 100644 --- a/crates/re_types/src/blueprint/components/included_contents.rs +++ b/crates/re_types/src/blueprint/components/included_contents.rs @@ -65,7 +65,7 @@ impl ::re_types_core::Loggable for IncludedContents { #[inline] fn arrow_datatype() -> arrow2::datatypes::DataType { use arrow2::datatypes::*; - DataType::List(Box::new(Field { + DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: ::arrow_datatype(), is_nullable: false, @@ -173,7 +173,7 @@ impl ::re_types_core::Loggable for IncludedContents { .downcast_ref::>() .ok_or_else(|| { DeserializationError::datatype_mismatch( - DataType::List(Box::new(Field { + DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: ::arrow_datatype(), is_nullable: false, diff --git a/crates/re_types/src/blueprint/components/included_queries.rs b/crates/re_types/src/blueprint/components/included_queries.rs index 040fa5f204155..b0ca80a45addd 100644 --- a/crates/re_types/src/blueprint/components/included_queries.rs +++ b/crates/re_types/src/blueprint/components/included_queries.rs @@ -60,7 +60,7 @@ impl ::re_types_core::Loggable for IncludedQueries { #[inline] fn arrow_datatype() -> arrow2::datatypes::DataType { use arrow2::datatypes::*; - DataType::List(Box::new(Field { + DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: ::arrow_datatype(), is_nullable: false, @@ -139,7 +139,7 @@ impl ::re_types_core::Loggable for IncludedQueries { .downcast_ref::>() .ok_or_else(|| { DeserializationError::datatype_mismatch( - DataType::List(Box::new(Field { + DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: ::arrow_datatype(), is_nullable: false, diff --git a/crates/re_types/src/blueprint/components/row_shares.rs b/crates/re_types/src/blueprint/components/row_shares.rs index 1cf57caa3855e..82daf1acf08e4 100644 --- a/crates/re_types/src/blueprint/components/row_shares.rs +++ b/crates/re_types/src/blueprint/components/row_shares.rs @@ -68,7 +68,7 @@ impl ::re_types_core::Loggable for RowShares { #[inline] fn arrow_datatype() -> arrow2::datatypes::DataType { use arrow2::datatypes::*; - DataType::List(Box::new(Field { + DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::Float32, is_nullable: false, @@ -146,7 +146,7 @@ impl ::re_types_core::Loggable for RowShares { .downcast_ref::>() .ok_or_else(|| { DeserializationError::datatype_mismatch( - DataType::List(Box::new(Field { + DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::Float32, is_nullable: false, diff --git a/crates/re_types/src/components/annotation_context.rs b/crates/re_types/src/components/annotation_context.rs index 12e4d260cc5f3..f59ec080142ca 100644 --- a/crates/re_types/src/components/annotation_context.rs +++ b/crates/re_types/src/components/annotation_context.rs @@ -68,7 +68,7 @@ impl ::re_types_core::Loggable for AnnotationContext { #[inline] fn arrow_datatype() -> arrow2::datatypes::DataType { use arrow2::datatypes::*; - DataType::List(Box::new(Field { + DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: ::arrow_datatype(), is_nullable: false, @@ -147,7 +147,7 @@ impl ::re_types_core::Loggable for AnnotationContext { .downcast_ref::>() .ok_or_else(|| { DeserializationError::datatype_mismatch( - DataType::List(Box::new(Field { + DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: ::arrow_datatype( ), diff --git a/crates/re_types/src/components/blob.rs b/crates/re_types/src/components/blob.rs index 902a6045cdf9f..0ae8f8d8109f5 100644 --- a/crates/re_types/src/components/blob.rs +++ b/crates/re_types/src/components/blob.rs @@ -66,7 +66,7 @@ impl ::re_types_core::Loggable for Blob { #[inline] fn arrow_datatype() -> arrow2::datatypes::DataType { use arrow2::datatypes::*; - DataType::List(Box::new(Field { + DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::UInt8, is_nullable: false, @@ -144,7 +144,7 @@ impl ::re_types_core::Loggable for Blob { .downcast_ref::>() .ok_or_else(|| { DeserializationError::datatype_mismatch( - DataType::List(Box::new(Field { + DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::UInt8, is_nullable: false, diff --git a/crates/re_types/src/components/half_sizes2d.rs b/crates/re_types/src/components/half_sizes2d.rs index 176ce0155007a..be454120fe128 100644 --- a/crates/re_types/src/components/half_sizes2d.rs +++ b/crates/re_types/src/components/half_sizes2d.rs @@ -77,7 +77,7 @@ impl ::re_types_core::Loggable for HalfSizes2D { fn arrow_datatype() -> arrow2::datatypes::DataType { use arrow2::datatypes::*; DataType::FixedSizeList( - Box::new(Field { + std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::Float32, is_nullable: false, @@ -170,7 +170,7 @@ impl ::re_types_core::Loggable for HalfSizes2D { .ok_or_else(|| { DeserializationError::datatype_mismatch( DataType::FixedSizeList( - Box::new(Field { + std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::Float32, is_nullable: false, @@ -262,7 +262,7 @@ impl ::re_types_core::Loggable for HalfSizes2D { .ok_or_else(|| { DeserializationError::datatype_mismatch( DataType::FixedSizeList( - Box::new(Field { + std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::Float32, is_nullable: false, diff --git a/crates/re_types/src/components/half_sizes3d.rs b/crates/re_types/src/components/half_sizes3d.rs index 01ad3c69f1a4a..cb154e0d79984 100644 --- a/crates/re_types/src/components/half_sizes3d.rs +++ b/crates/re_types/src/components/half_sizes3d.rs @@ -77,7 +77,7 @@ impl ::re_types_core::Loggable for HalfSizes3D { fn arrow_datatype() -> arrow2::datatypes::DataType { use arrow2::datatypes::*; DataType::FixedSizeList( - Box::new(Field { + std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::Float32, is_nullable: false, @@ -170,7 +170,7 @@ impl ::re_types_core::Loggable for HalfSizes3D { .ok_or_else(|| { DeserializationError::datatype_mismatch( DataType::FixedSizeList( - Box::new(Field { + std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::Float32, is_nullable: false, @@ -262,7 +262,7 @@ impl ::re_types_core::Loggable for HalfSizes3D { .ok_or_else(|| { DeserializationError::datatype_mismatch( DataType::FixedSizeList( - Box::new(Field { + std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::Float32, is_nullable: false, diff --git a/crates/re_types/src/components/line_strip2d.rs b/crates/re_types/src/components/line_strip2d.rs index 9a3999e403d93..3e53160284d73 100644 --- a/crates/re_types/src/components/line_strip2d.rs +++ b/crates/re_types/src/components/line_strip2d.rs @@ -68,7 +68,7 @@ impl ::re_types_core::Loggable for LineStrip2D { #[inline] fn arrow_datatype() -> arrow2::datatypes::DataType { use arrow2::datatypes::*; - DataType::List(Box::new(Field { + DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: ::arrow_datatype(), is_nullable: false, @@ -147,7 +147,7 @@ impl ::re_types_core::Loggable for LineStrip2D { }); FixedSizeListArray::new( DataType::FixedSizeList( - Box::new(Field { + std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::Float32, is_nullable: false, @@ -190,7 +190,7 @@ impl ::re_types_core::Loggable for LineStrip2D { .downcast_ref::>() .ok_or_else(|| { DeserializationError::datatype_mismatch( - DataType::List(Box::new(Field { + DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: ::arrow_datatype(), is_nullable: false, @@ -212,7 +212,7 @@ impl ::re_types_core::Loggable for LineStrip2D { .ok_or_else(|| { DeserializationError::datatype_mismatch( DataType::FixedSizeList( - Box::new(Field { + std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::Float32, is_nullable: false, diff --git a/crates/re_types/src/components/line_strip3d.rs b/crates/re_types/src/components/line_strip3d.rs index e33bbeeac35a4..00e86c56da77a 100644 --- a/crates/re_types/src/components/line_strip3d.rs +++ b/crates/re_types/src/components/line_strip3d.rs @@ -68,7 +68,7 @@ impl ::re_types_core::Loggable for LineStrip3D { #[inline] fn arrow_datatype() -> arrow2::datatypes::DataType { use arrow2::datatypes::*; - DataType::List(Box::new(Field { + DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: ::arrow_datatype(), is_nullable: false, @@ -147,7 +147,7 @@ impl ::re_types_core::Loggable for LineStrip3D { }); FixedSizeListArray::new( DataType::FixedSizeList( - Box::new(Field { + std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::Float32, is_nullable: false, @@ -190,7 +190,7 @@ impl ::re_types_core::Loggable for LineStrip3D { .downcast_ref::>() .ok_or_else(|| { DeserializationError::datatype_mismatch( - DataType::List(Box::new(Field { + DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: ::arrow_datatype(), is_nullable: false, @@ -212,7 +212,7 @@ impl ::re_types_core::Loggable for LineStrip3D { .ok_or_else(|| { DeserializationError::datatype_mismatch( DataType::FixedSizeList( - Box::new(Field { + std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::Float32, is_nullable: false, diff --git a/crates/re_types/src/components/material.rs b/crates/re_types/src/components/material.rs index 856813a7338d5..c56fc48b2c57a 100644 --- a/crates/re_types/src/components/material.rs +++ b/crates/re_types/src/components/material.rs @@ -73,12 +73,12 @@ impl ::re_types_core::Loggable for Material { #[inline] fn arrow_datatype() -> arrow2::datatypes::DataType { use arrow2::datatypes::*; - DataType::Struct(vec![Field { + DataType::Struct(std::sync::Arc::new(vec![Field { name: "albedo_factor".to_owned(), data_type: ::arrow_datatype(), is_nullable: true, metadata: [].into(), - }]) + }])) } #[allow(clippy::wildcard_imports)] diff --git a/crates/re_types/src/components/mesh_properties.rs b/crates/re_types/src/components/mesh_properties.rs index 6752013d75255..7647e320aa383 100644 --- a/crates/re_types/src/components/mesh_properties.rs +++ b/crates/re_types/src/components/mesh_properties.rs @@ -73,9 +73,9 @@ impl ::re_types_core::Loggable for MeshProperties { #[inline] fn arrow_datatype() -> arrow2::datatypes::DataType { use arrow2::datatypes::*; - DataType::Struct(vec![Field { + DataType::Struct(std::sync::Arc::new(vec![Field { name: "indices".to_owned(), - data_type: DataType::List(Box::new(Field { + data_type: DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::UInt32, is_nullable: false, @@ -83,7 +83,7 @@ impl ::re_types_core::Loggable for MeshProperties { })), is_nullable: true, metadata: [].into(), - }]) + }])) } #[allow(clippy::wildcard_imports)] diff --git a/crates/re_types/src/components/out_of_tree_transform3d.rs b/crates/re_types/src/components/out_of_tree_transform3d.rs index 4616720a997a4..94da5d90f5725 100644 --- a/crates/re_types/src/components/out_of_tree_transform3d.rs +++ b/crates/re_types/src/components/out_of_tree_transform3d.rs @@ -79,7 +79,7 @@ impl ::re_types_core::Loggable for OutOfTreeTransform3D { fn arrow_datatype() -> arrow2::datatypes::DataType { use arrow2::datatypes::*; DataType::Union( - vec![ + std::sync::Arc::new(vec![ Field { name: "_null_markers".to_owned(), data_type: DataType::Null, @@ -98,8 +98,8 @@ impl ::re_types_core::Loggable for OutOfTreeTransform3D { is_nullable: false, metadata: [].into(), }, - ], - Some(vec![0i32, 1i32, 2i32]), + ]), + Some(std::sync::Arc::new(vec![0i32, 1i32, 2i32])), UnionMode::Dense, ) } diff --git a/crates/re_types/src/components/pinhole_projection.rs b/crates/re_types/src/components/pinhole_projection.rs index f530d5458001b..311a504b622ef 100644 --- a/crates/re_types/src/components/pinhole_projection.rs +++ b/crates/re_types/src/components/pinhole_projection.rs @@ -84,7 +84,7 @@ impl ::re_types_core::Loggable for PinholeProjection { fn arrow_datatype() -> arrow2::datatypes::DataType { use arrow2::datatypes::*; DataType::FixedSizeList( - Box::new(Field { + std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::Float32, is_nullable: false, @@ -177,7 +177,7 @@ impl ::re_types_core::Loggable for PinholeProjection { .ok_or_else(|| { DeserializationError::datatype_mismatch( DataType::FixedSizeList( - Box::new(Field { + std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::Float32, is_nullable: false, @@ -269,7 +269,7 @@ impl ::re_types_core::Loggable for PinholeProjection { .ok_or_else(|| { DeserializationError::datatype_mismatch( DataType::FixedSizeList( - Box::new(Field { + std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::Float32, is_nullable: false, diff --git a/crates/re_types/src/components/position2d.rs b/crates/re_types/src/components/position2d.rs index c46b0dca0e10e..4c3a7463e668a 100644 --- a/crates/re_types/src/components/position2d.rs +++ b/crates/re_types/src/components/position2d.rs @@ -75,7 +75,7 @@ impl ::re_types_core::Loggable for Position2D { fn arrow_datatype() -> arrow2::datatypes::DataType { use arrow2::datatypes::*; DataType::FixedSizeList( - Box::new(Field { + std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::Float32, is_nullable: false, @@ -168,7 +168,7 @@ impl ::re_types_core::Loggable for Position2D { .ok_or_else(|| { DeserializationError::datatype_mismatch( DataType::FixedSizeList( - Box::new(Field { + std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::Float32, is_nullable: false, @@ -260,7 +260,7 @@ impl ::re_types_core::Loggable for Position2D { .ok_or_else(|| { DeserializationError::datatype_mismatch( DataType::FixedSizeList( - Box::new(Field { + std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::Float32, is_nullable: false, diff --git a/crates/re_types/src/components/position3d.rs b/crates/re_types/src/components/position3d.rs index 64d024d78c321..12565146f4558 100644 --- a/crates/re_types/src/components/position3d.rs +++ b/crates/re_types/src/components/position3d.rs @@ -75,7 +75,7 @@ impl ::re_types_core::Loggable for Position3D { fn arrow_datatype() -> arrow2::datatypes::DataType { use arrow2::datatypes::*; DataType::FixedSizeList( - Box::new(Field { + std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::Float32, is_nullable: false, @@ -168,7 +168,7 @@ impl ::re_types_core::Loggable for Position3D { .ok_or_else(|| { DeserializationError::datatype_mismatch( DataType::FixedSizeList( - Box::new(Field { + std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::Float32, is_nullable: false, @@ -260,7 +260,7 @@ impl ::re_types_core::Loggable for Position3D { .ok_or_else(|| { DeserializationError::datatype_mismatch( DataType::FixedSizeList( - Box::new(Field { + std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::Float32, is_nullable: false, diff --git a/crates/re_types/src/components/resolution.rs b/crates/re_types/src/components/resolution.rs index 71e848d46c45b..c3aaee68c90f4 100644 --- a/crates/re_types/src/components/resolution.rs +++ b/crates/re_types/src/components/resolution.rs @@ -76,7 +76,7 @@ impl ::re_types_core::Loggable for Resolution { fn arrow_datatype() -> arrow2::datatypes::DataType { use arrow2::datatypes::*; DataType::FixedSizeList( - Box::new(Field { + std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::Float32, is_nullable: false, @@ -169,7 +169,7 @@ impl ::re_types_core::Loggable for Resolution { .ok_or_else(|| { DeserializationError::datatype_mismatch( DataType::FixedSizeList( - Box::new(Field { + std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::Float32, is_nullable: false, @@ -261,7 +261,7 @@ impl ::re_types_core::Loggable for Resolution { .ok_or_else(|| { DeserializationError::datatype_mismatch( DataType::FixedSizeList( - Box::new(Field { + std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::Float32, is_nullable: false, diff --git a/crates/re_types/src/components/rotation3d.rs b/crates/re_types/src/components/rotation3d.rs index cbbe0adc7829c..3838a97515b59 100644 --- a/crates/re_types/src/components/rotation3d.rs +++ b/crates/re_types/src/components/rotation3d.rs @@ -77,7 +77,7 @@ impl ::re_types_core::Loggable for Rotation3D { fn arrow_datatype() -> arrow2::datatypes::DataType { use arrow2::datatypes::*; DataType::Union( - vec![ + std::sync::Arc::new(vec![ Field { name: "_null_markers".to_owned(), data_type: DataType::Null, @@ -96,8 +96,8 @@ impl ::re_types_core::Loggable for Rotation3D { is_nullable: false, metadata: [].into(), }, - ], - Some(vec![0i32, 1i32, 2i32]), + ]), + Some(std::sync::Arc::new(vec![0i32, 1i32, 2i32])), UnionMode::Dense, ) } diff --git a/crates/re_types/src/components/tensor_data.rs b/crates/re_types/src/components/tensor_data.rs index f4ac6afdf441e..c97145cb7e0d2 100644 --- a/crates/re_types/src/components/tensor_data.rs +++ b/crates/re_types/src/components/tensor_data.rs @@ -74,10 +74,10 @@ impl ::re_types_core::Loggable for TensorData { #[inline] fn arrow_datatype() -> arrow2::datatypes::DataType { use arrow2::datatypes::*; - DataType::Struct(vec![ + DataType::Struct(std::sync::Arc::new(vec![ Field { name: "shape".to_owned(), - data_type: DataType::List(Box::new(Field { + data_type: DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: ::arrow_datatype(), is_nullable: false, @@ -92,7 +92,7 @@ impl ::re_types_core::Loggable for TensorData { is_nullable: false, metadata: [].into(), }, - ]) + ])) } #[allow(clippy::wildcard_imports)] diff --git a/crates/re_types/src/components/transform3d.rs b/crates/re_types/src/components/transform3d.rs index 935ab3bd60a18..c362df70b99b1 100644 --- a/crates/re_types/src/components/transform3d.rs +++ b/crates/re_types/src/components/transform3d.rs @@ -77,7 +77,7 @@ impl ::re_types_core::Loggable for Transform3D { fn arrow_datatype() -> arrow2::datatypes::DataType { use arrow2::datatypes::*; DataType::Union( - vec![ + std::sync::Arc::new(vec![ Field { name: "_null_markers".to_owned(), data_type: DataType::Null, @@ -96,8 +96,8 @@ impl ::re_types_core::Loggable for Transform3D { is_nullable: false, metadata: [].into(), }, - ], - Some(vec![0i32, 1i32, 2i32]), + ]), + Some(std::sync::Arc::new(vec![0i32, 1i32, 2i32])), UnionMode::Dense, ) } diff --git a/crates/re_types/src/components/vector2d.rs b/crates/re_types/src/components/vector2d.rs index e9264d452970a..05dc4aa3ffef5 100644 --- a/crates/re_types/src/components/vector2d.rs +++ b/crates/re_types/src/components/vector2d.rs @@ -75,7 +75,7 @@ impl ::re_types_core::Loggable for Vector2D { fn arrow_datatype() -> arrow2::datatypes::DataType { use arrow2::datatypes::*; DataType::FixedSizeList( - Box::new(Field { + std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::Float32, is_nullable: false, @@ -168,7 +168,7 @@ impl ::re_types_core::Loggable for Vector2D { .ok_or_else(|| { DeserializationError::datatype_mismatch( DataType::FixedSizeList( - Box::new(Field { + std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::Float32, is_nullable: false, @@ -260,7 +260,7 @@ impl ::re_types_core::Loggable for Vector2D { .ok_or_else(|| { DeserializationError::datatype_mismatch( DataType::FixedSizeList( - Box::new(Field { + std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::Float32, is_nullable: false, diff --git a/crates/re_types/src/components/vector3d.rs b/crates/re_types/src/components/vector3d.rs index 40464bd325138..152e667241d62 100644 --- a/crates/re_types/src/components/vector3d.rs +++ b/crates/re_types/src/components/vector3d.rs @@ -75,7 +75,7 @@ impl ::re_types_core::Loggable for Vector3D { fn arrow_datatype() -> arrow2::datatypes::DataType { use arrow2::datatypes::*; DataType::FixedSizeList( - Box::new(Field { + std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::Float32, is_nullable: false, @@ -168,7 +168,7 @@ impl ::re_types_core::Loggable for Vector3D { .ok_or_else(|| { DeserializationError::datatype_mismatch( DataType::FixedSizeList( - Box::new(Field { + std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::Float32, is_nullable: false, @@ -260,7 +260,7 @@ impl ::re_types_core::Loggable for Vector3D { .ok_or_else(|| { DeserializationError::datatype_mismatch( DataType::FixedSizeList( - Box::new(Field { + std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::Float32, is_nullable: false, diff --git a/crates/re_types/src/components/view_coordinates.rs b/crates/re_types/src/components/view_coordinates.rs index def09057c6d6d..d9ad763b13815 100644 --- a/crates/re_types/src/components/view_coordinates.rs +++ b/crates/re_types/src/components/view_coordinates.rs @@ -85,7 +85,7 @@ impl ::re_types_core::Loggable for ViewCoordinates { fn arrow_datatype() -> arrow2::datatypes::DataType { use arrow2::datatypes::*; DataType::FixedSizeList( - Box::new(Field { + std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::UInt8, is_nullable: false, @@ -175,7 +175,7 @@ impl ::re_types_core::Loggable for ViewCoordinates { .ok_or_else(|| { DeserializationError::datatype_mismatch( DataType::FixedSizeList( - Box::new(Field { + std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::UInt8, is_nullable: false, @@ -264,7 +264,7 @@ impl ::re_types_core::Loggable for ViewCoordinates { .ok_or_else(|| { DeserializationError::datatype_mismatch( DataType::FixedSizeList( - Box::new(Field { + std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::UInt8, is_nullable: false, diff --git a/crates/re_types/src/datatypes/angle.rs b/crates/re_types/src/datatypes/angle.rs index 84d65ea796a25..24dff04402b23 100644 --- a/crates/re_types/src/datatypes/angle.rs +++ b/crates/re_types/src/datatypes/angle.rs @@ -59,7 +59,7 @@ impl ::re_types_core::Loggable for Angle { fn arrow_datatype() -> arrow2::datatypes::DataType { use arrow2::datatypes::*; DataType::Union( - vec![ + std::sync::Arc::new(vec![ Field { name: "_null_markers".to_owned(), data_type: DataType::Null, @@ -78,8 +78,8 @@ impl ::re_types_core::Loggable for Angle { is_nullable: false, metadata: [].into(), }, - ], - Some(vec![0i32, 1i32, 2i32]), + ]), + Some(std::sync::Arc::new(vec![0i32, 1i32, 2i32])), UnionMode::Dense, ) } @@ -205,7 +205,7 @@ impl ::re_types_core::Loggable for Angle { .ok_or_else(|| { DeserializationError::datatype_mismatch( DataType::Union( - vec![ + std::sync::Arc::new(vec![ Field { name: "_null_markers".to_owned(), data_type: DataType::Null, @@ -224,8 +224,8 @@ impl ::re_types_core::Loggable for Angle { is_nullable: false, metadata: [].into(), }, - ], - Some(vec![0i32, 1i32, 2i32]), + ]), + Some(std::sync::Arc::new(vec![0i32, 1i32, 2i32])), UnionMode::Dense, ), arrow_data.data_type().clone(), diff --git a/crates/re_types/src/datatypes/annotation_info.rs b/crates/re_types/src/datatypes/annotation_info.rs index 92b5a5a2f0d0c..8853ba89c3b22 100644 --- a/crates/re_types/src/datatypes/annotation_info.rs +++ b/crates/re_types/src/datatypes/annotation_info.rs @@ -65,7 +65,7 @@ impl ::re_types_core::Loggable for AnnotationInfo { #[inline] fn arrow_datatype() -> arrow2::datatypes::DataType { use arrow2::datatypes::*; - DataType::Struct(vec![ + DataType::Struct(std::sync::Arc::new(vec![ Field { name: "id".to_owned(), data_type: DataType::UInt16, @@ -84,7 +84,7 @@ impl ::re_types_core::Loggable for AnnotationInfo { is_nullable: true, metadata: [].into(), }, - ]) + ])) } #[allow(clippy::wildcard_imports)] @@ -242,7 +242,7 @@ impl ::re_types_core::Loggable for AnnotationInfo { .downcast_ref::() .ok_or_else(|| { DeserializationError::datatype_mismatch( - DataType::Struct(vec![ + DataType::Struct(std::sync::Arc::new(vec![ Field { name: "id".to_owned(), data_type: DataType::UInt16, @@ -261,7 +261,7 @@ impl ::re_types_core::Loggable for AnnotationInfo { is_nullable: true, metadata: [].into(), }, - ]), + ])), arrow_data.data_type().clone(), ) }) diff --git a/crates/re_types/src/datatypes/class_description.rs b/crates/re_types/src/datatypes/class_description.rs index 25180b0af6504..c708c689d0266 100644 --- a/crates/re_types/src/datatypes/class_description.rs +++ b/crates/re_types/src/datatypes/class_description.rs @@ -77,7 +77,7 @@ impl ::re_types_core::Loggable for ClassDescription { #[inline] fn arrow_datatype() -> arrow2::datatypes::DataType { use arrow2::datatypes::*; - DataType::Struct(vec![ + DataType::Struct(std::sync::Arc::new(vec![ Field { name: "info".to_owned(), data_type: ::arrow_datatype(), @@ -86,7 +86,7 @@ impl ::re_types_core::Loggable for ClassDescription { }, Field { name: "keypoint_annotations".to_owned(), - data_type: DataType::List(Box::new(Field { + data_type: DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: ::arrow_datatype(), is_nullable: false, @@ -97,7 +97,7 @@ impl ::re_types_core::Loggable for ClassDescription { }, Field { name: "keypoint_connections".to_owned(), - data_type: DataType::List(Box::new(Field { + data_type: DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: ::arrow_datatype(), is_nullable: false, @@ -106,7 +106,7 @@ impl ::re_types_core::Loggable for ClassDescription { is_nullable: false, metadata: [].into(), }, - ]) + ])) } #[allow(clippy::wildcard_imports)] @@ -190,7 +190,7 @@ impl ::re_types_core::Loggable for ClassDescription { .unwrap() .into(); ListArray::new( - DataType::List(Box::new(Field { + DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: ::arrow_datatype(), is_nullable: false, @@ -245,7 +245,7 @@ impl ::re_types_core::Loggable for ClassDescription { .unwrap() .into(); ListArray::new( - DataType::List(Box::new(Field { + DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: ::arrow_datatype(), is_nullable: false, @@ -285,7 +285,7 @@ impl ::re_types_core::Loggable for ClassDescription { .downcast_ref::() .ok_or_else(|| { DeserializationError::datatype_mismatch( - DataType::Struct(vec![ + DataType::Struct(std::sync::Arc::new(vec![ Field { name: "info".to_owned(), data_type: ::arrow_datatype(), @@ -294,7 +294,7 @@ impl ::re_types_core::Loggable for ClassDescription { }, Field { name: "keypoint_annotations".to_owned(), - data_type: DataType::List(Box::new(Field { + data_type: DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: ::arrow_datatype(), is_nullable: false, @@ -305,7 +305,7 @@ impl ::re_types_core::Loggable for ClassDescription { }, Field { name: "keypoint_connections".to_owned(), - data_type: DataType::List(Box::new(Field { + data_type: DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: ::arrow_datatype(), is_nullable: false, @@ -314,7 +314,7 @@ impl ::re_types_core::Loggable for ClassDescription { is_nullable: false, metadata: [].into(), }, - ]), + ])), arrow_data.data_type().clone(), ) }) @@ -357,7 +357,7 @@ impl ::re_types_core::Loggable for ClassDescription { .downcast_ref::>() .ok_or_else(|| { DeserializationError::datatype_mismatch( - DataType::List(Box::new(Field { + DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: ::arrow_datatype(), @@ -431,7 +431,7 @@ impl ::re_types_core::Loggable for ClassDescription { .downcast_ref::>() .ok_or_else(|| { DeserializationError::datatype_mismatch( - DataType::List(Box::new(Field { + DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: ::arrow_datatype( ), diff --git a/crates/re_types/src/datatypes/class_description_map_elem.rs b/crates/re_types/src/datatypes/class_description_map_elem.rs index 15477684ffb15..0d8632bcac30e 100644 --- a/crates/re_types/src/datatypes/class_description_map_elem.rs +++ b/crates/re_types/src/datatypes/class_description_map_elem.rs @@ -59,7 +59,7 @@ impl ::re_types_core::Loggable for ClassDescriptionMapElem { #[inline] fn arrow_datatype() -> arrow2::datatypes::DataType { use arrow2::datatypes::*; - DataType::Struct(vec![ + DataType::Struct(std::sync::Arc::new(vec![ Field { name: "class_id".to_owned(), data_type: ::arrow_datatype(), @@ -72,7 +72,7 @@ impl ::re_types_core::Loggable for ClassDescriptionMapElem { is_nullable: false, metadata: [].into(), }, - ]) + ])) } #[allow(clippy::wildcard_imports)] @@ -175,7 +175,7 @@ impl ::re_types_core::Loggable for ClassDescriptionMapElem { .downcast_ref::() .ok_or_else(|| { DeserializationError::datatype_mismatch( - DataType::Struct(vec![ + DataType::Struct(std::sync::Arc::new(vec![ Field { name: "class_id".to_owned(), data_type: ::arrow_datatype(), @@ -188,7 +188,7 @@ impl ::re_types_core::Loggable for ClassDescriptionMapElem { is_nullable: false, metadata: [].into(), }, - ]), + ])), arrow_data.data_type().clone(), ) }) diff --git a/crates/re_types/src/datatypes/keypoint_pair.rs b/crates/re_types/src/datatypes/keypoint_pair.rs index 9cb8f89021009..59f5638a8b5f1 100644 --- a/crates/re_types/src/datatypes/keypoint_pair.rs +++ b/crates/re_types/src/datatypes/keypoint_pair.rs @@ -57,7 +57,7 @@ impl ::re_types_core::Loggable for KeypointPair { #[inline] fn arrow_datatype() -> arrow2::datatypes::DataType { use arrow2::datatypes::*; - DataType::Struct(vec![ + DataType::Struct(std::sync::Arc::new(vec![ Field { name: "keypoint0".to_owned(), data_type: ::arrow_datatype(), @@ -70,7 +70,7 @@ impl ::re_types_core::Loggable for KeypointPair { is_nullable: false, metadata: [].into(), }, - ]) + ])) } #[allow(clippy::wildcard_imports)] @@ -183,7 +183,7 @@ impl ::re_types_core::Loggable for KeypointPair { .downcast_ref::() .ok_or_else(|| { DeserializationError::datatype_mismatch( - DataType::Struct(vec![ + DataType::Struct(std::sync::Arc::new(vec![ Field { name: "keypoint0".to_owned(), data_type: ::arrow_datatype(), @@ -196,7 +196,7 @@ impl ::re_types_core::Loggable for KeypointPair { is_nullable: false, metadata: [].into(), }, - ]), + ])), arrow_data.data_type().clone(), ) }) diff --git a/crates/re_types/src/datatypes/mat3x3.rs b/crates/re_types/src/datatypes/mat3x3.rs index fac69c928d7f6..2427e5d7a528d 100644 --- a/crates/re_types/src/datatypes/mat3x3.rs +++ b/crates/re_types/src/datatypes/mat3x3.rs @@ -78,7 +78,7 @@ impl ::re_types_core::Loggable for Mat3x3 { fn arrow_datatype() -> arrow2::datatypes::DataType { use arrow2::datatypes::*; DataType::FixedSizeList( - Box::new(Field { + std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::Float32, is_nullable: false, @@ -168,7 +168,7 @@ impl ::re_types_core::Loggable for Mat3x3 { .ok_or_else(|| { DeserializationError::datatype_mismatch( DataType::FixedSizeList( - Box::new(Field { + std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::Float32, is_nullable: false, diff --git a/crates/re_types/src/datatypes/mat4x4.rs b/crates/re_types/src/datatypes/mat4x4.rs index fe21cc13a1efd..39cf03f56f4cf 100644 --- a/crates/re_types/src/datatypes/mat4x4.rs +++ b/crates/re_types/src/datatypes/mat4x4.rs @@ -79,7 +79,7 @@ impl ::re_types_core::Loggable for Mat4x4 { fn arrow_datatype() -> arrow2::datatypes::DataType { use arrow2::datatypes::*; DataType::FixedSizeList( - Box::new(Field { + std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::Float32, is_nullable: false, @@ -169,7 +169,7 @@ impl ::re_types_core::Loggable for Mat4x4 { .ok_or_else(|| { DeserializationError::datatype_mismatch( DataType::FixedSizeList( - Box::new(Field { + std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::Float32, is_nullable: false, diff --git a/crates/re_types/src/datatypes/material.rs b/crates/re_types/src/datatypes/material.rs index 3807b3984387f..a73c76b39f228 100644 --- a/crates/re_types/src/datatypes/material.rs +++ b/crates/re_types/src/datatypes/material.rs @@ -78,12 +78,12 @@ impl ::re_types_core::Loggable for Material { #[inline] fn arrow_datatype() -> arrow2::datatypes::DataType { use arrow2::datatypes::*; - DataType::Struct(vec![Field { + DataType::Struct(std::sync::Arc::new(vec![Field { name: "albedo_factor".to_owned(), data_type: ::arrow_datatype(), is_nullable: true, metadata: [].into(), - }]) + }])) } #[allow(clippy::wildcard_imports)] @@ -165,12 +165,12 @@ impl ::re_types_core::Loggable for Material { .downcast_ref::() .ok_or_else(|| { DeserializationError::datatype_mismatch( - DataType::Struct(vec![Field { + DataType::Struct(std::sync::Arc::new(vec![Field { name: "albedo_factor".to_owned(), data_type: ::arrow_datatype(), is_nullable: true, metadata: [].into(), - }]), + }])), arrow_data.data_type().clone(), ) }) diff --git a/crates/re_types/src/datatypes/mesh_properties.rs b/crates/re_types/src/datatypes/mesh_properties.rs index caf6a0bc3a63b..1344645a6d3e3 100644 --- a/crates/re_types/src/datatypes/mesh_properties.rs +++ b/crates/re_types/src/datatypes/mesh_properties.rs @@ -70,9 +70,9 @@ impl ::re_types_core::Loggable for MeshProperties { #[inline] fn arrow_datatype() -> arrow2::datatypes::DataType { use arrow2::datatypes::*; - DataType::Struct(vec![Field { + DataType::Struct(std::sync::Arc::new(vec![Field { name: "indices".to_owned(), - data_type: DataType::List(Box::new(Field { + data_type: DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::UInt32, is_nullable: false, @@ -80,7 +80,7 @@ impl ::re_types_core::Loggable for MeshProperties { })), is_nullable: true, metadata: [].into(), - }]) + }])) } #[allow(clippy::wildcard_imports)] @@ -144,7 +144,7 @@ impl ::re_types_core::Loggable for MeshProperties { .unwrap() .into(); ListArray::new( - DataType::List(Box::new(Field { + DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::UInt32, is_nullable: false, @@ -183,9 +183,9 @@ impl ::re_types_core::Loggable for MeshProperties { .downcast_ref::() .ok_or_else(|| { DeserializationError::datatype_mismatch( - DataType::Struct(vec![Field { + DataType::Struct(std::sync::Arc::new(vec![Field { name: "indices".to_owned(), - data_type: DataType::List(Box::new(Field { + data_type: DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::UInt32, is_nullable: false, @@ -193,7 +193,7 @@ impl ::re_types_core::Loggable for MeshProperties { })), is_nullable: true, metadata: [].into(), - }]), + }])), arrow_data.data_type().clone(), ) }) @@ -223,7 +223,7 @@ impl ::re_types_core::Loggable for MeshProperties { .downcast_ref::>() .ok_or_else(|| { DeserializationError::datatype_mismatch( - DataType::List(Box::new(Field { + DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::UInt32, is_nullable: false, diff --git a/crates/re_types/src/datatypes/quaternion.rs b/crates/re_types/src/datatypes/quaternion.rs index 7ca1c289f17aa..f8e435fc2cd3a 100644 --- a/crates/re_types/src/datatypes/quaternion.rs +++ b/crates/re_types/src/datatypes/quaternion.rs @@ -69,7 +69,7 @@ impl ::re_types_core::Loggable for Quaternion { fn arrow_datatype() -> arrow2::datatypes::DataType { use arrow2::datatypes::*; DataType::FixedSizeList( - Box::new(Field { + std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::Float32, is_nullable: false, @@ -159,7 +159,7 @@ impl ::re_types_core::Loggable for Quaternion { .ok_or_else(|| { DeserializationError::datatype_mismatch( DataType::FixedSizeList( - Box::new(Field { + std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::Float32, is_nullable: false, diff --git a/crates/re_types/src/datatypes/rotation3d.rs b/crates/re_types/src/datatypes/rotation3d.rs index 0cacc11974582..c7c993e1f5010 100644 --- a/crates/re_types/src/datatypes/rotation3d.rs +++ b/crates/re_types/src/datatypes/rotation3d.rs @@ -62,7 +62,7 @@ impl ::re_types_core::Loggable for Rotation3D { fn arrow_datatype() -> arrow2::datatypes::DataType { use arrow2::datatypes::*; DataType::Union( - vec![ + std::sync::Arc::new(vec![ Field { name: "_null_markers".to_owned(), data_type: DataType::Null, @@ -81,8 +81,8 @@ impl ::re_types_core::Loggable for Rotation3D { is_nullable: false, metadata: [].into(), }, - ], - Some(vec![0i32, 1i32, 2i32]), + ]), + Some(std::sync::Arc::new(vec![0i32, 1i32, 2i32])), UnionMode::Dense, ) } @@ -160,7 +160,7 @@ impl ::re_types_core::Loggable for Rotation3D { }); FixedSizeListArray::new( DataType::FixedSizeList( - Box::new(Field { + std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::Float32, is_nullable: false, @@ -251,7 +251,7 @@ impl ::re_types_core::Loggable for Rotation3D { .ok_or_else(|| { DeserializationError::datatype_mismatch( DataType::Union( - vec![ + std::sync::Arc::new(vec![ Field { name: "_null_markers".to_owned(), data_type: DataType::Null, @@ -271,8 +271,8 @@ impl ::re_types_core::Loggable for Rotation3D { is_nullable: false, metadata: [].into(), }, - ], - Some(vec![0i32, 1i32, 2i32]), + ]), + Some(std::sync::Arc::new(vec![0i32, 1i32, 2i32])), UnionMode::Dense, ), arrow_data.data_type().clone(), @@ -312,7 +312,7 @@ impl ::re_types_core::Loggable for Rotation3D { .ok_or_else(|| { DeserializationError::datatype_mismatch( DataType::FixedSizeList( - Box::new(Field { + std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::Float32, is_nullable: false, diff --git a/crates/re_types/src/datatypes/rotation_axis_angle.rs b/crates/re_types/src/datatypes/rotation_axis_angle.rs index 3dc10c629054c..44c5d939ed58c 100644 --- a/crates/re_types/src/datatypes/rotation_axis_angle.rs +++ b/crates/re_types/src/datatypes/rotation_axis_angle.rs @@ -61,7 +61,7 @@ impl ::re_types_core::Loggable for RotationAxisAngle { #[inline] fn arrow_datatype() -> arrow2::datatypes::DataType { use arrow2::datatypes::*; - DataType::Struct(vec![ + DataType::Struct(std::sync::Arc::new(vec![ Field { name: "axis".to_owned(), data_type: ::arrow_datatype(), @@ -74,7 +74,7 @@ impl ::re_types_core::Loggable for RotationAxisAngle { is_nullable: false, metadata: [].into(), }, - ]) + ])) } #[allow(clippy::wildcard_imports)] @@ -142,7 +142,7 @@ impl ::re_types_core::Loggable for RotationAxisAngle { }); FixedSizeListArray::new( DataType::FixedSizeList( - Box::new(Field { + std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::Float32, is_nullable: false, @@ -206,7 +206,7 @@ impl ::re_types_core::Loggable for RotationAxisAngle { .downcast_ref::() .ok_or_else(|| { DeserializationError::datatype_mismatch( - DataType::Struct(vec![ + DataType::Struct(std::sync::Arc::new(vec![ Field { name: "axis".to_owned(), data_type: ::arrow_datatype(), @@ -219,7 +219,7 @@ impl ::re_types_core::Loggable for RotationAxisAngle { is_nullable: false, metadata: [].into(), }, - ]), + ])), arrow_data.data_type().clone(), ) }) @@ -250,7 +250,7 @@ impl ::re_types_core::Loggable for RotationAxisAngle { .ok_or_else(|| { DeserializationError::datatype_mismatch( DataType::FixedSizeList( - Box::new(Field { + std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::Float32, is_nullable: false, diff --git a/crates/re_types/src/datatypes/scale3d.rs b/crates/re_types/src/datatypes/scale3d.rs index 92d93a3cc7fc2..a8e5055b9272e 100644 --- a/crates/re_types/src/datatypes/scale3d.rs +++ b/crates/re_types/src/datatypes/scale3d.rs @@ -62,7 +62,7 @@ impl ::re_types_core::Loggable for Scale3D { fn arrow_datatype() -> arrow2::datatypes::DataType { use arrow2::datatypes::*; DataType::Union( - vec![ + std::sync::Arc::new(vec![ Field { name: "_null_markers".to_owned(), data_type: DataType::Null, @@ -81,8 +81,8 @@ impl ::re_types_core::Loggable for Scale3D { is_nullable: false, metadata: [].into(), }, - ], - Some(vec![0i32, 1i32, 2i32]), + ]), + Some(std::sync::Arc::new(vec![0i32, 1i32, 2i32])), UnionMode::Dense, ) } @@ -158,7 +158,7 @@ impl ::re_types_core::Loggable for Scale3D { }); FixedSizeListArray::new( DataType::FixedSizeList( - Box::new(Field { + std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::Float32, is_nullable: false, @@ -249,7 +249,7 @@ impl ::re_types_core::Loggable for Scale3D { .ok_or_else(|| { DeserializationError::datatype_mismatch( DataType::Union( - vec![ + std::sync::Arc::new(vec![ Field { name: "_null_markers".to_owned(), data_type: DataType::Null, @@ -268,8 +268,8 @@ impl ::re_types_core::Loggable for Scale3D { is_nullable: false, metadata: [].into(), }, - ], - Some(vec![0i32, 1i32, 2i32]), + ]), + Some(std::sync::Arc::new(vec![0i32, 1i32, 2i32])), UnionMode::Dense, ), arrow_data.data_type().clone(), @@ -309,7 +309,7 @@ impl ::re_types_core::Loggable for Scale3D { .ok_or_else(|| { DeserializationError::datatype_mismatch( DataType::FixedSizeList( - Box::new(Field { + std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::Float32, is_nullable: false, diff --git a/crates/re_types/src/datatypes/tensor_buffer.rs b/crates/re_types/src/datatypes/tensor_buffer.rs index 3d7d5b6381a02..03c2571aed625 100644 --- a/crates/re_types/src/datatypes/tensor_buffer.rs +++ b/crates/re_types/src/datatypes/tensor_buffer.rs @@ -95,7 +95,7 @@ impl ::re_types_core::Loggable for TensorBuffer { fn arrow_datatype() -> arrow2::datatypes::DataType { use arrow2::datatypes::*; DataType::Union( - vec![ + std::sync::Arc::new(vec![ Field { name: "_null_markers".to_owned(), data_type: DataType::Null, @@ -104,7 +104,7 @@ impl ::re_types_core::Loggable for TensorBuffer { }, Field { name: "U8".to_owned(), - data_type: DataType::List(Box::new(Field { + data_type: DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::UInt8, is_nullable: false, @@ -115,7 +115,7 @@ impl ::re_types_core::Loggable for TensorBuffer { }, Field { name: "U16".to_owned(), - data_type: DataType::List(Box::new(Field { + data_type: DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::UInt16, is_nullable: false, @@ -126,7 +126,7 @@ impl ::re_types_core::Loggable for TensorBuffer { }, Field { name: "U32".to_owned(), - data_type: DataType::List(Box::new(Field { + data_type: DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::UInt32, is_nullable: false, @@ -137,7 +137,7 @@ impl ::re_types_core::Loggable for TensorBuffer { }, Field { name: "U64".to_owned(), - data_type: DataType::List(Box::new(Field { + data_type: DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::UInt64, is_nullable: false, @@ -148,7 +148,7 @@ impl ::re_types_core::Loggable for TensorBuffer { }, Field { name: "I8".to_owned(), - data_type: DataType::List(Box::new(Field { + data_type: DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::Int8, is_nullable: false, @@ -159,7 +159,7 @@ impl ::re_types_core::Loggable for TensorBuffer { }, Field { name: "I16".to_owned(), - data_type: DataType::List(Box::new(Field { + data_type: DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::Int16, is_nullable: false, @@ -170,7 +170,7 @@ impl ::re_types_core::Loggable for TensorBuffer { }, Field { name: "I32".to_owned(), - data_type: DataType::List(Box::new(Field { + data_type: DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::Int32, is_nullable: false, @@ -181,7 +181,7 @@ impl ::re_types_core::Loggable for TensorBuffer { }, Field { name: "I64".to_owned(), - data_type: DataType::List(Box::new(Field { + data_type: DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::Int64, is_nullable: false, @@ -192,7 +192,7 @@ impl ::re_types_core::Loggable for TensorBuffer { }, Field { name: "F16".to_owned(), - data_type: DataType::List(Box::new(Field { + data_type: DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::Float16, is_nullable: false, @@ -203,7 +203,7 @@ impl ::re_types_core::Loggable for TensorBuffer { }, Field { name: "F32".to_owned(), - data_type: DataType::List(Box::new(Field { + data_type: DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::Float32, is_nullable: false, @@ -214,7 +214,7 @@ impl ::re_types_core::Loggable for TensorBuffer { }, Field { name: "F64".to_owned(), - data_type: DataType::List(Box::new(Field { + data_type: DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::Float64, is_nullable: false, @@ -225,7 +225,7 @@ impl ::re_types_core::Loggable for TensorBuffer { }, Field { name: "JPEG".to_owned(), - data_type: DataType::List(Box::new(Field { + data_type: DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::UInt8, is_nullable: false, @@ -236,7 +236,7 @@ impl ::re_types_core::Loggable for TensorBuffer { }, Field { name: "NV12".to_owned(), - data_type: DataType::List(Box::new(Field { + data_type: DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::UInt8, is_nullable: false, @@ -245,11 +245,11 @@ impl ::re_types_core::Loggable for TensorBuffer { is_nullable: false, metadata: [].into(), }, - ], - Some(vec![ + ]), + Some(std::sync::Arc::new(vec![ 0i32, 1i32, 2i32, 3i32, 4i32, 5i32, 6i32, 7i32, 8i32, 9i32, 10i32, 11i32, 12i32, 13i32, - ]), + ])), UnionMode::Dense, ) } @@ -330,7 +330,7 @@ impl ::re_types_core::Loggable for TensorBuffer { .unwrap() .into(); ListArray::new( - DataType::List(Box::new(Field { + DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::UInt8, is_nullable: false, @@ -384,7 +384,7 @@ impl ::re_types_core::Loggable for TensorBuffer { .unwrap() .into(); ListArray::new( - DataType::List(Box::new(Field { + DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::UInt16, is_nullable: false, @@ -438,7 +438,7 @@ impl ::re_types_core::Loggable for TensorBuffer { .unwrap() .into(); ListArray::new( - DataType::List(Box::new(Field { + DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::UInt32, is_nullable: false, @@ -492,7 +492,7 @@ impl ::re_types_core::Loggable for TensorBuffer { .unwrap() .into(); ListArray::new( - DataType::List(Box::new(Field { + DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::UInt64, is_nullable: false, @@ -546,7 +546,7 @@ impl ::re_types_core::Loggable for TensorBuffer { .unwrap() .into(); ListArray::new( - DataType::List(Box::new(Field { + DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::Int8, is_nullable: false, @@ -596,7 +596,7 @@ impl ::re_types_core::Loggable for TensorBuffer { .unwrap() .into(); ListArray::new( - DataType::List(Box::new(Field { + DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::Int16, is_nullable: false, @@ -650,7 +650,7 @@ impl ::re_types_core::Loggable for TensorBuffer { .unwrap() .into(); ListArray::new( - DataType::List(Box::new(Field { + DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::Int32, is_nullable: false, @@ -704,7 +704,7 @@ impl ::re_types_core::Loggable for TensorBuffer { .unwrap() .into(); ListArray::new( - DataType::List(Box::new(Field { + DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::Int64, is_nullable: false, @@ -758,7 +758,7 @@ impl ::re_types_core::Loggable for TensorBuffer { .unwrap() .into(); ListArray::new( - DataType::List(Box::new(Field { + DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::Float16, is_nullable: false, @@ -812,7 +812,7 @@ impl ::re_types_core::Loggable for TensorBuffer { .unwrap() .into(); ListArray::new( - DataType::List(Box::new(Field { + DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::Float32, is_nullable: false, @@ -866,7 +866,7 @@ impl ::re_types_core::Loggable for TensorBuffer { .unwrap() .into(); ListArray::new( - DataType::List(Box::new(Field { + DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::Float64, is_nullable: false, @@ -920,7 +920,7 @@ impl ::re_types_core::Loggable for TensorBuffer { .unwrap() .into(); ListArray::new( - DataType::List(Box::new(Field { + DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::UInt8, is_nullable: false, @@ -974,7 +974,7 @@ impl ::re_types_core::Loggable for TensorBuffer { .unwrap() .into(); ListArray::new( - DataType::List(Box::new(Field { + DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::UInt8, is_nullable: false, @@ -1104,7 +1104,7 @@ impl ::re_types_core::Loggable for TensorBuffer { .ok_or_else(|| { DeserializationError::datatype_mismatch( DataType::Union( - vec![ + std::sync::Arc::new(vec![ Field { name: "_null_markers".to_owned(), data_type: DataType::Null, @@ -1113,7 +1113,7 @@ impl ::re_types_core::Loggable for TensorBuffer { }, Field { name: "U8".to_owned(), - data_type: DataType::List(Box::new(Field { + data_type: DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::UInt8, is_nullable: false, @@ -1124,7 +1124,7 @@ impl ::re_types_core::Loggable for TensorBuffer { }, Field { name: "U16".to_owned(), - data_type: DataType::List(Box::new(Field { + data_type: DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::UInt16, is_nullable: false, @@ -1135,7 +1135,7 @@ impl ::re_types_core::Loggable for TensorBuffer { }, Field { name: "U32".to_owned(), - data_type: DataType::List(Box::new(Field { + data_type: DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::UInt32, is_nullable: false, @@ -1146,7 +1146,7 @@ impl ::re_types_core::Loggable for TensorBuffer { }, Field { name: "U64".to_owned(), - data_type: DataType::List(Box::new(Field { + data_type: DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::UInt64, is_nullable: false, @@ -1157,7 +1157,7 @@ impl ::re_types_core::Loggable for TensorBuffer { }, Field { name: "I8".to_owned(), - data_type: DataType::List(Box::new(Field { + data_type: DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::Int8, is_nullable: false, @@ -1168,7 +1168,7 @@ impl ::re_types_core::Loggable for TensorBuffer { }, Field { name: "I16".to_owned(), - data_type: DataType::List(Box::new(Field { + data_type: DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::Int16, is_nullable: false, @@ -1179,7 +1179,7 @@ impl ::re_types_core::Loggable for TensorBuffer { }, Field { name: "I32".to_owned(), - data_type: DataType::List(Box::new(Field { + data_type: DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::Int32, is_nullable: false, @@ -1190,7 +1190,7 @@ impl ::re_types_core::Loggable for TensorBuffer { }, Field { name: "I64".to_owned(), - data_type: DataType::List(Box::new(Field { + data_type: DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::Int64, is_nullable: false, @@ -1201,7 +1201,7 @@ impl ::re_types_core::Loggable for TensorBuffer { }, Field { name: "F16".to_owned(), - data_type: DataType::List(Box::new(Field { + data_type: DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::Float16, is_nullable: false, @@ -1212,7 +1212,7 @@ impl ::re_types_core::Loggable for TensorBuffer { }, Field { name: "F32".to_owned(), - data_type: DataType::List(Box::new(Field { + data_type: DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::Float32, is_nullable: false, @@ -1223,7 +1223,7 @@ impl ::re_types_core::Loggable for TensorBuffer { }, Field { name: "F64".to_owned(), - data_type: DataType::List(Box::new(Field { + data_type: DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::Float64, is_nullable: false, @@ -1234,7 +1234,7 @@ impl ::re_types_core::Loggable for TensorBuffer { }, Field { name: "JPEG".to_owned(), - data_type: DataType::List(Box::new(Field { + data_type: DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::UInt8, is_nullable: false, @@ -1245,7 +1245,7 @@ impl ::re_types_core::Loggable for TensorBuffer { }, Field { name: "NV12".to_owned(), - data_type: DataType::List(Box::new(Field { + data_type: DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::UInt8, is_nullable: false, @@ -1254,11 +1254,11 @@ impl ::re_types_core::Loggable for TensorBuffer { is_nullable: false, metadata: [].into(), }, - ], - Some(vec![ + ]), + Some(std::sync::Arc::new(vec![ 0i32, 1i32, 2i32, 3i32, 4i32, 5i32, 6i32, 7i32, 8i32, 9i32, 10i32, 11i32, 12i32, 13i32, - ]), + ])), UnionMode::Dense, ), arrow_data.data_type().clone(), @@ -1297,7 +1297,7 @@ impl ::re_types_core::Loggable for TensorBuffer { .downcast_ref::>() .ok_or_else(|| { DeserializationError::datatype_mismatch( - DataType::List(Box::new(Field { + DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::UInt8, is_nullable: false, @@ -1368,7 +1368,7 @@ impl ::re_types_core::Loggable for TensorBuffer { .downcast_ref::>() .ok_or_else(|| { DeserializationError::datatype_mismatch( - DataType::List(Box::new(Field { + DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::UInt16, is_nullable: false, @@ -1439,7 +1439,7 @@ impl ::re_types_core::Loggable for TensorBuffer { .downcast_ref::>() .ok_or_else(|| { DeserializationError::datatype_mismatch( - DataType::List(Box::new(Field { + DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::UInt32, is_nullable: false, @@ -1510,7 +1510,7 @@ impl ::re_types_core::Loggable for TensorBuffer { .downcast_ref::>() .ok_or_else(|| { DeserializationError::datatype_mismatch( - DataType::List(Box::new(Field { + DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::UInt64, is_nullable: false, @@ -1581,7 +1581,7 @@ impl ::re_types_core::Loggable for TensorBuffer { .downcast_ref::>() .ok_or_else(|| { DeserializationError::datatype_mismatch( - DataType::List(Box::new(Field { + DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::Int8, is_nullable: false, @@ -1652,7 +1652,7 @@ impl ::re_types_core::Loggable for TensorBuffer { .downcast_ref::>() .ok_or_else(|| { DeserializationError::datatype_mismatch( - DataType::List(Box::new(Field { + DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::Int16, is_nullable: false, @@ -1723,7 +1723,7 @@ impl ::re_types_core::Loggable for TensorBuffer { .downcast_ref::>() .ok_or_else(|| { DeserializationError::datatype_mismatch( - DataType::List(Box::new(Field { + DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::Int32, is_nullable: false, @@ -1794,7 +1794,7 @@ impl ::re_types_core::Loggable for TensorBuffer { .downcast_ref::>() .ok_or_else(|| { DeserializationError::datatype_mismatch( - DataType::List(Box::new(Field { + DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::Int64, is_nullable: false, @@ -1865,7 +1865,7 @@ impl ::re_types_core::Loggable for TensorBuffer { .downcast_ref::>() .ok_or_else(|| { DeserializationError::datatype_mismatch( - DataType::List(Box::new(Field { + DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::Float16, is_nullable: false, @@ -1936,7 +1936,7 @@ impl ::re_types_core::Loggable for TensorBuffer { .downcast_ref::>() .ok_or_else(|| { DeserializationError::datatype_mismatch( - DataType::List(Box::new(Field { + DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::Float32, is_nullable: false, @@ -2007,7 +2007,7 @@ impl ::re_types_core::Loggable for TensorBuffer { .downcast_ref::>() .ok_or_else(|| { DeserializationError::datatype_mismatch( - DataType::List(Box::new(Field { + DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::Float64, is_nullable: false, @@ -2078,7 +2078,7 @@ impl ::re_types_core::Loggable for TensorBuffer { .downcast_ref::>() .ok_or_else(|| { DeserializationError::datatype_mismatch( - DataType::List(Box::new(Field { + DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::UInt8, is_nullable: false, @@ -2149,7 +2149,7 @@ impl ::re_types_core::Loggable for TensorBuffer { .downcast_ref::>() .ok_or_else(|| { DeserializationError::datatype_mismatch( - DataType::List(Box::new(Field { + DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::UInt8, is_nullable: false, diff --git a/crates/re_types/src/datatypes/tensor_data.rs b/crates/re_types/src/datatypes/tensor_data.rs index a401e63d2637e..98e76278d97d7 100644 --- a/crates/re_types/src/datatypes/tensor_data.rs +++ b/crates/re_types/src/datatypes/tensor_data.rs @@ -62,10 +62,10 @@ impl ::re_types_core::Loggable for TensorData { #[inline] fn arrow_datatype() -> arrow2::datatypes::DataType { use arrow2::datatypes::*; - DataType::Struct(vec![ + DataType::Struct(std::sync::Arc::new(vec![ Field { name: "shape".to_owned(), - data_type: DataType::List(Box::new(Field { + data_type: DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: ::arrow_datatype(), is_nullable: false, @@ -80,7 +80,7 @@ impl ::re_types_core::Loggable for TensorData { is_nullable: false, metadata: [].into(), }, - ]) + ])) } #[allow(clippy::wildcard_imports)] @@ -139,7 +139,7 @@ impl ::re_types_core::Loggable for TensorData { .unwrap() .into(); ListArray::new( - DataType::List(Box::new(Field { + DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: ::arrow_datatype( ), @@ -200,10 +200,10 @@ impl ::re_types_core::Loggable for TensorData { .downcast_ref::() .ok_or_else(|| { DeserializationError::datatype_mismatch( - DataType::Struct(vec![ + DataType::Struct(std::sync::Arc::new(vec![ Field { name: "shape".to_owned(), - data_type: DataType::List(Box::new(Field { + data_type: DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: ::arrow_datatype( ), @@ -219,7 +219,7 @@ impl ::re_types_core::Loggable for TensorData { is_nullable: false, metadata: [].into(), }, - ]), + ])), arrow_data.data_type().clone(), ) }) @@ -249,7 +249,7 @@ impl ::re_types_core::Loggable for TensorData { .downcast_ref::>() .ok_or_else(|| { DeserializationError::datatype_mismatch( - DataType::List(Box::new(Field { + DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: ::arrow_datatype(), diff --git a/crates/re_types/src/datatypes/tensor_dimension.rs b/crates/re_types/src/datatypes/tensor_dimension.rs index 7e3bb9a54e318..a4256e3657c1b 100644 --- a/crates/re_types/src/datatypes/tensor_dimension.rs +++ b/crates/re_types/src/datatypes/tensor_dimension.rs @@ -57,7 +57,7 @@ impl ::re_types_core::Loggable for TensorDimension { #[inline] fn arrow_datatype() -> arrow2::datatypes::DataType { use arrow2::datatypes::*; - DataType::Struct(vec![ + DataType::Struct(std::sync::Arc::new(vec![ Field { name: "size".to_owned(), data_type: DataType::UInt64, @@ -70,7 +70,7 @@ impl ::re_types_core::Loggable for TensorDimension { is_nullable: true, metadata: [].into(), }, - ]) + ])) } #[allow(clippy::wildcard_imports)] @@ -181,7 +181,7 @@ impl ::re_types_core::Loggable for TensorDimension { .downcast_ref::() .ok_or_else(|| { DeserializationError::datatype_mismatch( - DataType::Struct(vec![ + DataType::Struct(std::sync::Arc::new(vec![ Field { name: "size".to_owned(), data_type: DataType::UInt64, @@ -194,7 +194,7 @@ impl ::re_types_core::Loggable for TensorDimension { is_nullable: true, metadata: [].into(), }, - ]), + ])), arrow_data.data_type().clone(), ) }) diff --git a/crates/re_types/src/datatypes/transform3d.rs b/crates/re_types/src/datatypes/transform3d.rs index f2e3f1f835f55..7c9d3e0392e4f 100644 --- a/crates/re_types/src/datatypes/transform3d.rs +++ b/crates/re_types/src/datatypes/transform3d.rs @@ -63,7 +63,7 @@ impl ::re_types_core::Loggable for Transform3D { fn arrow_datatype() -> arrow2::datatypes::DataType { use arrow2::datatypes::*; DataType::Union( - vec![ + std::sync::Arc::new(vec![ Field { name: "_null_markers".to_owned(), data_type: DataType::Null, @@ -82,8 +82,8 @@ impl ::re_types_core::Loggable for Transform3D { is_nullable: false, metadata: [].into(), }, - ], - Some(vec![0i32, 1i32, 2i32]), + ]), + Some(std::sync::Arc::new(vec![0i32, 1i32, 2i32])), UnionMode::Dense, ) } @@ -221,18 +221,19 @@ impl ::re_types_core::Loggable for Transform3D { .ok_or_else(|| { DeserializationError::datatype_mismatch( DataType::Union( - vec![ - Field { name : "_null_markers".to_owned(), data_type : - DataType::Null, is_nullable : true, metadata : [].into(), }, - Field { name : "TranslationAndMat3x3".to_owned(), data_type : - < crate ::datatypes::TranslationAndMat3x3 > - ::arrow_datatype(), is_nullable : false, metadata : [] - .into(), }, Field { name : "TranslationRotationScale" - .to_owned(), data_type : < crate - ::datatypes::TranslationRotationScale3D > ::arrow_datatype(), - is_nullable : false, metadata : [].into(), }, - ], - Some(vec![0i32, 1i32, 2i32]), + std::sync::Arc::new(vec![ + Field { name : "_null_markers".to_owned(), data_type : + DataType::Null, is_nullable : true, metadata : [].into(), }, + Field { name : "TranslationAndMat3x3".to_owned(), data_type + : < crate ::datatypes::TranslationAndMat3x3 > + ::arrow_datatype(), is_nullable : false, metadata : [] + .into(), }, Field { name : "TranslationRotationScale" + .to_owned(), data_type : < crate + ::datatypes::TranslationRotationScale3D > + ::arrow_datatype(), is_nullable : false, metadata : [] + .into(), }, + ]), + Some(std::sync::Arc::new(vec![0i32, 1i32, 2i32])), UnionMode::Dense, ), arrow_data.data_type().clone(), diff --git a/crates/re_types/src/datatypes/translation_and_mat3x3.rs b/crates/re_types/src/datatypes/translation_and_mat3x3.rs index 22ecdfe55c810..33f705224faa4 100644 --- a/crates/re_types/src/datatypes/translation_and_mat3x3.rs +++ b/crates/re_types/src/datatypes/translation_and_mat3x3.rs @@ -69,7 +69,7 @@ impl ::re_types_core::Loggable for TranslationAndMat3x3 { #[inline] fn arrow_datatype() -> arrow2::datatypes::DataType { use arrow2::datatypes::*; - DataType::Struct(vec![ + DataType::Struct(std::sync::Arc::new(vec![ Field { name: "translation".to_owned(), data_type: ::arrow_datatype(), @@ -88,7 +88,7 @@ impl ::re_types_core::Loggable for TranslationAndMat3x3 { is_nullable: false, metadata: [].into(), }, - ]) + ])) } #[allow(clippy::wildcard_imports)] @@ -159,7 +159,7 @@ impl ::re_types_core::Loggable for TranslationAndMat3x3 { }); FixedSizeListArray::new( DataType::FixedSizeList( - Box::new(Field { + std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::Float32, is_nullable: false, @@ -225,7 +225,7 @@ impl ::re_types_core::Loggable for TranslationAndMat3x3 { }); FixedSizeListArray::new( DataType::FixedSizeList( - Box::new(Field { + std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::Float32, is_nullable: false, @@ -294,7 +294,7 @@ impl ::re_types_core::Loggable for TranslationAndMat3x3 { .downcast_ref::() .ok_or_else(|| { DeserializationError::datatype_mismatch( - DataType::Struct(vec![ + DataType::Struct(std::sync::Arc::new(vec![ Field { name: "translation".to_owned(), data_type: ::arrow_datatype(), @@ -313,7 +313,7 @@ impl ::re_types_core::Loggable for TranslationAndMat3x3 { is_nullable: false, metadata: [].into(), }, - ]), + ])), arrow_data.data_type().clone(), ) }) @@ -344,7 +344,7 @@ impl ::re_types_core::Loggable for TranslationAndMat3x3 { .ok_or_else(|| { DeserializationError::datatype_mismatch( DataType::FixedSizeList( - Box::new(Field { + std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::Float32, is_nullable: false, @@ -430,7 +430,7 @@ impl ::re_types_core::Loggable for TranslationAndMat3x3 { .ok_or_else(|| { DeserializationError::datatype_mismatch( DataType::FixedSizeList( - Box::new(Field { + std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::Float32, is_nullable: false, diff --git a/crates/re_types/src/datatypes/translation_rotation_scale3d.rs b/crates/re_types/src/datatypes/translation_rotation_scale3d.rs index 0896a90eca454..f5ff7396a2da7 100644 --- a/crates/re_types/src/datatypes/translation_rotation_scale3d.rs +++ b/crates/re_types/src/datatypes/translation_rotation_scale3d.rs @@ -72,7 +72,7 @@ impl ::re_types_core::Loggable for TranslationRotationScale3D { #[inline] fn arrow_datatype() -> arrow2::datatypes::DataType { use arrow2::datatypes::*; - DataType::Struct(vec![ + DataType::Struct(std::sync::Arc::new(vec![ Field { name: "translation".to_owned(), data_type: ::arrow_datatype(), @@ -97,7 +97,7 @@ impl ::re_types_core::Loggable for TranslationRotationScale3D { is_nullable: false, metadata: [].into(), }, - ]) + ])) } #[allow(clippy::wildcard_imports)] @@ -168,7 +168,7 @@ impl ::re_types_core::Loggable for TranslationRotationScale3D { }); FixedSizeListArray::new( DataType::FixedSizeList( - Box::new(Field { + std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::Float32, is_nullable: false, @@ -283,7 +283,7 @@ impl ::re_types_core::Loggable for TranslationRotationScale3D { .downcast_ref::() .ok_or_else(|| { DeserializationError::datatype_mismatch( - DataType::Struct(vec![ + DataType::Struct(std::sync::Arc::new(vec![ Field { name: "translation".to_owned(), data_type: ::arrow_datatype(), @@ -308,7 +308,7 @@ impl ::re_types_core::Loggable for TranslationRotationScale3D { is_nullable: false, metadata: [].into(), }, - ]), + ])), arrow_data.data_type().clone(), ) }) @@ -339,7 +339,7 @@ impl ::re_types_core::Loggable for TranslationRotationScale3D { .ok_or_else(|| { DeserializationError::datatype_mismatch( DataType::FixedSizeList( - Box::new(Field { + std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::Float32, is_nullable: false, diff --git a/crates/re_types/src/datatypes/uuid.rs b/crates/re_types/src/datatypes/uuid.rs index fa903940ed1a8..815b8dcdff815 100644 --- a/crates/re_types/src/datatypes/uuid.rs +++ b/crates/re_types/src/datatypes/uuid.rs @@ -68,10 +68,10 @@ impl ::re_types_core::Loggable for Uuid { #[inline] fn arrow_datatype() -> arrow2::datatypes::DataType { use arrow2::datatypes::*; - DataType::Struct(vec![Field { + DataType::Struct(std::sync::Arc::new(vec![Field { name: "bytes".to_owned(), data_type: DataType::FixedSizeList( - Box::new(Field { + std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::UInt8, is_nullable: false, @@ -81,7 +81,7 @@ impl ::re_types_core::Loggable for Uuid { ), is_nullable: false, metadata: [].into(), - }]) + }])) } #[allow(clippy::wildcard_imports)] @@ -145,7 +145,7 @@ impl ::re_types_core::Loggable for Uuid { }); FixedSizeListArray::new( DataType::FixedSizeList( - Box::new(Field { + std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::UInt8, is_nullable: false, @@ -188,10 +188,10 @@ impl ::re_types_core::Loggable for Uuid { .downcast_ref::() .ok_or_else(|| { DeserializationError::datatype_mismatch( - DataType::Struct(vec![Field { + DataType::Struct(std::sync::Arc::new(vec![Field { name: "bytes".to_owned(), data_type: DataType::FixedSizeList( - Box::new(Field { + std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::UInt8, is_nullable: false, @@ -201,7 +201,7 @@ impl ::re_types_core::Loggable for Uuid { ), is_nullable: false, metadata: [].into(), - }]), + }])), arrow_data.data_type().clone(), ) }) @@ -232,7 +232,7 @@ impl ::re_types_core::Loggable for Uuid { .ok_or_else(|| { DeserializationError::datatype_mismatch( DataType::FixedSizeList( - Box::new(Field { + std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::UInt8, is_nullable: false, diff --git a/crates/re_types/src/datatypes/uvec2d.rs b/crates/re_types/src/datatypes/uvec2d.rs index 8e5db98aeb210..b5a4a0686d00f 100644 --- a/crates/re_types/src/datatypes/uvec2d.rs +++ b/crates/re_types/src/datatypes/uvec2d.rs @@ -67,7 +67,7 @@ impl ::re_types_core::Loggable for UVec2D { fn arrow_datatype() -> arrow2::datatypes::DataType { use arrow2::datatypes::*; DataType::FixedSizeList( - Box::new(Field { + std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::UInt32, is_nullable: false, @@ -157,7 +157,7 @@ impl ::re_types_core::Loggable for UVec2D { .ok_or_else(|| { DeserializationError::datatype_mismatch( DataType::FixedSizeList( - Box::new(Field { + std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::UInt32, is_nullable: false, diff --git a/crates/re_types/src/datatypes/uvec3d.rs b/crates/re_types/src/datatypes/uvec3d.rs index 8627ac63e383b..506c560fbd506 100644 --- a/crates/re_types/src/datatypes/uvec3d.rs +++ b/crates/re_types/src/datatypes/uvec3d.rs @@ -67,7 +67,7 @@ impl ::re_types_core::Loggable for UVec3D { fn arrow_datatype() -> arrow2::datatypes::DataType { use arrow2::datatypes::*; DataType::FixedSizeList( - Box::new(Field { + std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::UInt32, is_nullable: false, @@ -157,7 +157,7 @@ impl ::re_types_core::Loggable for UVec3D { .ok_or_else(|| { DeserializationError::datatype_mismatch( DataType::FixedSizeList( - Box::new(Field { + std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::UInt32, is_nullable: false, diff --git a/crates/re_types/src/datatypes/uvec4d.rs b/crates/re_types/src/datatypes/uvec4d.rs index 4fbb59e8a644a..7682c2525c40c 100644 --- a/crates/re_types/src/datatypes/uvec4d.rs +++ b/crates/re_types/src/datatypes/uvec4d.rs @@ -67,7 +67,7 @@ impl ::re_types_core::Loggable for UVec4D { fn arrow_datatype() -> arrow2::datatypes::DataType { use arrow2::datatypes::*; DataType::FixedSizeList( - Box::new(Field { + std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::UInt32, is_nullable: false, @@ -157,7 +157,7 @@ impl ::re_types_core::Loggable for UVec4D { .ok_or_else(|| { DeserializationError::datatype_mismatch( DataType::FixedSizeList( - Box::new(Field { + std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::UInt32, is_nullable: false, diff --git a/crates/re_types/src/datatypes/vec2d.rs b/crates/re_types/src/datatypes/vec2d.rs index f68aa941fb5f1..850c0581e88f8 100644 --- a/crates/re_types/src/datatypes/vec2d.rs +++ b/crates/re_types/src/datatypes/vec2d.rs @@ -67,7 +67,7 @@ impl ::re_types_core::Loggable for Vec2D { fn arrow_datatype() -> arrow2::datatypes::DataType { use arrow2::datatypes::*; DataType::FixedSizeList( - Box::new(Field { + std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::Float32, is_nullable: false, @@ -157,7 +157,7 @@ impl ::re_types_core::Loggable for Vec2D { .ok_or_else(|| { DeserializationError::datatype_mismatch( DataType::FixedSizeList( - Box::new(Field { + std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::Float32, is_nullable: false, diff --git a/crates/re_types/src/datatypes/vec3d.rs b/crates/re_types/src/datatypes/vec3d.rs index a1680fc606c2e..d3d05bc42e34c 100644 --- a/crates/re_types/src/datatypes/vec3d.rs +++ b/crates/re_types/src/datatypes/vec3d.rs @@ -67,7 +67,7 @@ impl ::re_types_core::Loggable for Vec3D { fn arrow_datatype() -> arrow2::datatypes::DataType { use arrow2::datatypes::*; DataType::FixedSizeList( - Box::new(Field { + std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::Float32, is_nullable: false, @@ -157,7 +157,7 @@ impl ::re_types_core::Loggable for Vec3D { .ok_or_else(|| { DeserializationError::datatype_mismatch( DataType::FixedSizeList( - Box::new(Field { + std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::Float32, is_nullable: false, diff --git a/crates/re_types/src/datatypes/vec4d.rs b/crates/re_types/src/datatypes/vec4d.rs index 8be22935cb1d1..00ce551841b0d 100644 --- a/crates/re_types/src/datatypes/vec4d.rs +++ b/crates/re_types/src/datatypes/vec4d.rs @@ -67,7 +67,7 @@ impl ::re_types_core::Loggable for Vec4D { fn arrow_datatype() -> arrow2::datatypes::DataType { use arrow2::datatypes::*; DataType::FixedSizeList( - Box::new(Field { + std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::Float32, is_nullable: false, @@ -157,7 +157,7 @@ impl ::re_types_core::Loggable for Vec4D { .ok_or_else(|| { DeserializationError::datatype_mismatch( DataType::FixedSizeList( - Box::new(Field { + std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::Float32, is_nullable: false, diff --git a/crates/re_types/src/testing/components/affix_fuzzer1.rs b/crates/re_types/src/testing/components/affix_fuzzer1.rs index b7471fdb97192..8e1d1edf227d2 100644 --- a/crates/re_types/src/testing/components/affix_fuzzer1.rs +++ b/crates/re_types/src/testing/components/affix_fuzzer1.rs @@ -72,7 +72,7 @@ impl ::re_types_core::Loggable for AffixFuzzer1 { #[inline] fn arrow_datatype() -> arrow2::datatypes::DataType { use arrow2::datatypes::*; - DataType::Struct(vec![ + DataType::Struct(std::sync::Arc::new(vec![ Field { name: "single_float_optional".to_owned(), data_type: DataType::Float32, @@ -93,7 +93,7 @@ impl ::re_types_core::Loggable for AffixFuzzer1 { }, Field { name: "many_floats_optional".to_owned(), - data_type: DataType::List(Box::new(Field { + data_type: DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::Float32, is_nullable: false, @@ -104,7 +104,7 @@ impl ::re_types_core::Loggable for AffixFuzzer1 { }, Field { name: "many_strings_required".to_owned(), - data_type: DataType::List(Box::new(Field { + data_type: DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::Utf8, is_nullable: false, @@ -115,7 +115,7 @@ impl ::re_types_core::Loggable for AffixFuzzer1 { }, Field { name: "many_strings_optional".to_owned(), - data_type: DataType::List(Box::new(Field { + data_type: DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::Utf8, is_nullable: false, @@ -142,7 +142,7 @@ impl ::re_types_core::Loggable for AffixFuzzer1 { is_nullable: true, metadata: [].into(), }, - ]) + ])) } #[allow(clippy::wildcard_imports)] diff --git a/crates/re_types/src/testing/components/affix_fuzzer11.rs b/crates/re_types/src/testing/components/affix_fuzzer11.rs index c59ea8b540c50..c2a4f90be5eae 100644 --- a/crates/re_types/src/testing/components/affix_fuzzer11.rs +++ b/crates/re_types/src/testing/components/affix_fuzzer11.rs @@ -64,7 +64,7 @@ impl ::re_types_core::Loggable for AffixFuzzer11 { #[inline] fn arrow_datatype() -> arrow2::datatypes::DataType { use arrow2::datatypes::*; - DataType::List(Box::new(Field { + DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::Float32, is_nullable: false, @@ -144,7 +144,7 @@ impl ::re_types_core::Loggable for AffixFuzzer11 { .downcast_ref::>() .ok_or_else(|| { DeserializationError::datatype_mismatch( - DataType::List(Box::new(Field { + DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::Float32, is_nullable: false, diff --git a/crates/re_types/src/testing/components/affix_fuzzer12.rs b/crates/re_types/src/testing/components/affix_fuzzer12.rs index 73effca560efb..0cd857d65150f 100644 --- a/crates/re_types/src/testing/components/affix_fuzzer12.rs +++ b/crates/re_types/src/testing/components/affix_fuzzer12.rs @@ -64,7 +64,7 @@ impl ::re_types_core::Loggable for AffixFuzzer12 { #[inline] fn arrow_datatype() -> arrow2::datatypes::DataType { use arrow2::datatypes::*; - DataType::List(Box::new(Field { + DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::Utf8, is_nullable: false, @@ -164,7 +164,7 @@ impl ::re_types_core::Loggable for AffixFuzzer12 { .downcast_ref::>() .ok_or_else(|| { DeserializationError::datatype_mismatch( - DataType::List(Box::new(Field { + DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::Utf8, is_nullable: false, diff --git a/crates/re_types/src/testing/components/affix_fuzzer13.rs b/crates/re_types/src/testing/components/affix_fuzzer13.rs index 22fd8d1010832..249cdd0eeb839 100644 --- a/crates/re_types/src/testing/components/affix_fuzzer13.rs +++ b/crates/re_types/src/testing/components/affix_fuzzer13.rs @@ -64,7 +64,7 @@ impl ::re_types_core::Loggable for AffixFuzzer13 { #[inline] fn arrow_datatype() -> arrow2::datatypes::DataType { use arrow2::datatypes::*; - DataType::List(Box::new(Field { + DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::Utf8, is_nullable: false, @@ -166,7 +166,7 @@ impl ::re_types_core::Loggable for AffixFuzzer13 { .downcast_ref::>() .ok_or_else(|| { DeserializationError::datatype_mismatch( - DataType::List(Box::new(Field { + DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::Utf8, is_nullable: false, diff --git a/crates/re_types/src/testing/components/affix_fuzzer14.rs b/crates/re_types/src/testing/components/affix_fuzzer14.rs index 3452343dfb467..e16c931ead2ad 100644 --- a/crates/re_types/src/testing/components/affix_fuzzer14.rs +++ b/crates/re_types/src/testing/components/affix_fuzzer14.rs @@ -73,7 +73,7 @@ impl ::re_types_core::Loggable for AffixFuzzer14 { fn arrow_datatype() -> arrow2::datatypes::DataType { use arrow2::datatypes::*; DataType::Union( - vec![ + std::sync::Arc::new(vec![ Field { name: "_null_markers".to_owned(), data_type: DataType::Null, @@ -94,7 +94,7 @@ impl ::re_types_core::Loggable for AffixFuzzer14 { }, Field { name: "craziness".to_owned(), - data_type: DataType::List(Box::new(Field { + data_type: DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: ::arrow_datatype(), is_nullable: false, @@ -106,7 +106,7 @@ impl ::re_types_core::Loggable for AffixFuzzer14 { Field { name: "fixed_size_shenanigans".to_owned(), data_type: DataType::FixedSizeList( - Box::new(Field { + std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::Float32, is_nullable: false, @@ -117,8 +117,8 @@ impl ::re_types_core::Loggable for AffixFuzzer14 { is_nullable: false, metadata: [].into(), }, - ], - Some(vec![0i32, 1i32, 2i32, 3i32, 4i32]), + ]), + Some(std::sync::Arc::new(vec![0i32, 1i32, 2i32, 3i32, 4i32])), UnionMode::Dense, ) } diff --git a/crates/re_types/src/testing/components/affix_fuzzer15.rs b/crates/re_types/src/testing/components/affix_fuzzer15.rs index 0fa3772128c96..4cf54e8d02b02 100644 --- a/crates/re_types/src/testing/components/affix_fuzzer15.rs +++ b/crates/re_types/src/testing/components/affix_fuzzer15.rs @@ -73,7 +73,7 @@ impl ::re_types_core::Loggable for AffixFuzzer15 { fn arrow_datatype() -> arrow2::datatypes::DataType { use arrow2::datatypes::*; DataType::Union( - vec![ + std::sync::Arc::new(vec![ Field { name: "_null_markers".to_owned(), data_type: DataType::Null, @@ -94,7 +94,7 @@ impl ::re_types_core::Loggable for AffixFuzzer15 { }, Field { name: "craziness".to_owned(), - data_type: DataType::List(Box::new(Field { + data_type: DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: ::arrow_datatype(), is_nullable: false, @@ -106,7 +106,7 @@ impl ::re_types_core::Loggable for AffixFuzzer15 { Field { name: "fixed_size_shenanigans".to_owned(), data_type: DataType::FixedSizeList( - Box::new(Field { + std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::Float32, is_nullable: false, @@ -117,8 +117,8 @@ impl ::re_types_core::Loggable for AffixFuzzer15 { is_nullable: false, metadata: [].into(), }, - ], - Some(vec![0i32, 1i32, 2i32, 3i32, 4i32]), + ]), + Some(std::sync::Arc::new(vec![0i32, 1i32, 2i32, 3i32, 4i32])), UnionMode::Dense, ) } diff --git a/crates/re_types/src/testing/components/affix_fuzzer16.rs b/crates/re_types/src/testing/components/affix_fuzzer16.rs index 59308562ab385..437db4764ab2e 100644 --- a/crates/re_types/src/testing/components/affix_fuzzer16.rs +++ b/crates/re_types/src/testing/components/affix_fuzzer16.rs @@ -58,7 +58,7 @@ impl ::re_types_core::Loggable for AffixFuzzer16 { #[inline] fn arrow_datatype() -> arrow2::datatypes::DataType { use arrow2::datatypes::*; - DataType::List(Box::new(Field { + DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: ::arrow_datatype(), is_nullable: false, @@ -137,7 +137,7 @@ impl ::re_types_core::Loggable for AffixFuzzer16 { .downcast_ref::>() .ok_or_else(|| { DeserializationError::datatype_mismatch( - DataType::List(Box::new(Field { + DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: ::arrow_datatype(), is_nullable: false, diff --git a/crates/re_types/src/testing/components/affix_fuzzer17.rs b/crates/re_types/src/testing/components/affix_fuzzer17.rs index 08d77489209f4..41b1d730ff206 100644 --- a/crates/re_types/src/testing/components/affix_fuzzer17.rs +++ b/crates/re_types/src/testing/components/affix_fuzzer17.rs @@ -58,7 +58,7 @@ impl ::re_types_core::Loggable for AffixFuzzer17 { #[inline] fn arrow_datatype() -> arrow2::datatypes::DataType { use arrow2::datatypes::*; - DataType::List(Box::new(Field { + DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: ::arrow_datatype(), is_nullable: false, @@ -139,7 +139,7 @@ impl ::re_types_core::Loggable for AffixFuzzer17 { .downcast_ref::>() .ok_or_else(|| { DeserializationError::datatype_mismatch( - DataType::List(Box::new(Field { + DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: ::arrow_datatype(), is_nullable: false, diff --git a/crates/re_types/src/testing/components/affix_fuzzer18.rs b/crates/re_types/src/testing/components/affix_fuzzer18.rs index f6ce74106dca7..135f07aad5343 100644 --- a/crates/re_types/src/testing/components/affix_fuzzer18.rs +++ b/crates/re_types/src/testing/components/affix_fuzzer18.rs @@ -58,7 +58,7 @@ impl ::re_types_core::Loggable for AffixFuzzer18 { #[inline] fn arrow_datatype() -> arrow2::datatypes::DataType { use arrow2::datatypes::*; - DataType::List(Box::new(Field { + DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: ::arrow_datatype(), is_nullable: false, @@ -139,7 +139,7 @@ impl ::re_types_core::Loggable for AffixFuzzer18 { .downcast_ref::>() .ok_or_else(|| { DeserializationError::datatype_mismatch( - DataType::List(Box::new(Field { + DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: ::arrow_datatype(), is_nullable: false, diff --git a/crates/re_types/src/testing/components/affix_fuzzer19.rs b/crates/re_types/src/testing/components/affix_fuzzer19.rs index bd0b8c7b7ac5e..342191c44e4b8 100644 --- a/crates/re_types/src/testing/components/affix_fuzzer19.rs +++ b/crates/re_types/src/testing/components/affix_fuzzer19.rs @@ -72,12 +72,12 @@ impl ::re_types_core::Loggable for AffixFuzzer19 { #[inline] fn arrow_datatype() -> arrow2::datatypes::DataType { use arrow2::datatypes::*; - DataType::Struct(vec![Field { + DataType::Struct(std::sync::Arc::new(vec![Field { name: "single_optional_union".to_owned(), data_type: ::arrow_datatype(), is_nullable: true, metadata: [].into(), - }]) + }])) } #[allow(clippy::wildcard_imports)] diff --git a/crates/re_types/src/testing/components/affix_fuzzer2.rs b/crates/re_types/src/testing/components/affix_fuzzer2.rs index 4d014375ab58f..0198e85e7cfd6 100644 --- a/crates/re_types/src/testing/components/affix_fuzzer2.rs +++ b/crates/re_types/src/testing/components/affix_fuzzer2.rs @@ -72,7 +72,7 @@ impl ::re_types_core::Loggable for AffixFuzzer2 { #[inline] fn arrow_datatype() -> arrow2::datatypes::DataType { use arrow2::datatypes::*; - DataType::Struct(vec![ + DataType::Struct(std::sync::Arc::new(vec![ Field { name: "single_float_optional".to_owned(), data_type: DataType::Float32, @@ -93,7 +93,7 @@ impl ::re_types_core::Loggable for AffixFuzzer2 { }, Field { name: "many_floats_optional".to_owned(), - data_type: DataType::List(Box::new(Field { + data_type: DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::Float32, is_nullable: false, @@ -104,7 +104,7 @@ impl ::re_types_core::Loggable for AffixFuzzer2 { }, Field { name: "many_strings_required".to_owned(), - data_type: DataType::List(Box::new(Field { + data_type: DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::Utf8, is_nullable: false, @@ -115,7 +115,7 @@ impl ::re_types_core::Loggable for AffixFuzzer2 { }, Field { name: "many_strings_optional".to_owned(), - data_type: DataType::List(Box::new(Field { + data_type: DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::Utf8, is_nullable: false, @@ -142,7 +142,7 @@ impl ::re_types_core::Loggable for AffixFuzzer2 { is_nullable: true, metadata: [].into(), }, - ]) + ])) } #[allow(clippy::wildcard_imports)] diff --git a/crates/re_types/src/testing/components/affix_fuzzer20.rs b/crates/re_types/src/testing/components/affix_fuzzer20.rs index a27f8fe240a60..eff7e05b6a766 100644 --- a/crates/re_types/src/testing/components/affix_fuzzer20.rs +++ b/crates/re_types/src/testing/components/affix_fuzzer20.rs @@ -72,7 +72,7 @@ impl ::re_types_core::Loggable for AffixFuzzer20 { #[inline] fn arrow_datatype() -> arrow2::datatypes::DataType { use arrow2::datatypes::*; - DataType::Struct(vec![ + DataType::Struct(std::sync::Arc::new(vec![ Field { name: "p".to_owned(), data_type: ::arrow_datatype(), @@ -85,7 +85,7 @@ impl ::re_types_core::Loggable for AffixFuzzer20 { is_nullable: false, metadata: [].into(), }, - ]) + ])) } #[allow(clippy::wildcard_imports)] diff --git a/crates/re_types/src/testing/components/affix_fuzzer21.rs b/crates/re_types/src/testing/components/affix_fuzzer21.rs index 8a2821572c0aa..4a34e8acaca2f 100644 --- a/crates/re_types/src/testing/components/affix_fuzzer21.rs +++ b/crates/re_types/src/testing/components/affix_fuzzer21.rs @@ -72,7 +72,7 @@ impl ::re_types_core::Loggable for AffixFuzzer21 { #[inline] fn arrow_datatype() -> arrow2::datatypes::DataType { use arrow2::datatypes::*; - DataType::Struct(vec![ + DataType::Struct(std::sync::Arc::new(vec![ Field { name: "single_half".to_owned(), data_type: DataType::Float16, @@ -81,7 +81,7 @@ impl ::re_types_core::Loggable for AffixFuzzer21 { }, Field { name: "many_halves".to_owned(), - data_type: DataType::List(Box::new(Field { + data_type: DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::Float16, is_nullable: false, @@ -90,7 +90,7 @@ impl ::re_types_core::Loggable for AffixFuzzer21 { is_nullable: false, metadata: [].into(), }, - ]) + ])) } #[allow(clippy::wildcard_imports)] diff --git a/crates/re_types/src/testing/components/affix_fuzzer22.rs b/crates/re_types/src/testing/components/affix_fuzzer22.rs index d14d4b5fd684b..f3819769129b4 100644 --- a/crates/re_types/src/testing/components/affix_fuzzer22.rs +++ b/crates/re_types/src/testing/components/affix_fuzzer22.rs @@ -72,10 +72,10 @@ impl ::re_types_core::Loggable for AffixFuzzer22 { #[inline] fn arrow_datatype() -> arrow2::datatypes::DataType { use arrow2::datatypes::*; - DataType::Struct(vec![Field { + DataType::Struct(std::sync::Arc::new(vec![Field { name: "fixed_sized_native".to_owned(), data_type: DataType::FixedSizeList( - Box::new(Field { + std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::UInt8, is_nullable: false, @@ -85,7 +85,7 @@ impl ::re_types_core::Loggable for AffixFuzzer22 { ), is_nullable: false, metadata: [].into(), - }]) + }])) } #[allow(clippy::wildcard_imports)] diff --git a/crates/re_types/src/testing/components/affix_fuzzer3.rs b/crates/re_types/src/testing/components/affix_fuzzer3.rs index 7f159dc6e154a..284ade3dc146d 100644 --- a/crates/re_types/src/testing/components/affix_fuzzer3.rs +++ b/crates/re_types/src/testing/components/affix_fuzzer3.rs @@ -72,7 +72,7 @@ impl ::re_types_core::Loggable for AffixFuzzer3 { #[inline] fn arrow_datatype() -> arrow2::datatypes::DataType { use arrow2::datatypes::*; - DataType::Struct(vec![ + DataType::Struct(std::sync::Arc::new(vec![ Field { name: "single_float_optional".to_owned(), data_type: DataType::Float32, @@ -93,7 +93,7 @@ impl ::re_types_core::Loggable for AffixFuzzer3 { }, Field { name: "many_floats_optional".to_owned(), - data_type: DataType::List(Box::new(Field { + data_type: DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::Float32, is_nullable: false, @@ -104,7 +104,7 @@ impl ::re_types_core::Loggable for AffixFuzzer3 { }, Field { name: "many_strings_required".to_owned(), - data_type: DataType::List(Box::new(Field { + data_type: DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::Utf8, is_nullable: false, @@ -115,7 +115,7 @@ impl ::re_types_core::Loggable for AffixFuzzer3 { }, Field { name: "many_strings_optional".to_owned(), - data_type: DataType::List(Box::new(Field { + data_type: DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::Utf8, is_nullable: false, @@ -142,7 +142,7 @@ impl ::re_types_core::Loggable for AffixFuzzer3 { is_nullable: true, metadata: [].into(), }, - ]) + ])) } #[allow(clippy::wildcard_imports)] diff --git a/crates/re_types/src/testing/components/affix_fuzzer4.rs b/crates/re_types/src/testing/components/affix_fuzzer4.rs index 5118e0cd4a8fd..6332092b76283 100644 --- a/crates/re_types/src/testing/components/affix_fuzzer4.rs +++ b/crates/re_types/src/testing/components/affix_fuzzer4.rs @@ -72,7 +72,7 @@ impl ::re_types_core::Loggable for AffixFuzzer4 { #[inline] fn arrow_datatype() -> arrow2::datatypes::DataType { use arrow2::datatypes::*; - DataType::Struct(vec![ + DataType::Struct(std::sync::Arc::new(vec![ Field { name: "single_float_optional".to_owned(), data_type: DataType::Float32, @@ -93,7 +93,7 @@ impl ::re_types_core::Loggable for AffixFuzzer4 { }, Field { name: "many_floats_optional".to_owned(), - data_type: DataType::List(Box::new(Field { + data_type: DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::Float32, is_nullable: false, @@ -104,7 +104,7 @@ impl ::re_types_core::Loggable for AffixFuzzer4 { }, Field { name: "many_strings_required".to_owned(), - data_type: DataType::List(Box::new(Field { + data_type: DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::Utf8, is_nullable: false, @@ -115,7 +115,7 @@ impl ::re_types_core::Loggable for AffixFuzzer4 { }, Field { name: "many_strings_optional".to_owned(), - data_type: DataType::List(Box::new(Field { + data_type: DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::Utf8, is_nullable: false, @@ -142,7 +142,7 @@ impl ::re_types_core::Loggable for AffixFuzzer4 { is_nullable: true, metadata: [].into(), }, - ]) + ])) } #[allow(clippy::wildcard_imports)] diff --git a/crates/re_types/src/testing/components/affix_fuzzer5.rs b/crates/re_types/src/testing/components/affix_fuzzer5.rs index 492aa921f71b9..2871537f88243 100644 --- a/crates/re_types/src/testing/components/affix_fuzzer5.rs +++ b/crates/re_types/src/testing/components/affix_fuzzer5.rs @@ -72,7 +72,7 @@ impl ::re_types_core::Loggable for AffixFuzzer5 { #[inline] fn arrow_datatype() -> arrow2::datatypes::DataType { use arrow2::datatypes::*; - DataType::Struct(vec![ + DataType::Struct(std::sync::Arc::new(vec![ Field { name: "single_float_optional".to_owned(), data_type: DataType::Float32, @@ -93,7 +93,7 @@ impl ::re_types_core::Loggable for AffixFuzzer5 { }, Field { name: "many_floats_optional".to_owned(), - data_type: DataType::List(Box::new(Field { + data_type: DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::Float32, is_nullable: false, @@ -104,7 +104,7 @@ impl ::re_types_core::Loggable for AffixFuzzer5 { }, Field { name: "many_strings_required".to_owned(), - data_type: DataType::List(Box::new(Field { + data_type: DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::Utf8, is_nullable: false, @@ -115,7 +115,7 @@ impl ::re_types_core::Loggable for AffixFuzzer5 { }, Field { name: "many_strings_optional".to_owned(), - data_type: DataType::List(Box::new(Field { + data_type: DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::Utf8, is_nullable: false, @@ -142,7 +142,7 @@ impl ::re_types_core::Loggable for AffixFuzzer5 { is_nullable: true, metadata: [].into(), }, - ]) + ])) } #[allow(clippy::wildcard_imports)] diff --git a/crates/re_types/src/testing/components/affix_fuzzer6.rs b/crates/re_types/src/testing/components/affix_fuzzer6.rs index fc2f54c3e9ce9..f5cf910ccdcad 100644 --- a/crates/re_types/src/testing/components/affix_fuzzer6.rs +++ b/crates/re_types/src/testing/components/affix_fuzzer6.rs @@ -72,7 +72,7 @@ impl ::re_types_core::Loggable for AffixFuzzer6 { #[inline] fn arrow_datatype() -> arrow2::datatypes::DataType { use arrow2::datatypes::*; - DataType::Struct(vec![ + DataType::Struct(std::sync::Arc::new(vec![ Field { name: "single_float_optional".to_owned(), data_type: DataType::Float32, @@ -93,7 +93,7 @@ impl ::re_types_core::Loggable for AffixFuzzer6 { }, Field { name: "many_floats_optional".to_owned(), - data_type: DataType::List(Box::new(Field { + data_type: DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::Float32, is_nullable: false, @@ -104,7 +104,7 @@ impl ::re_types_core::Loggable for AffixFuzzer6 { }, Field { name: "many_strings_required".to_owned(), - data_type: DataType::List(Box::new(Field { + data_type: DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::Utf8, is_nullable: false, @@ -115,7 +115,7 @@ impl ::re_types_core::Loggable for AffixFuzzer6 { }, Field { name: "many_strings_optional".to_owned(), - data_type: DataType::List(Box::new(Field { + data_type: DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::Utf8, is_nullable: false, @@ -142,7 +142,7 @@ impl ::re_types_core::Loggable for AffixFuzzer6 { is_nullable: true, metadata: [].into(), }, - ]) + ])) } #[allow(clippy::wildcard_imports)] diff --git a/crates/re_types/src/testing/components/affix_fuzzer7.rs b/crates/re_types/src/testing/components/affix_fuzzer7.rs index ef69d41d26a95..7c86f945ed727 100644 --- a/crates/re_types/src/testing/components/affix_fuzzer7.rs +++ b/crates/re_types/src/testing/components/affix_fuzzer7.rs @@ -58,7 +58,7 @@ impl ::re_types_core::Loggable for AffixFuzzer7 { #[inline] fn arrow_datatype() -> arrow2::datatypes::DataType { use arrow2::datatypes::*; - DataType::List(Box::new(Field { + DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: ::arrow_datatype(), is_nullable: false, @@ -139,7 +139,7 @@ impl ::re_types_core::Loggable for AffixFuzzer7 { .downcast_ref::>() .ok_or_else(|| { DeserializationError::datatype_mismatch( - DataType::List(Box::new(Field { + DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: ::arrow_datatype(), is_nullable: false, diff --git a/crates/re_types/src/testing/datatypes/affix_fuzzer1.rs b/crates/re_types/src/testing/datatypes/affix_fuzzer1.rs index 9e66717842ddd..46d4b53539a10 100644 --- a/crates/re_types/src/testing/datatypes/affix_fuzzer1.rs +++ b/crates/re_types/src/testing/datatypes/affix_fuzzer1.rs @@ -76,7 +76,7 @@ impl ::re_types_core::Loggable for AffixFuzzer1 { #[inline] fn arrow_datatype() -> arrow2::datatypes::DataType { use arrow2::datatypes::*; - DataType::Struct(vec![ + DataType::Struct(std::sync::Arc::new(vec![ Field { name: "single_float_optional".to_owned(), data_type: DataType::Float32, @@ -97,7 +97,7 @@ impl ::re_types_core::Loggable for AffixFuzzer1 { }, Field { name: "many_floats_optional".to_owned(), - data_type: DataType::List(Box::new(Field { + data_type: DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::Float32, is_nullable: false, @@ -108,7 +108,7 @@ impl ::re_types_core::Loggable for AffixFuzzer1 { }, Field { name: "many_strings_required".to_owned(), - data_type: DataType::List(Box::new(Field { + data_type: DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::Utf8, is_nullable: false, @@ -119,7 +119,7 @@ impl ::re_types_core::Loggable for AffixFuzzer1 { }, Field { name: "many_strings_optional".to_owned(), - data_type: DataType::List(Box::new(Field { + data_type: DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::Utf8, is_nullable: false, @@ -146,7 +146,7 @@ impl ::re_types_core::Loggable for AffixFuzzer1 { is_nullable: true, metadata: [].into(), }, - ]) + ])) } #[allow(clippy::wildcard_imports)] @@ -335,7 +335,7 @@ impl ::re_types_core::Loggable for AffixFuzzer1 { .unwrap() .into(); ListArray::new( - DataType::List(Box::new(Field { + DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::Float32, is_nullable: false, @@ -390,7 +390,7 @@ impl ::re_types_core::Loggable for AffixFuzzer1 { .unwrap() .into(); ListArray::new( - DataType::List(Box::new(Field { + DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::Utf8, is_nullable: false, @@ -469,7 +469,7 @@ impl ::re_types_core::Loggable for AffixFuzzer1 { .unwrap() .into(); ListArray::new( - DataType::List(Box::new(Field { + DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::Utf8, is_nullable: false, @@ -610,7 +610,7 @@ impl ::re_types_core::Loggable for AffixFuzzer1 { .downcast_ref::() .ok_or_else(|| { DeserializationError::datatype_mismatch( - DataType::Struct(vec![ + DataType::Struct(std::sync::Arc::new(vec![ Field { name: "single_float_optional".to_owned(), data_type: DataType::Float32, @@ -631,7 +631,7 @@ impl ::re_types_core::Loggable for AffixFuzzer1 { }, Field { name: "many_floats_optional".to_owned(), - data_type: DataType::List(Box::new(Field { + data_type: DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::Float32, is_nullable: false, @@ -642,7 +642,7 @@ impl ::re_types_core::Loggable for AffixFuzzer1 { }, Field { name: "many_strings_required".to_owned(), - data_type: DataType::List(Box::new(Field { + data_type: DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::Utf8, is_nullable: false, @@ -653,7 +653,7 @@ impl ::re_types_core::Loggable for AffixFuzzer1 { }, Field { name: "many_strings_optional".to_owned(), - data_type: DataType::List(Box::new(Field { + data_type: DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::Utf8, is_nullable: false, @@ -681,7 +681,7 @@ impl ::re_types_core::Loggable for AffixFuzzer1 { is_nullable: true, metadata: [].into(), }, - ]), + ])), arrow_data.data_type().clone(), ) }) @@ -849,7 +849,7 @@ impl ::re_types_core::Loggable for AffixFuzzer1 { .downcast_ref::>() .ok_or_else(|| { DeserializationError::datatype_mismatch( - DataType::List(Box::new(Field { + DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::Float32, is_nullable: false, @@ -926,7 +926,7 @@ impl ::re_types_core::Loggable for AffixFuzzer1 { .downcast_ref::>() .ok_or_else(|| { DeserializationError::datatype_mismatch( - DataType::List(Box::new(Field { + DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::Utf8, is_nullable: false, @@ -1048,7 +1048,7 @@ impl ::re_types_core::Loggable for AffixFuzzer1 { .downcast_ref::>() .ok_or_else(|| { DeserializationError::datatype_mismatch( - DataType::List(Box::new(Field { + DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::Utf8, is_nullable: false, diff --git a/crates/re_types/src/testing/datatypes/affix_fuzzer20.rs b/crates/re_types/src/testing/datatypes/affix_fuzzer20.rs index 9627ba61b8e82..2c04c91647b8b 100644 --- a/crates/re_types/src/testing/datatypes/affix_fuzzer20.rs +++ b/crates/re_types/src/testing/datatypes/affix_fuzzer20.rs @@ -54,7 +54,7 @@ impl ::re_types_core::Loggable for AffixFuzzer20 { #[inline] fn arrow_datatype() -> arrow2::datatypes::DataType { use arrow2::datatypes::*; - DataType::Struct(vec![ + DataType::Struct(std::sync::Arc::new(vec![ Field { name: "p".to_owned(), data_type: ::arrow_datatype(), @@ -67,7 +67,7 @@ impl ::re_types_core::Loggable for AffixFuzzer20 { is_nullable: false, metadata: [].into(), }, - ]) + ])) } #[allow(clippy::wildcard_imports)] @@ -200,15 +200,15 @@ impl ::re_types_core::Loggable for AffixFuzzer20 { .downcast_ref::() .ok_or_else(|| { DeserializationError::datatype_mismatch( - DataType::Struct(vec![ - Field { name : "p".to_owned(), data_type : < crate - ::testing::datatypes::PrimitiveComponent > - ::arrow_datatype(), is_nullable : false, metadata : [] - .into(), }, Field { name : "s".to_owned(), data_type : < - crate ::testing::datatypes::StringComponent > - ::arrow_datatype(), is_nullable : false, metadata : [] - .into(), }, - ]), + DataType::Struct(std::sync::Arc::new(vec![ + Field { name : "p".to_owned(), data_type : < crate + ::testing::datatypes::PrimitiveComponent > + ::arrow_datatype(), is_nullable : false, metadata : [] + .into(), }, Field { name : "s".to_owned(), data_type : < + crate ::testing::datatypes::StringComponent > + ::arrow_datatype(), is_nullable : false, metadata : [] + .into(), }, + ])), arrow_data.data_type().clone(), ) }) diff --git a/crates/re_types/src/testing/datatypes/affix_fuzzer21.rs b/crates/re_types/src/testing/datatypes/affix_fuzzer21.rs index 639f13f496890..356a9c951be25 100644 --- a/crates/re_types/src/testing/datatypes/affix_fuzzer21.rs +++ b/crates/re_types/src/testing/datatypes/affix_fuzzer21.rs @@ -54,7 +54,7 @@ impl ::re_types_core::Loggable for AffixFuzzer21 { #[inline] fn arrow_datatype() -> arrow2::datatypes::DataType { use arrow2::datatypes::*; - DataType::Struct(vec![ + DataType::Struct(std::sync::Arc::new(vec![ Field { name: "single_half".to_owned(), data_type: DataType::Float16, @@ -63,7 +63,7 @@ impl ::re_types_core::Loggable for AffixFuzzer21 { }, Field { name: "many_halves".to_owned(), - data_type: DataType::List(Box::new(Field { + data_type: DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::Float16, is_nullable: false, @@ -72,7 +72,7 @@ impl ::re_types_core::Loggable for AffixFuzzer21 { is_nullable: false, metadata: [].into(), }, - ]) + ])) } #[allow(clippy::wildcard_imports)] @@ -159,7 +159,7 @@ impl ::re_types_core::Loggable for AffixFuzzer21 { .unwrap() .into(); ListArray::new( - DataType::List(Box::new(Field { + DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::Float16, is_nullable: false, @@ -199,7 +199,7 @@ impl ::re_types_core::Loggable for AffixFuzzer21 { .downcast_ref::() .ok_or_else(|| { DeserializationError::datatype_mismatch( - DataType::Struct(vec![ + DataType::Struct(std::sync::Arc::new(vec![ Field { name: "single_half".to_owned(), data_type: DataType::Float16, @@ -208,7 +208,7 @@ impl ::re_types_core::Loggable for AffixFuzzer21 { }, Field { name: "many_halves".to_owned(), - data_type: DataType::List(Box::new(Field { + data_type: DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::Float16, is_nullable: false, @@ -217,7 +217,7 @@ impl ::re_types_core::Loggable for AffixFuzzer21 { is_nullable: false, metadata: [].into(), }, - ]), + ])), arrow_data.data_type().clone(), ) }) @@ -269,7 +269,7 @@ impl ::re_types_core::Loggable for AffixFuzzer21 { .downcast_ref::>() .ok_or_else(|| { DeserializationError::datatype_mismatch( - DataType::List(Box::new(Field { + DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::Float16, is_nullable: false, diff --git a/crates/re_types/src/testing/datatypes/affix_fuzzer22.rs b/crates/re_types/src/testing/datatypes/affix_fuzzer22.rs index eeed2a740e1fc..57aaf752b6596 100644 --- a/crates/re_types/src/testing/datatypes/affix_fuzzer22.rs +++ b/crates/re_types/src/testing/datatypes/affix_fuzzer22.rs @@ -66,10 +66,10 @@ impl ::re_types_core::Loggable for AffixFuzzer22 { #[inline] fn arrow_datatype() -> arrow2::datatypes::DataType { use arrow2::datatypes::*; - DataType::Struct(vec![Field { + DataType::Struct(std::sync::Arc::new(vec![Field { name: "fixed_sized_native".to_owned(), data_type: DataType::FixedSizeList( - Box::new(Field { + std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::UInt8, is_nullable: false, @@ -79,7 +79,7 @@ impl ::re_types_core::Loggable for AffixFuzzer22 { ), is_nullable: false, metadata: [].into(), - }]) + }])) } #[allow(clippy::wildcard_imports)] @@ -145,7 +145,7 @@ impl ::re_types_core::Loggable for AffixFuzzer22 { }); FixedSizeListArray::new( DataType::FixedSizeList( - Box::new(Field { + std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::UInt8, is_nullable: false, @@ -188,10 +188,10 @@ impl ::re_types_core::Loggable for AffixFuzzer22 { .downcast_ref::() .ok_or_else(|| { DeserializationError::datatype_mismatch( - DataType::Struct(vec![Field { + DataType::Struct(std::sync::Arc::new(vec![Field { name: "fixed_sized_native".to_owned(), data_type: DataType::FixedSizeList( - Box::new(Field { + std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::UInt8, is_nullable: false, @@ -201,7 +201,7 @@ impl ::re_types_core::Loggable for AffixFuzzer22 { ), is_nullable: false, metadata: [].into(), - }]), + }])), arrow_data.data_type().clone(), ) }) @@ -232,7 +232,7 @@ impl ::re_types_core::Loggable for AffixFuzzer22 { .ok_or_else(|| { DeserializationError::datatype_mismatch( DataType::FixedSizeList( - Box::new(Field { + std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::UInt8, is_nullable: false, diff --git a/crates/re_types/src/testing/datatypes/affix_fuzzer3.rs b/crates/re_types/src/testing/datatypes/affix_fuzzer3.rs index 184bdc6050a84..cab15aac2719b 100644 --- a/crates/re_types/src/testing/datatypes/affix_fuzzer3.rs +++ b/crates/re_types/src/testing/datatypes/affix_fuzzer3.rs @@ -65,7 +65,7 @@ impl ::re_types_core::Loggable for AffixFuzzer3 { fn arrow_datatype() -> arrow2::datatypes::DataType { use arrow2::datatypes::*; DataType::Union( - vec![ + std::sync::Arc::new(vec![ Field { name: "_null_markers".to_owned(), data_type: DataType::Null, @@ -86,7 +86,7 @@ impl ::re_types_core::Loggable for AffixFuzzer3 { }, Field { name: "craziness".to_owned(), - data_type: DataType::List(Box::new(Field { + data_type: DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: ::arrow_datatype(), is_nullable: false, @@ -98,7 +98,7 @@ impl ::re_types_core::Loggable for AffixFuzzer3 { Field { name: "fixed_size_shenanigans".to_owned(), data_type: DataType::FixedSizeList( - Box::new(Field { + std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::Float32, is_nullable: false, @@ -109,8 +109,8 @@ impl ::re_types_core::Loggable for AffixFuzzer3 { is_nullable: false, metadata: [].into(), }, - ], - Some(vec![0i32, 1i32, 2i32, 3i32, 4i32]), + ]), + Some(std::sync::Arc::new(vec![0i32, 1i32, 2i32, 3i32, 4i32])), UnionMode::Dense, ) } @@ -233,7 +233,7 @@ impl ::re_types_core::Loggable for AffixFuzzer3 { .unwrap() .into(); ListArray::new( - DataType::List(Box::new(Field { + DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: ::arrow_datatype(), @@ -297,7 +297,7 @@ impl ::re_types_core::Loggable for AffixFuzzer3 { }); FixedSizeListArray::new( DataType::FixedSizeList( - Box::new(Field { + std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::Float32, is_nullable: false, @@ -377,25 +377,26 @@ impl ::re_types_core::Loggable for AffixFuzzer3 { .ok_or_else(|| { DeserializationError::datatype_mismatch( DataType::Union( - vec![ - Field { name : "_null_markers".to_owned(), data_type : - DataType::Null, is_nullable : true, metadata : [].into(), }, - Field { name : "degrees".to_owned(), data_type : - DataType::Float32, is_nullable : false, metadata : [].into(), - }, Field { name : "radians".to_owned(), data_type : - DataType::Float32, is_nullable : false, metadata : [].into(), - }, Field { name : "craziness".to_owned(), data_type : - DataType::List(Box::new(Field { name : "item".to_owned(), - data_type : < crate ::testing::datatypes::AffixFuzzer1 > - ::arrow_datatype(), is_nullable : false, metadata : [] - .into(), })), is_nullable : false, metadata : [].into(), }, - Field { name : "fixed_size_shenanigans".to_owned(), data_type - : DataType::FixedSizeList(Box::new(Field { name : "item" - .to_owned(), data_type : DataType::Float32, is_nullable : - false, metadata : [].into(), }), 3usize), is_nullable : - false, metadata : [].into(), }, - ], - Some(vec![0i32, 1i32, 2i32, 3i32, 4i32]), + std::sync::Arc::new(vec![ + Field { name : "_null_markers".to_owned(), data_type : + DataType::Null, is_nullable : true, metadata : [].into(), }, + Field { name : "degrees".to_owned(), data_type : + DataType::Float32, is_nullable : false, metadata : [] + .into(), }, Field { name : "radians".to_owned(), data_type : + DataType::Float32, is_nullable : false, metadata : [] + .into(), }, Field { name : "craziness".to_owned(), data_type + : DataType::List(std::sync::Arc::new(Field { name : "item" + .to_owned(), data_type : < crate + ::testing::datatypes::AffixFuzzer1 > ::arrow_datatype(), + is_nullable : false, metadata : [].into(), })), is_nullable + : false, metadata : [].into(), }, Field { name : + "fixed_size_shenanigans".to_owned(), data_type : + DataType::FixedSizeList(std::sync::Arc::new(Field { name : + "item".to_owned(), data_type : DataType::Float32, + is_nullable : false, metadata : [].into(), }), 3usize), + is_nullable : false, metadata : [].into(), }, + ]), + Some(std::sync::Arc::new(vec![0i32, 1i32, 2i32, 3i32, 4i32])), UnionMode::Dense, ), arrow_data.data_type().clone(), @@ -472,7 +473,7 @@ impl ::re_types_core::Loggable for AffixFuzzer3 { .downcast_ref::>() .ok_or_else(|| DeserializationError::datatype_mismatch( DataType::List( - Box::new(Field { + std::sync::Arc::new(Field { name: "item".to_owned(), data_type: ::arrow_datatype(), is_nullable: false, @@ -547,7 +548,7 @@ impl ::re_types_core::Loggable for AffixFuzzer3 { .downcast_ref::() .ok_or_else(|| DeserializationError::datatype_mismatch( DataType::FixedSizeList( - Box::new(Field { + std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::Float32, is_nullable: false, diff --git a/crates/re_types/src/testing/datatypes/affix_fuzzer4.rs b/crates/re_types/src/testing/datatypes/affix_fuzzer4.rs index 694ead7e2e68a..b5f47be302cf8 100644 --- a/crates/re_types/src/testing/datatypes/affix_fuzzer4.rs +++ b/crates/re_types/src/testing/datatypes/affix_fuzzer4.rs @@ -62,7 +62,7 @@ impl ::re_types_core::Loggable for AffixFuzzer4 { fn arrow_datatype() -> arrow2::datatypes::DataType { use arrow2::datatypes::*; DataType::Union( - vec![ + std::sync::Arc::new(vec![ Field { name: "_null_markers".to_owned(), data_type: DataType::Null, @@ -77,7 +77,7 @@ impl ::re_types_core::Loggable for AffixFuzzer4 { }, Field { name: "many_required".to_owned(), - data_type: DataType::List(Box::new(Field { + data_type: DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: ::arrow_datatype(), is_nullable: false, @@ -88,7 +88,7 @@ impl ::re_types_core::Loggable for AffixFuzzer4 { }, Field { name: "many_optional".to_owned(), - data_type: DataType::List(Box::new(Field { + data_type: DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: ::arrow_datatype(), is_nullable: false, @@ -97,8 +97,8 @@ impl ::re_types_core::Loggable for AffixFuzzer4 { is_nullable: false, metadata: [].into(), }, - ], - Some(vec![0i32, 1i32, 2i32, 3i32]), + ]), + Some(std::sync::Arc::new(vec![0i32, 1i32, 2i32, 3i32])), UnionMode::Dense, ) } @@ -192,7 +192,7 @@ impl ::re_types_core::Loggable for AffixFuzzer4 { .unwrap() .into(); ListArray::new( - DataType::List(Box::new(Field { + DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: ::arrow_datatype(), @@ -248,7 +248,7 @@ impl ::re_types_core::Loggable for AffixFuzzer4 { .unwrap() .into(); ListArray::new( - DataType::List(Box::new(Field { + DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: ::arrow_datatype(), @@ -319,25 +319,26 @@ impl ::re_types_core::Loggable for AffixFuzzer4 { .ok_or_else(|| { DeserializationError::datatype_mismatch( DataType::Union( - vec![ - Field { name : "_null_markers".to_owned(), data_type : - DataType::Null, is_nullable : true, metadata : [].into(), }, - Field { name : "single_required".to_owned(), data_type : < - crate ::testing::datatypes::AffixFuzzer3 > - ::arrow_datatype(), is_nullable : false, metadata : [] - .into(), }, Field { name : "many_required".to_owned(), - data_type : DataType::List(Box::new(Field { name : "item" - .to_owned(), data_type : < crate - ::testing::datatypes::AffixFuzzer3 > ::arrow_datatype(), - is_nullable : false, metadata : [].into(), })), is_nullable : - false, metadata : [].into(), }, Field { name : - "many_optional".to_owned(), data_type : - DataType::List(Box::new(Field { name : "item".to_owned(), - data_type : < crate ::testing::datatypes::AffixFuzzer3 > - ::arrow_datatype(), is_nullable : false, metadata : [] - .into(), })), is_nullable : false, metadata : [].into(), }, - ], - Some(vec![0i32, 1i32, 2i32, 3i32]), + std::sync::Arc::new(vec![ + Field { name : "_null_markers".to_owned(), data_type : + DataType::Null, is_nullable : true, metadata : [].into(), }, + Field { name : "single_required".to_owned(), data_type : < + crate ::testing::datatypes::AffixFuzzer3 > + ::arrow_datatype(), is_nullable : false, metadata : [] + .into(), }, Field { name : "many_required".to_owned(), + data_type : DataType::List(std::sync::Arc::new(Field { name + : "item".to_owned(), data_type : < crate + ::testing::datatypes::AffixFuzzer3 > ::arrow_datatype(), + is_nullable : false, metadata : [].into(), })), is_nullable + : false, metadata : [].into(), }, Field { name : + "many_optional".to_owned(), data_type : + DataType::List(std::sync::Arc::new(Field { name : "item" + .to_owned(), data_type : < crate + ::testing::datatypes::AffixFuzzer3 > ::arrow_datatype(), + is_nullable : false, metadata : [].into(), })), is_nullable + : false, metadata : [].into(), }, + ]), + Some(std::sync::Arc::new(vec![0i32, 1i32, 2i32, 3i32])), UnionMode::Dense, ), arrow_data.data_type().clone(), @@ -386,7 +387,7 @@ impl ::re_types_core::Loggable for AffixFuzzer4 { .downcast_ref::>() .ok_or_else(|| DeserializationError::datatype_mismatch( DataType::List( - Box::new(Field { + std::sync::Arc::new(Field { name: "item".to_owned(), data_type: ::arrow_datatype(), is_nullable: false, @@ -461,7 +462,7 @@ impl ::re_types_core::Loggable for AffixFuzzer4 { .downcast_ref::>() .ok_or_else(|| DeserializationError::datatype_mismatch( DataType::List( - Box::new(Field { + std::sync::Arc::new(Field { name: "item".to_owned(), data_type: ::arrow_datatype(), is_nullable: false, diff --git a/crates/re_types/src/testing/datatypes/affix_fuzzer5.rs b/crates/re_types/src/testing/datatypes/affix_fuzzer5.rs index 2eb44c2e525db..a6fc43f6f11b9 100644 --- a/crates/re_types/src/testing/datatypes/affix_fuzzer5.rs +++ b/crates/re_types/src/testing/datatypes/affix_fuzzer5.rs @@ -76,12 +76,12 @@ impl ::re_types_core::Loggable for AffixFuzzer5 { #[inline] fn arrow_datatype() -> arrow2::datatypes::DataType { use arrow2::datatypes::*; - DataType::Struct(vec![Field { + DataType::Struct(std::sync::Arc::new(vec![Field { name: "single_optional_union".to_owned(), data_type: ::arrow_datatype(), is_nullable: true, metadata: [].into(), - }]) + }])) } #[allow(clippy::wildcard_imports)] @@ -156,12 +156,12 @@ impl ::re_types_core::Loggable for AffixFuzzer5 { .downcast_ref::() .ok_or_else(|| { DeserializationError::datatype_mismatch( - DataType::Struct(vec![Field { + DataType::Struct(std::sync::Arc::new(vec![Field { name: "single_optional_union".to_owned(), data_type: ::arrow_datatype(), is_nullable: true, metadata: [].into(), - }]), + }])), arrow_data.data_type().clone(), ) }) diff --git a/crates/re_types/src/testing/datatypes/flattened_scalar.rs b/crates/re_types/src/testing/datatypes/flattened_scalar.rs index bc57b7090c462..e770a3ce2be81 100644 --- a/crates/re_types/src/testing/datatypes/flattened_scalar.rs +++ b/crates/re_types/src/testing/datatypes/flattened_scalar.rs @@ -66,12 +66,12 @@ impl ::re_types_core::Loggable for FlattenedScalar { #[inline] fn arrow_datatype() -> arrow2::datatypes::DataType { use arrow2::datatypes::*; - DataType::Struct(vec![Field { + DataType::Struct(std::sync::Arc::new(vec![Field { name: "value".to_owned(), data_type: DataType::Float32, is_nullable: false, metadata: [].into(), - }]) + }])) } #[allow(clippy::wildcard_imports)] @@ -140,12 +140,12 @@ impl ::re_types_core::Loggable for FlattenedScalar { .downcast_ref::() .ok_or_else(|| { DeserializationError::datatype_mismatch( - DataType::Struct(vec![Field { + DataType::Struct(std::sync::Arc::new(vec![Field { name: "value".to_owned(), data_type: DataType::Float32, is_nullable: false, metadata: [].into(), - }]), + }])), arrow_data.data_type().clone(), ) }) diff --git a/crates/re_types/tests/util.rs b/crates/re_types/tests/util.rs index 42d24e0389d7c..48df0201f18f0 100644 --- a/crates/re_types/tests/util.rs +++ b/crates/re_types/tests/util.rs @@ -14,7 +14,7 @@ pub fn extract_extensions(datatype: &::arrow2::datatypes::DataType, acc: &mut Ve extract_extensions(field.data_type(), acc); } arrow2::datatypes::DataType::Struct(fields) => { - for field in fields { + for field in fields.iter() { extract_extensions(field.data_type(), acc); } } diff --git a/crates/re_types_builder/src/arrow_registry.rs b/crates/re_types_builder/src/arrow_registry.rs index 083a393f57b0d..9ac827a0f44e3 100644 --- a/crates/re_types_builder/src/arrow_registry.rs +++ b/crates/re_types_builder/src/arrow_registry.rs @@ -2,7 +2,10 @@ use anyhow::Context as _; use arrow2::datatypes::{DataType, Field, UnionMode}; -use std::collections::{BTreeMap, HashMap}; +use std::{ + collections::{BTreeMap, HashMap}, + sync::Arc, +}; use crate::{ElementType, Object, ObjectField, Type, ATTR_ARROW_SPARSE_UNION}; @@ -303,20 +306,26 @@ impl From for LazyDatatype { DataType::LargeBinary => LazyDatatype::LargeBinary, DataType::Utf8 => LazyDatatype::Utf8, DataType::LargeUtf8 => LazyDatatype::LargeUtf8, - DataType::List(field) => LazyDatatype::List(Box::new((*field).into())), + DataType::List(field) => LazyDatatype::List(Box::new((*field).clone().into())), DataType::FixedSizeList(field, length) => { - LazyDatatype::FixedSizeList(Box::new((*field).into()), length) + LazyDatatype::FixedSizeList(Box::new((*field).clone().into()), length) } - DataType::LargeList(field) => LazyDatatype::LargeList(Box::new((*field).into())), - DataType::Struct(fields) => { - LazyDatatype::Struct(fields.into_iter().map(Into::into).collect()) - } - DataType::Union(fields, x, mode) => { - LazyDatatype::Union(fields.into_iter().map(Into::into).collect(), x, mode) + DataType::LargeList(field) => { + LazyDatatype::LargeList(Box::new((*field).clone().into())) } - DataType::Extension(name, datatype, metadata) => { - LazyDatatype::Extension(name, Box::new((*datatype).into()), metadata) + DataType::Struct(fields) => { + LazyDatatype::Struct(fields.iter().cloned().map(Into::into).collect()) } + DataType::Union(fields, x, mode) => LazyDatatype::Union( + fields.iter().cloned().map(Into::into).collect(), + x.map(|arc| arc.to_vec()), + mode, + ), + DataType::Extension(name, datatype, metadata) => LazyDatatype::Extension( + name, + Box::new((*datatype).clone().into()), + metadata.map(|arc| arc.to_string()), + ), _ => unimplemented!("{datatype:#?}"), } } @@ -344,25 +353,25 @@ impl LazyDatatype { LazyDatatype::LargeBinary => DataType::LargeBinary, LazyDatatype::Utf8 => DataType::Utf8, LazyDatatype::LargeUtf8 => DataType::LargeUtf8, - LazyDatatype::List(field) => DataType::List(Box::new(field.resolve(registry))), + LazyDatatype::List(field) => DataType::List(Arc::new(field.resolve(registry))), LazyDatatype::FixedSizeList(field, length) => { - DataType::FixedSizeList(Box::new(field.resolve(registry)), *length) + DataType::FixedSizeList(Arc::new(field.resolve(registry)), *length) } LazyDatatype::LargeList(field) => { - DataType::LargeList(Box::new(field.resolve(registry))) - } - LazyDatatype::Struct(fields) => { - DataType::Struct(fields.iter().map(|field| field.resolve(registry)).collect()) + DataType::LargeList(Arc::new(field.resolve(registry))) } - LazyDatatype::Union(fields, x, mode) => DataType::Union( + LazyDatatype::Struct(fields) => DataType::Struct(Arc::new( fields.iter().map(|field| field.resolve(registry)).collect(), - x.clone(), + )), + LazyDatatype::Union(fields, x, mode) => DataType::Union( + Arc::new(fields.iter().map(|field| field.resolve(registry)).collect()), + x.as_ref().map(|x| Arc::new(x.clone())), *mode, ), LazyDatatype::Extension(name, datatype, metadata) => DataType::Extension( name.clone(), - Box::new(datatype.resolve(registry)), - metadata.clone(), + Arc::new(datatype.resolve(registry)), + metadata.as_ref().map(|s| Arc::new(s.clone())), ), LazyDatatype::Unresolved(fqname) => registry.get(fqname), } diff --git a/crates/re_types_builder/src/codegen/rust/arrow.rs b/crates/re_types_builder/src/codegen/rust/arrow.rs index f1f83c34aff43..94b812ec9ed84 100644 --- a/crates/re_types_builder/src/codegen/rust/arrow.rs +++ b/crates/re_types_builder/src/codegen/rust/arrow.rs @@ -32,12 +32,12 @@ impl quote::ToTokens for ArrowDataTypeTokenizer<'_> { DataType::List(field) => { let field = ArrowFieldTokenizer(field); - quote!(DataType::List(Box::new(#field))) + quote!(DataType::List(std::sync::Arc::new(#field))) } DataType::FixedSizeList(field, length) => { let field = ArrowFieldTokenizer(field); - quote!(DataType::FixedSizeList(Box::new(#field), #length)) + quote!(DataType::FixedSizeList(std::sync::Arc::new(#field), #length)) } DataType::Union(fields, types, mode) => { @@ -47,15 +47,19 @@ impl quote::ToTokens for ArrowDataTypeTokenizer<'_> { UnionMode::Sparse => quote!(UnionMode::Sparse), }; if let Some(types) = types { - quote!(DataType::Union(vec![ #(#fields,)* ], Some(vec![ #(#types,)* ]), #mode)) + quote!(DataType::Union( + std::sync::Arc::new(vec![ #(#fields,)* ]), + Some(std::sync::Arc::new(vec![ #(#types,)* ])), + #mode, + )) } else { - quote!(DataType::Union(vec![ #(#fields,)* ], None, #mode)) + quote!(DataType::Union(std::sync::Arc::new(vec![ #(#fields,)* ]), None, #mode)) } } DataType::Struct(fields) => { let fields = fields.iter().map(ArrowFieldTokenizer); - quote!(DataType::Struct(vec![ #(#fields,)* ])) + quote!(DataType::Struct(std::sync::Arc::new(vec![ #(#fields,)* ]))) } DataType::Extension(fqname, datatype, _metadata) => { diff --git a/crates/re_types_core/src/archetype.rs b/crates/re_types_core/src/archetype.rs index 4221dcfde08d0..d617906f328c4 100644 --- a/crates/re_types_core/src/archetype.rs +++ b/crates/re_types_core/src/archetype.rs @@ -1,3 +1,5 @@ +use std::sync::Arc; + use crate::{ ComponentBatch, ComponentName, DeserializationResult, MaybeOwnedComponentBatch, SerializationResult, _Backtrace, @@ -216,7 +218,7 @@ impl crate::LoggableBatch for GenericIndicatorComponent { name.clone(), arrow2::datatypes::DataType::Extension( name, - Box::new(arrow2::datatypes::DataType::Null), + Arc::new(arrow2::datatypes::DataType::Null), None, ), false, @@ -274,7 +276,7 @@ impl crate::LoggableBatch for NamedIndicatorComponent { name.clone(), arrow2::datatypes::DataType::Extension( name, - Box::new(arrow2::datatypes::DataType::Null), + Arc::new(arrow2::datatypes::DataType::Null), None, ), false, diff --git a/crates/re_types_core/src/loggable.rs b/crates/re_types_core/src/loggable.rs index 18f175395b1cf..899cf522af641 100644 --- a/crates/re_types_core/src/loggable.rs +++ b/crates/re_types_core/src/loggable.rs @@ -1,3 +1,5 @@ +use std::sync::Arc; + use crate::{ result::_Backtrace, DeserializationResult, ResultExt as _, SerializationResult, SizeBytes, }; @@ -51,7 +53,7 @@ pub trait Loggable: Clone + Sized + SizeBytes { fn extended_arrow_datatype() -> arrow2::datatypes::DataType { arrow2::datatypes::DataType::Extension( Self::name().to_string(), - Box::new(Self::arrow_datatype()), + Arc::new(Self::arrow_datatype()), None, ) } diff --git a/crates/re_types_core/src/size_bytes.rs b/crates/re_types_core/src/size_bytes.rs index 9d42a1d5e9525..74c0e6e141532 100644 --- a/crates/re_types_core/src/size_bytes.rs +++ b/crates/re_types_core/src/size_bytes.rs @@ -1,4 +1,5 @@ use std::collections::{BTreeMap, HashMap, VecDeque}; +use std::sync::Arc; use arrow2::datatypes::{DataType, Field}; use smallvec::SmallVec; @@ -152,6 +153,13 @@ impl SizeBytes for Option { } } +impl SizeBytes for Arc { + #[inline] + fn heap_size_bytes(&self) -> u64 { + 0 // assume it's amortized + } +} + // TODO(rust-lang/rust#31844): `impl SizeBytesExt for T {}` would be nice but // violates orphan rules. macro_rules! impl_size_bytes_pod { @@ -659,7 +667,7 @@ fn test_arrow_estimated_size_bytes() { Field::new("x", DataType::Float64, false), Field::new("y", DataType::Float64, false), ]; - StructArray::new(DataType::Struct(fields), vec![x, y], None).boxed() + StructArray::new(DataType::Struct(Arc::new(fields)), vec![x, y], None).boxed() }; let raw_size_bytes = std::mem::size_of_val(data.as_slice()); @@ -696,7 +704,7 @@ fn test_arrow_estimated_size_bytes() { Field::new("x", DataType::Float64, false), Field::new("y", DataType::Float64, false), ]; - StructArray::new(DataType::Struct(fields), vec![x, y], None) + StructArray::new(DataType::Struct(Arc::new(fields)), vec![x, y], None) }; ListArray::::new( @@ -727,7 +735,11 @@ fn test_arrow_estimated_size_bytes() { Field::new("i", DataType::Int32, false), Field::new("f", DataType::Float64, false), ]; - let data_type = DataType::Union(fields, Some(vec![0i32, 1i32]), UnionMode::Dense); + let data_type = DataType::Union( + Arc::new(fields), + Some(Arc::new(vec![0i32, 1i32])), + UnionMode::Dense, + ); let types = Buffer::::from(vec![0i8, 0i8, 1i8, 0i8, 1i8]); let fields = vec![ PrimitiveArray::::from_vec(vec![0, 1, 2]).boxed(), diff --git a/crates/re_types_core/src/tuid.rs b/crates/re_types_core/src/tuid.rs index 0dd5afec808f7..a79504dac4b8a 100644 --- a/crates/re_types_core/src/tuid.rs +++ b/crates/re_types_core/src/tuid.rs @@ -1,3 +1,5 @@ +use std::sync::Arc; + use crate::{DeserializationError, Loggable, SizeBytes}; use arrow2::{ array::{StructArray, UInt64Array}, @@ -25,10 +27,10 @@ impl Loggable for Tuid { #[inline] fn arrow_datatype() -> arrow2::datatypes::DataType { - DataType::Struct(vec![ + DataType::Struct(Arc::new(vec![ Field::new("time_ns", DataType::UInt64, false), Field::new("inc", DataType::UInt64, false), - ]) + ])) } fn to_arrow_opt<'a>( diff --git a/crates/re_viewport/src/blueprint/components/included_space_views.rs b/crates/re_viewport/src/blueprint/components/included_space_views.rs index e5e811a391c98..9d82e49024f05 100644 --- a/crates/re_viewport/src/blueprint/components/included_space_views.rs +++ b/crates/re_viewport/src/blueprint/components/included_space_views.rs @@ -60,7 +60,7 @@ impl ::re_types_core::Loggable for IncludedSpaceViews { #[inline] fn arrow_datatype() -> arrow2::datatypes::DataType { use arrow2::datatypes::*; - DataType::List(Box::new(Field { + DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: ::arrow_datatype(), is_nullable: false, @@ -139,7 +139,7 @@ impl ::re_types_core::Loggable for IncludedSpaceViews { .downcast_ref::>() .ok_or_else(|| { DeserializationError::datatype_mismatch( - DataType::List(Box::new(Field { + DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: ::arrow_datatype(), is_nullable: false, diff --git a/crates/re_viewport/src/blueprint/components/root_container.rs b/crates/re_viewport/src/blueprint/components/root_container.rs index a218c9aa3b877..cd9d9ac110603 100644 --- a/crates/re_viewport/src/blueprint/components/root_container.rs +++ b/crates/re_viewport/src/blueprint/components/root_container.rs @@ -76,10 +76,10 @@ impl ::re_types_core::Loggable for RootContainer { #[inline] fn arrow_datatype() -> arrow2::datatypes::DataType { use arrow2::datatypes::*; - DataType::Struct(vec![Field { + DataType::Struct(std::sync::Arc::new(vec![Field { name: "bytes".to_owned(), data_type: DataType::FixedSizeList( - Box::new(Field { + std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::UInt8, is_nullable: false, @@ -89,7 +89,7 @@ impl ::re_types_core::Loggable for RootContainer { ), is_nullable: false, metadata: [].into(), - }]) + }])) } #[allow(clippy::wildcard_imports)] diff --git a/crates/re_viewport/src/blueprint/components/space_view_maximized.rs b/crates/re_viewport/src/blueprint/components/space_view_maximized.rs index 081506ee8bd73..0656895a7b843 100644 --- a/crates/re_viewport/src/blueprint/components/space_view_maximized.rs +++ b/crates/re_viewport/src/blueprint/components/space_view_maximized.rs @@ -76,10 +76,10 @@ impl ::re_types_core::Loggable for SpaceViewMaximized { #[inline] fn arrow_datatype() -> arrow2::datatypes::DataType { use arrow2::datatypes::*; - DataType::Struct(vec![Field { + DataType::Struct(std::sync::Arc::new(vec![Field { name: "bytes".to_owned(), data_type: DataType::FixedSizeList( - Box::new(Field { + std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::UInt8, is_nullable: false, @@ -89,7 +89,7 @@ impl ::re_types_core::Loggable for SpaceViewMaximized { ), is_nullable: false, metadata: [].into(), - }]) + }])) } #[allow(clippy::wildcard_imports)] diff --git a/crates/re_viewport/src/blueprint/components/viewport_layout.rs b/crates/re_viewport/src/blueprint/components/viewport_layout.rs index 16a7d5fdad76f..33fe9c5abc693 100644 --- a/crates/re_viewport/src/blueprint/components/viewport_layout.rs +++ b/crates/re_viewport/src/blueprint/components/viewport_layout.rs @@ -55,7 +55,7 @@ impl ::re_types_core::Loggable for ViewportLayout { #[inline] fn arrow_datatype() -> arrow2::datatypes::DataType { use arrow2::datatypes::*; - DataType::List(Box::new(Field { + DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::UInt8, is_nullable: false, @@ -146,7 +146,7 @@ impl ::re_types_core::Loggable for ViewportLayout { .downcast_ref::>() .ok_or_else(|| { DeserializationError::datatype_mismatch( - DataType::List(Box::new(Field { + DataType::List(std::sync::Arc::new(Field { name: "item".to_owned(), data_type: DataType::UInt8, is_nullable: false,