You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "rdblue (via GitHub)" <gi...@apache.org> on 2023/03/03 22:19:24 UTC

[GitHub] [iceberg] rdblue commented on a diff in pull request #6984: Core: Allow dropping columns referenced in old sort orders

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: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org