@@ -81,6 +81,9 @@ pub struct Batch<K, V, T, D> {
8181 /// The version of Materialize which wrote this batch.
8282 pub ( crate ) version : Version ,
8383
84+ /// The encoded schemas of the data in the batch.
85+ pub ( crate ) schemas : ( Bytes , Bytes ) ,
86+
8487 /// A handle to the data represented by this batch.
8588 pub ( crate ) batch : HollowBatch < T > ,
8689
@@ -121,13 +124,15 @@ where
121124 blob : Arc < dyn Blob > ,
122125 shard_metrics : Arc < ShardMetrics > ,
123126 version : Version ,
127+ schemas : ( Bytes , Bytes ) ,
124128 batch : HollowBatch < T > ,
125129 ) -> Self {
126130 Self {
127131 batch_delete_enabled,
128132 metrics,
129133 shard_metrics,
130134 version,
135+ schemas,
131136 batch,
132137 blob,
133138 _phantom : PhantomData ,
@@ -209,6 +214,8 @@ where
209214 shard_id : self . shard_metrics . shard_id . into_proto ( ) ,
210215 version : self . version . to_string ( ) ,
211216 batch : Some ( self . batch . into_proto ( ) ) ,
217+ key_schema : self . schemas . 0 . clone ( ) ,
218+ val_schema : self . schemas . 1 . clone ( ) ,
212219 } ;
213220 self . mark_consumed ( ) ;
214221 ret
@@ -729,6 +736,10 @@ where
729736 self . blob ,
730737 shard_metrics,
731738 self . version ,
739+ (
740+ K :: encode_schema ( & * self . write_schemas . key ) ,
741+ V :: encode_schema ( & * self . write_schemas . val ) ,
742+ ) ,
732743 HollowBatch :: new ( desc, run_parts, total_updates, run_meta, run_splits) ,
733744 ) ;
734745
0 commit comments