rdblue commented on code in PR #6984:
URL: https://github.com/apache/iceberg/pull/6984#discussion_r1125073503


##########
core/src/test/java/org/apache/iceberg/util/TestSortOrderUtil.java:
##########
@@ -303,4 +305,33 @@ public void 
testSortOrderClusteringWithRedundantPartitionFieldsMissing() {
         expected,
         SortOrderUtil.buildSortOrder(table.schema(), updatedSpec, order));
   }
+
+  @Test
+  public void testDropColumnFromDefaultSortOrder() {
+    TestTables.TestTable table =
+        TestTables.create(
+            tableDir, "test", SCHEMA, PartitionSpec.unpartitioned(), 
SortOrder.unsorted(), 1);
+    table.replaceSortOrder().asc("ts").commit();
+
+    Assertions.assertThatThrownBy(() -> 
table.updateSchema().deleteColumn("ts").commit())
+        .isInstanceOf(ValidationException.class)
+        .hasMessage("Cannot find source column for sort field: identity(3) ASC 
NULLS FIRST");

Review Comment:
   I think these tests already exist: 
https://github.com/apache/iceberg/blob/master/core/src/test/java/org/apache/iceberg/TestSortOrder.java#L306-L338
   
   There are `testColumnDropWithSortOrder` and 
`testIncompatibleSchemaEvolutionWithSortOrder`.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to