Shruthirdy commented on code in PR #2453:
URL: https://github.com/apache/iceberg-go/pull/2453#discussion_r4496023216


##########
table/update_schema_test.go:
##########
@@ -58,6 +59,34 @@ func TestNewUpdateSchemaWithNilTransactionReturnsError(t 
*testing.T) {
        assert.ErrorContains(t, err, "transaction is nil")
 }
 
+func TestUpdateSchemaLastColumnIDBelowHighestFieldIDReturnsError(t *testing.T) 
{
+       // Field "z" has ID 3, but the counter says 2, so the next new
+       // column would reuse ID 3.
+       data := strings.Replace(ExampleTableMetadataV2,
+               `"last-column-id": 3`, `"last-column-id": 2`, 1)
+       meta, err := ParseMetadataString(data)
+       require.NoError(t, err)
+       require.Equal(t, 2, meta.LastColumnID())

Review Comment:
   Sure, will add a test addressing this.



-- 
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]

Reply via email to