You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by GitBox <gi...@apache.org> on 2019/11/11 05:56:40 UTC

[GitHub] [incubator-iceberg] rdsr commented on a change in pull request #574: Add incompatible changes to UpdateSchema API

rdsr commented on a change in pull request #574: Add incompatible changes to UpdateSchema API
URL: https://github.com/apache/incubator-iceberg/pull/574#discussion_r344565910
 
 

 ##########
 File path: core/src/main/java/org/apache/iceberg/SchemaUpdate.java
 ##########
 @@ -373,19 +444,23 @@ public Type map(Types.MapType map, Type kResult, Type vResult) {
       }
 
       // use field to apply updates to the value
-      Type valueResult = field(map.fields().get(1), vResult);
-      if (valueResult == null) {
+      Types.NestedField valueField = map.fields().get(1);
+      Type valueType = field(valueField, valueResult);
+      if (valueType == null) {
         throw new IllegalArgumentException("Cannot delete value type from map: " + map);
       }
 
-      if (map.valueType() == valueResult) {
+      Types.NestedField valueUpdate = updates.get(valueField.fieldId());
+      boolean isValueOptional = valueUpdate != null ? valueUpdate.isOptional() : map.isValueOptional();
+
+      if (isValueOptional == map.isValueOptional() && map.valueType() == valueType) {
 
 Review comment:
   check for doc?

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org