File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -445,6 +445,10 @@ pub fn apply_table_updates(
445445 if schema_id == -1 {
446446 if let Some ( added_schema_id) = added_schema_id {
447447 metadata. current_schema_id = added_schema_id;
448+ } else {
449+ return Err ( Error :: InvalidFormat (
450+ "Cannot set current schema to -1 without adding a schema first" . to_string ( ) ,
451+ ) ) ;
448452 }
449453 } else {
450454 metadata. current_schema_id = schema_id;
@@ -459,6 +463,10 @@ pub fn apply_table_updates(
459463 if spec_id == -1 {
460464 if let Some ( added_spec_id) = added_spec_id {
461465 metadata. default_spec_id = added_spec_id;
466+ } else {
467+ return Err ( Error :: InvalidFormat (
468+ "Cannot set default spec to -1 without adding a spec first" . to_string ( ) ,
469+ ) ) ;
462470 }
463471 } else {
464472 metadata. default_spec_id = spec_id;
@@ -473,6 +481,10 @@ pub fn apply_table_updates(
473481 if sort_order_id == -1 {
474482 if let Some ( added_sort_order_id) = added_sort_order_id {
475483 metadata. default_sort_order_id = added_sort_order_id;
484+ } else {
485+ return Err ( Error :: InvalidFormat (
486+ "Cannot set default sort order to -1 without adding a sort order first" . to_string ( ) ,
487+ ) ) ;
476488 }
477489 } else {
478490 metadata. default_sort_order_id = sort_order_id;
You can’t perform that action at this time.
0 commit comments