@@ -29,7 +29,7 @@ use crate::{
2929 CUSTOM_PARTITION_KEY , STATIC_SCHEMA_FLAG , STREAM_TYPE_KEY , TIME_PARTITION_KEY ,
3030 TIME_PARTITION_LIMIT_KEY , UPDATE_STREAM_KEY ,
3131 } ,
32- metadata:: { self , STREAM_INFO } ,
32+ metadata:: { self , SchemaVersion , STREAM_INFO } ,
3333 option:: { Mode , CONFIG } ,
3434 static_schema:: { convert_static_schema_to_arrow_schema, StaticSchema } ,
3535 storage:: { LogStream , ObjectStoreFormat , StreamType } ,
@@ -426,6 +426,7 @@ pub async fn create_stream(
426426 static_schema_flag. to_string ( ) ,
427427 static_schema,
428428 stream_type,
429+ SchemaVersion :: V1 , // New stream
429430 ) ;
430431 }
431432 Err ( err) => {
@@ -474,6 +475,7 @@ pub async fn create_stream_and_schema_from_storage(stream_name: &str) -> Result<
474475 let custom_partition = stream_metadata. custom_partition . as_deref ( ) . unwrap_or ( "" ) ;
475476 let static_schema_flag = stream_metadata. static_schema_flag . as_deref ( ) . unwrap_or ( "" ) ;
476477 let stream_type = stream_metadata. stream_type . as_deref ( ) . unwrap_or ( "" ) ;
478+ let schema_version = stream_metadata. schema_version ;
477479
478480 metadata:: STREAM_INFO . add_stream (
479481 stream_name. to_string ( ) ,
@@ -484,6 +486,7 @@ pub async fn create_stream_and_schema_from_storage(stream_name: &str) -> Result<
484486 static_schema_flag. to_string ( ) ,
485487 static_schema,
486488 stream_type,
489+ schema_version,
487490 ) ;
488491 } else {
489492 return Ok ( false ) ;
0 commit comments