the-other-tim-brown commented on code in PR #11381:
URL: https://github.com/apache/hudi/pull/11381#discussion_r1623759939


##########
hudi-common/src/main/java/org/apache/hudi/internal/schema/utils/AvroSchemaEvolutionUtils.java:
##########
@@ -113,6 +120,21 @@ public static InternalSchema reconcileSchema(Schema 
incomingSchema, InternalSche
       typeChange.updateColumnType(col, inComingInternalSchema.findType(col));
     });
 
+    // mark columns missing from incoming schema as nullable
+    Set<String> visited = new HashSet<>();
+    diffFromOldSchema.stream()
+        // ignore meta fields
+        .filter(col -> !META_FIELD_NAMES.contains(col))
+        .sorted()
+        .forEach(col -> {
+          // if parent is marked as nullable, only update the parent and not 
all the missing children field
+          String parent = TableChangesHelper.getParentName(col);
+          if (!visited.contains(parent)) {
+            typeChange.updateColumnNullability(col, true);
+          }
+          visited.add(col);
+        });

Review Comment:
   This actually requires updates in quite a few places, I will wait until 
there is alignment and then I can update



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

Reply via email to