[
https://issues.apache.org/jira/browse/FLINK-34436?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17817629#comment-17817629
]
Jacek Wislicki commented on FLINK-34436:
----------------------------------------
The problem seems to be in
org.apache.flink.connector.pulsar.source.reader.deserializer.PulsarSchemaWrapper.deserialize(Message<byte[]>,
Collector<T>):
{code:java}
@Override
public void deserialize(Message<byte[]> message, Collector<T> out) throws
Exception {
Schema<T> schema = this.pulsarSchema.getPulsarSchema();
byte[] bytes = message.getData();
T instance = schema.decode(bytes);
out.collect(instance);
}
{code}
this.pulsarSchema.getPulsarSchema() returns the expected schema, not the schema
in which the message was actually encoded. For proper conversion, both source
(encoding) and target (decoding) schemas are needed.
> Avro schema evolution and compatibility issues in Pulsar connector
> ------------------------------------------------------------------
>
> Key: FLINK-34436
> URL: https://issues.apache.org/jira/browse/FLINK-34436
> Project: Flink
> Issue Type: Bug
> Components: Connectors / Pulsar
> Affects Versions: 1.17.2
> Reporter: Jacek Wislicki
> Priority: Major
>
> We noticed a couple of critical issues in the Pulsar-Flink connector related
> to schema evolution and compatibility. Please see the MRE available at
> https://github.com/JacekWislicki/test11. More details are in the project's
> README file, here is the summary:
> Library versions:
> * Pulsar 3.0.1
> * Flink 1.17.2
> * Pulsar-Flink connector 4.1.0-1.17
> Problems:
> * Exception thrown when schema's fields are added/removed
> * Avro's enum default value is ignored, instead the last known applied
> I believe that I observed the same behaviour in the Pulsar itself, still now
> we are focusing on the connector, hence I was able to document the problems
> when using it.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)