rahil-c commented on code in PR #17573:
URL: https://github.com/apache/hudi/pull/17573#discussion_r2631550917


##########
hudi-common/src/main/java/org/apache/hudi/common/schema/HoodieSchemaUtils.java:
##########
@@ -595,7 +674,29 @@ public static HoodieSchema getRecordKeySchema() {
    * @param fields     list of fields to project
    * @return projected schema containing only specified fields
    */
+
   public static HoodieSchema projectSchema(HoodieSchema fileSchema, 
List<String> fields) {
     return 
HoodieSchema.fromAvroSchema(HoodieAvroUtils.projectSchema(fileSchema.toAvroSchema(),
 fields));
   }
+
+  /**
+   * Gets the fully-qualified Avro record name for a Hudi table.
+   * This is equivalent to {@link 
AvroSchemaUtils#getAvroRecordQualifiedName(String)}
+   * but provides a HoodieSchema-context API.
+   *
+   * <p>The qualified name follows the pattern: 
hoodie.{tableName}.{tableName}_record
+   * where tableName is sanitized for Avro compatibility.</p>
+   *
+   * @param tableName the Hudi table name
+   * @return the fully-qualified Avro record name (e.g., 
"hoodie.my_table.my_table_record")
+   * @throws IllegalArgumentException if tableName is null or empty
+   * @since 1.2.0
+   */
+  public static String getRecordQualifiedName(String tableName) {
+    ValidationUtils.checkArgument(tableName != null && 
!tableName.trim().isEmpty(),
+        "Table name cannot be null or empty");
+
+    // Delegate to AvroSchemaUtils
+    return AvroSchemaUtils.getAvroRecordQualifiedName(tableName);

Review Comment:
   I am not quite sure on what you mean by this comment? I think we can just 
keep this to be 1-1 with avro util for now unless I am missing something? 



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