szehon-ho commented on code in PR #4535:
URL: https://github.com/apache/iceberg/pull/4535#discussion_r855671620
##########
core/src/test/java/org/apache/iceberg/TestSchemaUpdate.java:
##########
@@ -1478,6 +1497,23 @@ public void testDeleteIdentifierFieldColumnsFails() {
() -> new SchemaUpdate(schemaWithIdentifierFields,
SCHEMA_LAST_COLUMN_ID).deleteColumn("id").apply());
}
+ @Test
+ public void testDeleteContainingNestedIdentifierFieldColumnsFails() {
+ Schema newSchema = new SchemaUpdate(SCHEMA, SCHEMA_LAST_COLUMN_ID)
+ .allowIncompatibleChanges()
+ .addRequiredColumn("out", Types.StructType.of(
+ Types.NestedField.required(SCHEMA_LAST_COLUMN_ID + 2, "nested",
Types.StringType.get())
+ ))
+ .setIdentifierFields("out.nested")
+ .apply();
+
+ AssertHelpers.assertThrows("delete an identifier column without setting
identifier fields should fail",
Review Comment:
nit: the message can be clearer like 'delete a struct with a nested
identifier column without setting identifier fields should fail'?
##########
core/src/test/java/org/apache/iceberg/TestSchemaUpdate.java:
##########
@@ -1388,34 +1395,39 @@ public void testSetIdentifierFieldsFails() {
.setIdentifierFields("locations.key.zip")
.apply());
- AssertHelpers.assertThrows("add a nested field in list should fail",
Review Comment:
How about this test, it should not need to be removed right? (if i
understand, the first check is still about list).
Seems the new test "required_list.element.x" is about required list, this
can be kept and test about optional list.
--
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]