You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by GitBox <gi...@apache.org> on 2021/01/12 23:58:15 UTC

[GitHub] [iceberg] kbendick commented on a change in pull request #2048: Add validation for metrics config during parquet write

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:
users@infra.apache.org



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