n3nash commented on a change in pull request #2927:
URL: https://github.com/apache/hudi/pull/2927#discussion_r628786995



##########
File path: 
hudi-common/src/main/java/org/apache/hudi/common/table/TableSchemaResolver.java
##########
@@ -353,6 +361,56 @@ public static boolean isSchemaCompatible(String oldSchema, 
String newSchema) {
     return isSchemaCompatible(new Schema.Parser().parse(oldSchema), new 
Schema.Parser().parse(newSchema));
   }
 
+  /**
+   * Check if both schemas are equivalent.
+   * @param oldSchema old schema to be validated against.
+   * @param newSchema new schema to be validated against.
+   * @return {@code true} if both schema matches. else {@code false}.
+   */
+  public static boolean isSchemaEquals(Schema oldSchema, Schema newSchema) {

Review comment:
       Instead of these custom methods, can you implement the Comparator for 
Schema. The comparator contract for "0" meaning equal and non-zero providing 
which one is larger should suffice. 




-- 
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:
[email protected]


Reply via email to