rdblue commented on a change in pull request #3632:
URL: https://github.com/apache/iceberg/pull/3632#discussion_r763518025
##########
File path: core/src/test/java/org/apache/iceberg/TestUpdatePartitionSpec.java
##########
@@ -614,6 +605,65 @@ public void testRemoveAndAddMultiTimes() {
V2Assert.assertEquals("Should match expected spec", v2Expected, updated);
}
+ @Test
+ public void testRemoveAndUpdateWithIdentity() {
+ PartitionSpec expected = PartitionSpec.builderFor(SCHEMA)
+ .identity("ts")
+ .build();
+ PartitionSpec updated = new BaseUpdatePartitionSpec(formatVersion,
expected)
+ .removeField("ts")
+ .addField("ts")
+ .apply();
+
+ if (formatVersion == 1) {
+ Assert.assertEquals("Should match expected spec field size", 2,
updated.fields().size());
+ Assert.assertEquals("Should match expected field name", "ts",
+ updated.fields().get(0).name());
+ Assert.assertEquals("Should match expected field name", "ts",
+ updated.fields().get(1).name());
Review comment:
You should just need to add a way to bypass that check since this isn't
a rename that is supplied by the user. Maybe just allow a rename if it's a void
field.
Also, did you push your changes? It looks like this still modifies
`PartitionSpec`.
--
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]