clesaec commented on code in PR #1776:
URL: https://github.com/apache/avro/pull/1776#discussion_r927583809


##########
lang/java/avro/src/main/java/org/apache/avro/generic/GenericDatumReader.java:
##########
@@ -234,8 +234,16 @@ protected Object convert(Object datum, Schema schema, 
LogicalType type, Conversi
    * representations.
    */
   protected Object readRecord(Object old, Schema expected, ResolvingDecoder 
in) throws IOException {
-    final Object record = data.newRecord(old, expected);
-    final Object state = data.getRecordState(record, expected);
+    final Schema realSchema;
+    if (expected.hasChild()) {
+      int index = in.readExtends();
+      realSchema = expected.findInHierachy(index);
+    } else {
+      realSchema = expected;
+    }

Review Comment:
   indeed, i have to add unit test and fix that.



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