danny0405 commented on code in PR #12598:
URL: https://github.com/apache/hudi/pull/12598#discussion_r1908102489


##########
hudi-common/src/main/java/org/apache/hudi/avro/AvroSchemaUtils.java:
##########
@@ -591,4 +596,24 @@ private static void findAnyMissingFieldsRec(Schema 
incomingSchema,
   public static String createSchemaErrorString(String errorMessage, Schema 
writerSchema, Schema tableSchema) {
     return String.format("%s\nwriterSchema: %s\ntableSchema: %s", 
errorMessage, writerSchema, tableSchema);
   }
+
+  /**
+   * Create a new schema by change the nullabilities of the given columns.
+   *
+   * @param schema original schema
+   * @param nullableUpdateCols columns that would be updated with given 
nullability
+   * @param nullable nullability of column type
+   * @return a new schema with the nullabilities of the given columns updated
+   */
+  public static Schema createSchemaWithNullabilityUpdate(

Review Comment:
   Rename to `forceNullableColumns`, we should also avoid to recreate the 
schema if the field is already nullable.



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