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


##########
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:
   @yihua mentioned this will be covered in a follow up task.



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