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


##########
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:
   @nsivabalan I've updated the PR to include the boolean



-- 
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: commits-unsubscr...@hudi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to