the-other-tim-brown commented on code in PR #14311:
URL: https://github.com/apache/hudi/pull/14311#discussion_r2581739933


##########
hudi-common/src/main/java/org/apache/hudi/common/schema/HoodieSchemaUtils.java:
##########
@@ -221,4 +222,64 @@ public static HoodieSchemaField 
createNewSchemaField(String name, HoodieSchema s
         name, schema.toAvroSchema(), doc, defaultValue);
     return HoodieSchemaField.fromAvroField(avroField);
   }
+
+  /**
+   * Gets a field (including nested fields) from the schema using dot notation.
+   * This is equivalent to HoodieAvroUtils.getSchemaForField() but operates on 
HoodieSchema.
+   * <p>
+   * Supports nested field access using dot notation. For example:
+   * <ul>
+   *   <li>"name" - retrieves top-level field</li>
+   *   <li>"user.profile.displayName" - retrieves nested field</li>
+   * </ul>
+   *
+   * @param schema    the schema to search in
+   * @param fieldName the field name (may contain dots for nested fields)
+   * @return Pair of canonical field name and the HoodieSchemaField, or null 
if field not found
+   * @throws IllegalArgumentException if schema or fieldName is null/empty
+   */
+  public static Pair<String, HoodieSchemaField> getNestedField(HoodieSchema 
schema, String fieldName) {

Review Comment:
   Is there unit testing for this?



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