xiarixiaoyao commented on code in PR #6358:
URL: https://github.com/apache/hudi/pull/6358#discussion_r1025142367


##########
hudi-common/src/main/java/org/apache/hudi/avro/AvroSchemaUtils.java:
##########
@@ -31,6 +31,31 @@ public class AvroSchemaUtils {
 
   private AvroSchemaUtils() {}
 
+  /**
+   * Generates fully-qualified name for the Avro's schema based on the Table's 
name
+   *
+   * NOTE: PLEASE READ CAREFULLY BEFORE CHANGING
+   *       This method should not change for compatibility reasons as older 
versions
+   *       of Avro might be comparing fully-qualified names rather than just 
the record
+   *       names
+   */
+  public static String getAvroRecordQualifiedName(String tableName) {
+    String sanitizedTableName = HoodieAvroUtils.sanitizeName(tableName);
+    return "hoodie." + sanitizedTableName + "." + sanitizedTableName + 
"_record";
+  }
+
+  // TODO java-doc, test
+  public static boolean isProjectionOf(Schema sourceSchema, Schema 
targetSchema) {
+    for (Schema.Field targetField : targetSchema.getFields()) {
+      Schema.Field sourceField = sourceSchema.getField(targetField.name());

Review Comment:
   how about nest field project, do we need support it.



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