File tree 1 file changed +7
-8
lines changed
1 file changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -183,15 +183,14 @@ fn process_cdf_commit(
183
183
} ;
184
184
185
185
visitor. visit_rows_of ( actions. as_ref ( ) ) ?;
186
- let has_metadata = visitor. metadata . is_some ( ) ;
186
+ let metadata_changed = visitor. metadata . is_some ( ) ;
187
187
match ( visitor. protocol , visitor. metadata ) {
188
- ( None , None ) => { }
189
- ( p, m) => {
190
- let p = p. unwrap_or_else ( || table_configuration. protocol ( ) . clone ( ) ) ;
191
- let m = m. unwrap_or_else ( || table_configuration. metadata ( ) . clone ( ) ) ;
188
+ ( None , None ) => { } // no change
189
+ ( protocol, metadata) => {
190
+ // at least one of protocol and metadata changed, so update the table configuration
192
191
* table_configuration = TableConfiguration :: try_new (
193
- m ,
194
- p ,
192
+ metadata . unwrap_or_else ( || table_configuration . metadata ( ) . clone ( ) ) ,
193
+ protocol . unwrap_or_else ( || table_configuration . protocol ( ) . clone ( ) ) ,
195
194
table_configuration. table_root ( ) . clone ( ) ,
196
195
commit_file. version ,
197
196
) ?;
@@ -200,7 +199,7 @@ fn process_cdf_commit(
200
199
}
201
200
}
202
201
}
203
- if has_metadata {
202
+ if metadata_changed {
204
203
require ! (
205
204
table_schema. as_ref( ) == table_configuration. schema( ) ,
206
205
Error :: change_data_feed_incompatible_schema(
You can’t perform that action at this time.
0 commit comments