[
https://issues.apache.org/jira/browse/FLINK-9337?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16476134#comment-16476134
]
ASF GitHub Bot commented on FLINK-9337:
---------------------------------------
Github user StephanEwen commented on a diff in the pull request:
https://github.com/apache/flink/pull/5995#discussion_r188355756
--- Diff:
flink-formats/flink-avro/src/main/java/org/apache/flink/formats/avro/typeutils/AvroSerializer.java
---
@@ -275,9 +304,19 @@ else if (configSnapshot instanceof
AvroSerializerConfigSnapshot) {
// Utilities
//
------------------------------------------------------------------------
+ private static boolean isGenericRecord(Class<?> type) {
+ return !SpecificRecord.class.isAssignableFrom(type) &&
+ GenericRecord.class.isAssignableFrom(type);
+ }
+
@Override
public TypeSerializer<T> duplicate() {
- return new AvroSerializer<>(type);
+ if (schemaString != null) {
+ return new AvroSerializer<>(type, new
Schema.Parser().parse(schemaString));
--- End diff --
Duplication happens frequently, would be good to avoid schema parsing. You
can add a private copy constructor that takes class and string.
> Implement AvroDeserializationSchema
> -----------------------------------
>
> Key: FLINK-9337
> URL: https://issues.apache.org/jira/browse/FLINK-9337
> Project: Flink
> Issue Type: New Feature
> Reporter: Dawid Wysakowicz
> Assignee: Dawid Wysakowicz
> Priority: Major
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)