rdblue commented on a change in pull request #922:
URL: https://github.com/apache/iceberg/pull/922#discussion_r441204336
##########
File path: core/src/test/java/org/apache/iceberg/TestPartitionSpecInfo.java
##########
@@ -91,25 +94,27 @@ public void testSpecInfoPartitionedTable() {
}
@Test
- public void testSpecInfoPartitionSpecEvolutionForV1Table() {
+ public void testSpecInfoPartitionSpecEvolution() {
PartitionSpec spec = PartitionSpec.builderFor(schema)
.bucket("data", 4)
.build();
TestTables.TestTable table = TestTables.create(tableDir, "test", schema,
spec, formatVersion);
Assert.assertEquals(spec, table.spec());
- TableMetadata base = TestTables.readMetadata("test");
- PartitionSpec newSpec = PartitionSpec.builderFor(table.schema())
- .bucket("data", 10)
+ PartitionSpec expectedNewSpec = PartitionSpec.builderFor(table.schema())
+ .add(2, newFieldId, "data_bucket", "bucket[10]")
.withSpecId(1)
.build();
- table.ops().commit(base, base.updatePartitionSpec(newSpec));
- Assert.assertEquals(newSpec, table.spec());
- Assert.assertEquals(newSpec, table.specs().get(newSpec.specId()));
+ table.updateSpec().clear()
Review comment:
Using `clear` should be rare. Most cases should remove a single field
and add another field.
----------------------------------------------------------------
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:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]