voonhous commented on code in PR #17535:
URL: https://github.com/apache/hudi/pull/17535#discussion_r2608916758


##########
hudi-common/src/main/java/org/apache/hudi/common/schema/HoodieSchemaCompatibility.java:
##########
@@ -191,4 +215,42 @@ public static boolean 
areSchemasProjectionEquivalent(HoodieSchema schema1, Hoodi
     }
     return 
AvroSchemaUtils.areSchemasProjectionEquivalent(schema1.toAvroSchema(), 
schema2.toAvroSchema());
   }
+
+  /**
+   * Identifies the writer field that corresponds to the specified reader 
field.
+   * This function is adapted from AvroSchemaCompatibility#lookupWriterField
+   *
+   * <p>
+   * Matching includes reader name aliases.
+   * </p>
+   *
+   * @param writerSchema Schema of the record where to look for the writer 
field.
+   * @param readerField  Reader field to identify the corresponding writer 
field
+   *                     of.
+   * @return the writer field, if any does correspond, or None.
+   */
+  public static HoodieSchemaField lookupWriterField(final HoodieSchema 
writerSchema, final HoodieSchemaField readerField) {
+    assert (writerSchema.getType() == HoodieSchemaType.RECORD);

Review Comment:
   Done



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