rdblue commented on a change in pull request #2096:
URL: https://github.com/apache/iceberg/pull/2096#discussion_r580682837
##########
File path: core/src/test/java/org/apache/iceberg/TestTableMetadata.java
##########
@@ -599,4 +639,81 @@ public void testUpdateSortOrder() {
Assert.assertEquals("Should be nulls first",
NullOrder.NULLS_FIRST,
sortedByX.sortOrder().fields().get(0).nullOrder());
}
+
+ @Test
+ public void testUpdateSchema() {
+ Schema schema = new Schema(0,
+ Types.NestedField.required(1, "y", Types.LongType.get(), "comment")
+ );
+ TableMetadata freshTable = TableMetadata.newTableMetadata(
+ schema, PartitionSpec.unpartitioned(), null, ImmutableMap.of());
+ Assert.assertEquals("Should use TableMetadata.INITIAL_SCHEMA_ID for
current schema id",
+ TableMetadata.INITIAL_SCHEMA_ID, freshTable.currentSchemaId());
Review comment:
Minor: The schema passed in uses the same ID as the one that is
validated (`INITIAL_SCHEMA_ID=0`). I think to test this, it would be better to
pass in a schema with a non-zero ID.
----------------------------------------------------------------
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]