kbendick commented on a change in pull request #2048:
URL: https://github.com/apache/iceberg/pull/2048#discussion_r556174544



##########
File path: core/src/test/java/org/apache/iceberg/TestSchemaAndMappingUpdate.java
##########
@@ -155,6 +156,42 @@ public void testDeleteColumn() {
     validateUnchanged(mapping, updated);
   }
 
+  @Test
+  public void testModificationWithMetricsMetrics() {
+    NameMapping mapping = MappingUtil.create(table.schema());
+    String mappingJson = NameMappingParser.toJson(mapping);
+
+    table.updateProperties()
+        .set(TableProperties.DEFAULT_NAME_MAPPING, mappingJson)
+        .set("write.metadata.metrics.column.id", "full")
+        .commit();
+
+    AssertHelpers.assertThrows(
+        "Creating metrics for non-existent column fails",
+        ValidationException.class,
+        null,
+        () ->
+          table.updateProperties()
+            .set(TableProperties.DEFAULT_NAME_MAPPING, mappingJson)
+            .set("write.metadata.metrics.column.ids", "full")
+          .commit());
+
+    AssertHelpers.assertThrows(
+        "Deleting a column with metrics fails",
+        ValidationException.class,
+        null,
+        () ->
+          table.updateSchema()
+              .deleteColumn("id")
+          .commit());

Review comment:
       Nit: line indentation doesn't line up with the other values.




----------------------------------------------------------------
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.

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