vinishjail97 commented on code in PR #19126:
URL: https://github.com/apache/hudi/pull/19126#discussion_r3509578709


##########
hudi-common/src/test/java/org/apache/hudi/avro/TestAvroRecordContext.java:
##########
@@ -94,11 +97,53 @@ void testGetFieldValueNested() {
   @Test
   void testGetFieldValueErrorCases() {
     GenericRecord record = buildRecord();
-    // a union that is not [null, T] does not support field lookups
-    assertThrows(IllegalStateException.class, () -> 
getFieldValueFromIndexedRecord(record, "multi.sub"));
+    // a union that is not [null, T] cannot be navigated into; instead of 
throwing, the value
+    // navigator returns null so callers (e.g. column-stats collection) 
degrade gracefully,
+    // matching HoodieAvroUtils.getNestedFieldVal
+    assertNull(getFieldValueFromIndexedRecord(record, "multi.sub"));
+    // an empty field name is still rejected up front
     assertThrows(IllegalArgumentException.class, () -> 
getFieldValueFromIndexedRecord(record, ""));
   }
 
+  private static final Schema COMPLEX_SCHEMA = new Schema.Parser().parse(

Review Comment:
   Renamed to `MAP_AND_ARRAY_SCHEMA` in 1a78da72a1.



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