File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed
crates/catalog/memory/src Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -70,6 +70,17 @@ impl MemoryCatalog {
70
70
. file_io ( self . file_io . clone ( ) )
71
71
. build ( )
72
72
}
73
+
74
+ async fn write_metadata (
75
+ & self ,
76
+ metadata : & TableMetadata ,
77
+ metadata_location : & str ,
78
+ ) -> Result < ( ) > {
79
+ self . file_io
80
+ . new_output ( metadata_location) ?
81
+ . write ( serde_json:: to_vec ( metadata) ?. into ( ) )
82
+ . await
83
+ }
73
84
}
74
85
75
86
#[ async_trait]
@@ -221,10 +232,7 @@ impl Catalog for MemoryCatalog {
221
232
Uuid :: new_v4( )
222
233
) ;
223
234
224
- self . file_io
225
- . new_output ( & metadata_location) ?
226
- . write ( serde_json:: to_vec ( & metadata) ?. into ( ) )
227
- . await ?;
235
+ self . write_metadata ( & metadata, & metadata_location) . await ?;
228
236
229
237
root_namespace_state. insert_new_table ( & table_ident, metadata_location. clone ( ) ) ?;
230
238
You can’t perform that action at this time.
0 commit comments