ebyhr commented on code in PR #15552:
URL: https://github.com/apache/iceberg/pull/15552#discussion_r2904790168
##########
core/src/test/java/org/apache/iceberg/TestSchemaUpdate.java:
##########
@@ -1181,6 +1181,34 @@ public void testDeleteMapKey() {
.hasMessageStartingWith("Cannot delete map keys");
}
+ @Test
+ public void testDeleteMapColumn() {
+ // Deleting an entire map column should succeed
+ Schema updated =
+ new SchemaUpdate(SCHEMA,
SCHEMA_LAST_COLUMN_ID).deleteColumn("locations").apply();
+ assertThat(updated.findField("locations")).isNull();
+ }
+
+ @Test
+ public void testDeleteSimpleMapColumn() {
+ // Deleting a simple map<string, string> column should succeed
+ Schema updated =
+ new SchemaUpdate(SCHEMA,
SCHEMA_LAST_COLUMN_ID).deleteColumn("properties").apply();
+ assertThat(updated.findField("properties")).isNull();
+ }
+
+ @Test
+ public void testDeleteMapValue() {
+ // Deleting a map's value field should fail
+ assertThatThrownBy(
+ () ->
+ new SchemaUpdate(SCHEMA, SCHEMA_LAST_COLUMN_ID)
+ .deleteColumn("locations.value")
+ .apply())
+ .isInstanceOf(IllegalArgumentException.class)
+ .hasMessageStartingWith("Cannot delete value type from map");
+ }
Review Comment:
These tests pass even without `SchemaUpdate` change. Could you modify it so
that it fails without this change?
--
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]