@@ -320,7 +320,7 @@ public static TableSchema generateTableSchema(
320320 } else if (change instanceof RemoveOption ) {
321321 RemoveOption removeOption = (RemoveOption ) change ;
322322 if (hasSnapshots .get ()) {
323- checkResetTableOption (removeOption .key ());
323+ checkResetTableOption (oldOptions , removeOption .key ());
324324 }
325325 newOptions .remove (removeOption .key ());
326326 } else if (change instanceof UpdateComment ) {
@@ -1180,7 +1180,7 @@ public static void checkAlterTableOption(
11801180 }
11811181 }
11821182
1183- public static void checkResetTableOption (String key ) {
1183+ public static void checkResetTableOption (Map < String , String > options , String key ) {
11841184 if (CoreOptions .IMMUTABLE_OPTIONS .contains (key )) {
11851185 throw new UnsupportedOperationException (
11861186 String .format ("Change '%s' is not supported yet." , key ));
@@ -1189,6 +1189,13 @@ public static void checkResetTableOption(String key) {
11891189 if (CoreOptions .BUCKET .key ().equals (key )) {
11901190 throw new UnsupportedOperationException (String .format ("Cannot reset %s." , key ));
11911191 }
1192+
1193+ if (options .containsKey (PK_CLUSTERING_OVERRIDE .key ())
1194+ && CLUSTERING_COLUMNS .key ().equals (key )) {
1195+ throw new UnsupportedOperationException (
1196+ String .format (
1197+ "Cannot reset %s when %s enabled." , key , PK_CLUSTERING_OVERRIDE .key ()));
1198+ }
11921199 }
11931200
11941201 public static void checkAlterTablePath (String key ) {
0 commit comments