Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace TransportChunk with re_sorbet::ChunkBatch #8945

Merged
merged 40 commits into from
Feb 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
a61d997
Add `RowIdColumnDescriptor`
emilk Feb 5, 2025
65a90df
Add `struct ChunkSchema`
emilk Feb 6, 2025
a5b597f
Add converted from arrow schema
emilk Feb 6, 2025
b095d59
Add `re_sorbet::ChunkBatch`
emilk Feb 6, 2025
e90fdbe
Convert Chunk to ChunkBatch
emilk Feb 7, 2025
42d3a20
Roundtrip it
emilk Feb 8, 2025
40fd804
Less use of `TransportChunk`
emilk Feb 10, 2025
8a4b5d6
Remove unwrap; fix compilation of tests
emilk Feb 10, 2025
538b9b3
Remove one use of TransportChunk
emilk Feb 10, 2025
851c7fe
Use re_sobet in rerun cli filtering
emilk Feb 10, 2025
c42d842
No TransportChunk in re_grpc_client
emilk Feb 10, 2025
b4ed1e0
Remove `Chunk::from_transport`
emilk Feb 10, 2025
7fc7293
More robust parsing of ComponentColumnDescriptor
emilk Feb 10, 2025
d0b92c9
Fix roundtripping
emilk Feb 10, 2025
ab2ad6f
Use "true" insteado of "yes", to make it more JSON-like
emilk Feb 10, 2025
f79bdc2
Use similar_asserts
emilk Feb 10, 2025
52be0a4
Less TransportChunk
emilk Feb 10, 2025
3519a74
Remove some use of TransportChunk
emilk Feb 10, 2025
3a51b62
Remove `TransportChunk` a concrete type
emilk Feb 10, 2025
f01efda
Remove the last of TransportChunk
emilk Feb 10, 2025
8326fae
Cleanup
emilk Feb 10, 2025
5d0edb2
Use full component and archetype names in metadata for roundtripping
emilk Feb 10, 2025
2058129
Fix TODOs
emilk Feb 10, 2025
cb4c498
Fix doclink
emilk Feb 10, 2025
66a6013
Only include entity path in column name in dataframe batches
emilk Feb 10, 2025
0216e84
Only set entity_path-metdata per column in dataframes
emilk Feb 10, 2025
3e73478
Remove unused dependencies
emilk Feb 10, 2025
11c1e72
Improve docstrings
emilk Feb 10, 2025
ef6f1cd
typos
emilk Feb 10, 2025
686304e
Merge branch 'main' into emilk/chunk-schema
emilk Feb 11, 2025
3d9147c
Add sanity checks to find source of doubly-prefixed `rerun.components.`
emilk Feb 11, 2025
0842f84
Fix full/short name errors
emilk Feb 11, 2025
861e496
Add `#[track_caller]` to sanity checks
emilk Feb 11, 2025
b094db7
py-fmt
emilk Feb 11, 2025
f9df88e
Fix bad sanity checks
emilk Feb 11, 2025
39ecc47
Explain some TODOs
emilk Feb 11, 2025
940e872
Merge branch 'main' into emilk/chunk-schema
emilk Feb 11, 2025
1c13ee4
Add a TODO
emilk Feb 11, 2025
163f7fb
Clean up the list-array-wrapping code
emilk Feb 11, 2025
8282fc5
Fix TODO-formatting
emilk Feb 11, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5832,11 +5832,11 @@ dependencies = [
"re_format_arrow",
"re_log",
"re_log_types",
"re_sorbet",
"re_tracing",
"re_tuid",
"re_types_core",
"similar-asserts",
"tap",
"thiserror 1.0.65",
]

Expand Down Expand Up @@ -6049,6 +6049,7 @@ dependencies = [
"re_log_encoding",
"re_log_types",
"re_query",
"re_sorbet",
"re_tracing",
"re_types",
"re_types_core",
Expand Down Expand Up @@ -6159,6 +6160,7 @@ dependencies = [
"re_log_types",
"re_protos",
"re_smart_channel",
"re_sorbet",
"re_types",
"thiserror 1.0.65",
"tokio",
Expand Down Expand Up @@ -6186,6 +6188,7 @@ dependencies = [
"re_smart_channel",
"re_tracing",
"re_types",
"similar-asserts",
"tokio",
"tokio-stream",
"tokio-util",
Expand Down Expand Up @@ -6574,8 +6577,13 @@ name = "re_sorbet"
version = "0.23.0-alpha.1+dev"
dependencies = [
"arrow",
"itertools 0.13.0",
"re_arrow_util",
"re_format_arrow",
"re_log",
"re_log_types",
"re_tracing",
"re_tuid",
"re_types_core",
"thiserror 1.0.65",
]
Expand Down Expand Up @@ -7464,6 +7472,7 @@ dependencies = [
"re_memory",
"re_sdk",
"re_smart_channel",
"re_sorbet",
"re_tracing",
"re_types",
"re_video",
Expand Down Expand Up @@ -8651,12 +8660,6 @@ dependencies = [
"libc",
]

[[package]]
name = "tap"
version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369"

[[package]]
name = "target-lexicon"
version = "0.12.16"
Expand Down
6 changes: 3 additions & 3 deletions crates/store/re_chunk/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,11 @@ serde = ["re_log_types/serde", "re_tuid/serde", "re_types_core/serde"]
re_arrow_util.workspace = true
re_byte_size.workspace = true
re_error.workspace = true
re_format.workspace = true
re_format_arrow.workspace = true
re_log.workspace = true
re_format.workspace = true
re_log_types.workspace = true
re_log.workspace = true
re_sorbet.workspace = true
re_tracing.workspace = true
re_tuid.workspace = true
re_types_core.workspace = true
Expand All @@ -51,7 +52,6 @@ itertools.workspace = true
nohash-hasher.workspace = true
rand = { workspace = true, features = ["std_rng"] }
similar-asserts.workspace = true
tap.workspace = true
thiserror.workspace = true

# Native dependencies:
Expand Down
24 changes: 20 additions & 4 deletions crates/store/re_chunk/src/chunk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,18 @@ pub enum ChunkError {

#[error("Deserialization: {0}")]
Deserialization(#[from] DeserializationError),

#[error(transparent)]
UnsupportedTimeType(#[from] re_sorbet::UnsupportedTimeType),

#[error(transparent)]
WrongDatatypeError(#[from] re_sorbet::WrongDatatypeError),

#[error(transparent)]
MismatchedChunkSchemaError(#[from] re_sorbet::MismatchedChunkSchemaError),

#[error(transparent)]
InvalidChunkSchema(#[from] re_sorbet::InvalidChunkSchema),
}

pub type ChunkResult<T> = Result<T, ChunkError>;
Expand Down Expand Up @@ -170,7 +182,7 @@ impl FromIterator<(ComponentName, ArrowListArray)> for ChunkComponents {
/// Its time columns might or might not be ascendingly sorted, depending on how the data was logged.
///
/// This is the in-memory representation of a chunk, optimized for efficient manipulation of the
/// data within. For transport, see [`crate::TransportChunk`] instead.
/// data within. For transport, see [`re_sorbet::ChunkBatch`] instead.
#[derive(Debug)]
pub struct Chunk {
pub(crate) id: ChunkId,
Expand Down Expand Up @@ -1262,11 +1274,11 @@ impl Chunk {
impl std::fmt::Display for Chunk {
#[inline]
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let transport_chunk = self.to_transport().map_err(|err| {
let batch = self.to_record_batch().map_err(|err| {
re_log::error_once!("couldn't display Chunk: {err}");
std::fmt::Error
})?;
transport_chunk.fmt(f)
re_format_arrow::format_record_batch_with_width(&batch, f.width()).fmt(f)
}
}

Expand Down Expand Up @@ -1435,6 +1447,7 @@ impl Chunk {
/// Returns an error if the Chunk's invariants are not upheld.
///
/// Costly checks are only run in debug builds.
#[track_caller]
pub fn sanity_check(&self) -> ChunkResult<()> {
re_tracing::profile_function!();

Expand Down Expand Up @@ -1504,8 +1517,10 @@ impl Chunk {
}

// Components
for (_component_name, per_desc) in components.iter() {
for (component_name, per_desc) in components.iter() {
component_name.sanity_check();
for (component_desc, list_array) in per_desc {
component_desc.component_name.sanity_check();
if !matches!(list_array.data_type(), arrow::datatypes::DataType::List(_)) {
return Err(ChunkError::Malformed {
reason: format!(
Expand Down Expand Up @@ -1556,6 +1571,7 @@ impl TimeColumn {
/// Returns an error if the Chunk's invariants are not upheld.
///
/// Costly checks are only run in debug builds.
#[track_caller]
pub fn sanity_check(&self) -> ChunkResult<()> {
let Self {
timeline: _,
Expand Down
1 change: 0 additions & 1 deletion crates/store/re_chunk/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ pub use self::iter::{
};
pub use self::latest_at::LatestAtQuery;
pub use self::range::{RangeQuery, RangeQueryOptions};
pub use self::transport::TransportChunk;

#[cfg(not(target_arch = "wasm32"))]
pub use self::batcher::{
Expand Down
Loading