@@ -22,6 +22,9 @@ pub struct SorbetSchema {
22
22
/// Which entity is this chunk for?
23
23
pub entity_path : Option < EntityPath > ,
24
24
25
+ /// The partition id that this chunk belongs to.
26
+ pub partition_id : Option < String > ,
27
+
25
28
/// The heap size of this batch in bytes, if known.
26
29
pub heap_size_bytes : Option < u64 > ,
27
30
}
@@ -50,12 +53,20 @@ impl SorbetSchema {
50
53
( "rerun.entity_path" . to_owned ( ) , entity_path. to_string ( ) )
51
54
}
52
55
56
+ pub fn partition_id_metadata ( partition_id : impl AsRef < str > ) -> ( String , String ) {
57
+ (
58
+ "rerun.partition_id" . to_owned ( ) ,
59
+ partition_id. as_ref ( ) . to_owned ( ) ,
60
+ )
61
+ }
62
+
53
63
pub fn arrow_batch_metadata ( & self ) -> ArrowBatchMetadata {
54
64
let Self {
55
65
columns : _,
56
66
chunk_id,
57
67
entity_path,
58
68
heap_size_bytes,
69
+ partition_id,
59
70
} = self ;
60
71
61
72
[
@@ -65,6 +76,7 @@ impl SorbetSchema {
65
76
) ) ,
66
77
chunk_id. as_ref ( ) . map ( Self :: chunk_id_metadata) ,
67
78
entity_path. as_ref ( ) . map ( Self :: entity_path_metadata) ,
79
+ partition_id. as_ref ( ) . map ( Self :: partition_id_metadata) ,
68
80
heap_size_bytes. as_ref ( ) . map ( |heap_size_bytes| {
69
81
(
70
82
"rerun.heap_size_bytes" . to_owned ( ) ,
@@ -129,6 +141,8 @@ impl TryFrom<&ArrowSchema> for SorbetSchema {
129
141
None
130
142
} ;
131
143
144
+ let partition_id = metadata. get ( "rerun.partition_id" ) . map ( |s| s. to_owned ( ) ) ;
145
+
132
146
// Verify version
133
147
if let Some ( batch_version) = metadata. get ( Self :: METADATA_KEY_VERSION ) {
134
148
if batch_version != Self :: METADATA_VERSION {
@@ -143,6 +157,7 @@ impl TryFrom<&ArrowSchema> for SorbetSchema {
143
157
columns,
144
158
chunk_id,
145
159
entity_path,
160
+ partition_id,
146
161
heap_size_bytes,
147
162
} )
148
163
}
0 commit comments