szehon-ho commented on pull request #4372:
URL: https://github.com/apache/iceberg/pull/4372#issuecomment-1074716201


   > I have a unit test but I'm not sure it's worth to add it.
   > 
   > ```java
   > package org.apache.iceberg;
   > 
   > import org.apache.iceberg.relocated.com.google.common.collect.ImmutableSet;
   > import org.apache.iceberg.types.Types;
   > import org.junit.Assert;
   > import org.junit.Test;
   > 
   > public class TestSchema {
   >   @Test
   >   public void testValidateIdentifierField() {
   >     try {
   >       new Schema(
   >           Types.StructType.of(Types.NestedField.required(1, "id", 
Types.StringType.get())).fields(),
   >           ImmutableSet.of(2));
   >       Assert.fail("Should have failed because identifier id 2 does not 
exist");
   >     } catch (IllegalArgumentException e) {
   >       Assert.assertTrue(e.getMessage().contains("field not exists"));
   >     } // all other exception fails the test
   >   }
   > }
   > ```
   
   I think we can put one in TestSchemaUpdate (where the original author seems 
to put some test of the other preconditions?)


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