clairemcginty commented on code in PR #38109:
URL: https://github.com/apache/beam/pull/38109#discussion_r3125055193
##########
sdks/java/extensions/avro/src/test/java/org/apache/beam/sdk/extensions/avro/schemas/utils/AvroUtilsTest.java:
##########
@@ -284,10 +285,21 @@ public void avroToBeamRoundTrip(
Iterable iterable = randomData(avroSchema, 10);
List<GenericRecord> records = Lists.newArrayList((Iterable<GenericRecord>)
iterable);
+ // AVRO-4139: GenericRecord.equals() throws "Can't compare maps!" for
records with
+ // nested map types on Avro 1.12.0. Fall back to JSON tree comparison on
that version
+ // only; keep direct equals for other versions.
+ String avroVersion =
org.apache.avro.Schema.class.getPackage().getImplementationVersion();
+ boolean useJsonCompare = "1.12.0".equals(avroVersion);
Review Comment:
```suggestion
boolean useJsonCompare = "1.12.0".equals(VERSION_AVRO);
```
--
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]