rdblue commented on a change in pull request #3954:
URL: https://github.com/apache/iceberg/pull/3954#discussion_r790313601
##########
File path: core/src/test/java/org/apache/iceberg/TestUpdatePartitionSpec.java
##########
@@ -477,12 +477,12 @@ public void testAddRedundantTimePartition() {
}
@Test
- public void testAddDeletedField() {
- AssertHelpers.assertThrows("Should fail adding a duplicate field",
- IllegalArgumentException.class, "Cannot add duplicate partition field",
- () -> new BaseUpdatePartitionSpec(formatVersion, PARTITIONED)
- .removeField("shard")
- .addField(bucket("id", 16))); // duplicates shard
+ public void testNoEffectAddDeletedSameField() {
+ PartitionSpec updated = new BaseUpdatePartitionSpec(formatVersion,
PARTITIONED)
+ .removeField("shard")
+ .addField(bucket("id", 16))
Review comment:
This isn't correct because "shard" is a custom name. The result of
separating this into two updates (remove and then add) would be a different
partition spec, with the bucket field named `id_bucket_16`.
In this case, I think you just need to detect the rename and rewrite the
remove/add to rename.
--
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]