nsivabalan commented on code in PR #9743: URL: https://github.com/apache/hudi/pull/9743#discussion_r1382374892
########## hudi-common/src/main/java/org/apache/hudi/internal/schema/utils/AvroSchemaEvolutionUtils.java: ########## @@ -111,18 +117,22 @@ public static InternalSchema reconcileSchema(Schema incomingSchema, InternalSche return SchemaChangeUtils.applyTableChanges2Schema(internalSchemaAfterAddColumns, typeChange); } + public static Schema reconcileSchema(Schema incomingSchema, Schema oldTableSchema) { + return convert(reconcileSchema(incomingSchema, convert(oldTableSchema)), oldTableSchema.getFullName()); + } + /** - * Reconciles nullability requirements b/w {@code source} and {@code target} schemas, + * Reconciles nullability and datatype requirements b/w {@code source} and {@code target} schemas, * by adjusting these of the {@code source} schema to be in-line with the ones of the * {@code target} one * * @param sourceSchema source schema that needs reconciliation * @param targetSchema target schema that source schema will be reconciled against - * @param opts config options - * @return schema (based off {@code source} one) that has nullability constraints reconciled + * @param opts config options + * @return schema (based off {@code source} one) that has nullability constraints and datatypes reconciled */ - public static Schema reconcileNullability(Schema sourceSchema, Schema targetSchema, Map<String, String> opts) { - if (sourceSchema.getFields().isEmpty() || targetSchema.getFields().isEmpty()) { + public static Schema reconcileSchemaRequirements(Schema sourceSchema, Schema targetSchema, Map<String, String> opts) { + if (sourceSchema.getType() == Schema.Type.NULL || sourceSchema.getFields().isEmpty() || targetSchema.getFields().isEmpty()) { Review Comment: @jonvex : do you have any pointers here -- 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