nicusX commented on a change in pull request #12591:
URL: https://github.com/apache/flink/pull/12591#discussion_r438564688
##########
File path:
flink-formats/flink-avro/src/main/java/org/apache/flink/formats/avro/typeutils/AvroSerializer.java
##########
@@ -170,7 +170,11 @@ public int getLength() {
@Override
public T createInstance() {
- return InstantiationUtil.instantiate(type);
+ if (!isGenericRecord(type)) {
Review comment:
Sorry, but this solution causes many tests to fail:
```
[ERROR] Failures:
[ERROR]
AvroGenericTypeComparatorTest>AbstractGenericTypeComparatorTest.testBeanStyleObjects:78->AbstractGenericTypeComparatorTest.runTests:101
Exception in test: null
[ERROR]
AvroGenericTypeComparatorTest>AbstractGenericTypeComparatorTest.testCompositeObject:65->AbstractGenericTypeComparatorTest.runTests:101
Exception in test: null
[ERROR]
AvroGenericTypeComparatorTest>AbstractGenericTypeComparatorTest.testSimpleTypesObjects:45->AbstractGenericTypeComparatorTest.runTests:101
Exception in test: null
[ERROR]
AvroGenericTypeComparatorTest>AbstractGenericTypeComparatorTest.testString:33->AbstractGenericTypeComparatorTest.runTests:101
Exception in test: null
[ERROR]
AvroGenericTypeSerializerTest>AbstractGenericTypeSerializerTest.testBeanStyleObjects:95->AbstractGenericTypeSerializerTest.runTests:155
Exception in test: null
[ERROR]
AvroGenericTypeSerializerTest>AbstractGenericTypeSerializerTest.testCompositeObject:75->AbstractGenericTypeSerializerTest.runTests:155
Exception in test: null
[ERROR]
AvroGenericTypeSerializerTest>AbstractGenericTypeSerializerTest.testNestedInterfaces:124->AbstractGenericTypeSerializerTest.runTests:155
Exception in test: null
[ERROR]
AvroGenericTypeSerializerTest>AbstractGenericTypeSerializerTest.testNestedObjects:85->AbstractGenericTypeSerializerTest.runTests:155
Exception in test: null
[ERROR]
AvroGenericTypeSerializerTest>AbstractGenericTypeSerializerTest.testSimpleTypesObjects:64->AbstractGenericTypeSerializerTest.runTests:155
Exception in test: null
[ERROR]
AvroGenericTypeSerializerTest>AbstractGenericTypeSerializerTest.testString:41->AbstractGenericTypeSerializerTest.runTests:155
Exception in test: null
[ERROR] AvroSerializerEmptyArrayTest.testBookSerialization:42 Exception in
test: null
[ERROR] AvroSerializerEmptyArrayTest.testSerialization:67 Exception in
test: null
[ERROR] AvroSerializerTest>SerializerTestBase.testCopyIntoNewElements:207
Exception in test: null
[ERROR]
AvroSerializerTest>SerializerTestBase.testCopyIntoReusedElements:229 Exception
in test: null
[ERROR] AvroSerializerTest>SerializerTestBase.testInstantiate:111
Exception in test: null
[ERROR]
AvroSerializerTest>SerializerTestBase.testSerializeAsSequenceReusingValues:354
Exception in test: null
[ERROR]
AvroSerializerTest>SerializerTestBase.testSerializeIndividually:257 Exception
in test: null
[ERROR]
AvroSerializerTest>SerializerTestBase.testSerializeIndividuallyReusingValues:290
Exception in test: null
[ERROR]
AvroSerializerTest>SerializerTestBase.testSerializedCopyAsSequence:425
Exception in test: null
[ERROR]
AvroSerializerTest>SerializerTestBase.testSerializedCopyIndividually:387
Exception in test: null
```
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]