aljoscha commented on a change in pull request #9565: [FLINK-12501] Use 
SpecificRecord.getSchema in AvroFactory
URL: https://github.com/apache/flink/pull/9565#discussion_r319848035
 
 

 ##########
 File path: 
flink-formats/flink-avro/src/main/java/org/apache/flink/formats/avro/typeutils/AvroFactory.java
 ##########
 @@ -94,7 +94,8 @@ static Schema parseSchemaString(@Nullable String 
schemaString) {
        @SuppressWarnings("OptionalUsedAsFieldOrParameterType")
        private static <T> AvroFactory<T> fromSpecific(Class<T> type, 
ClassLoader cl, Optional<Schema> previousSchema) {
                SpecificData specificData = new SpecificData(cl);
-               Schema newSchema = specificData.getSchema(type);
+               Optional<Schema> newSchemaOptional = tryExtractAvroSchema(type);
+               Schema newSchema = 
newSchemaOptional.orElse(specificData.getSchema(type));
 
 Review comment:
   Thanks! That's very helpful. I'll update the PR.

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


With regards,
Apache Git Services

Reply via email to