pulsar-flink
pulsar-flink copied to clipboard
[BUG] not match primitive schema of byte array
Describe the bug
The class and schema is not match for byte array in PulsarPrimitiveSchema.
https://github.com/apache/pulsar/blob/0bc45b54f29c5ffa1918e49aa4a341f70679162a/pulsar-client/src/main/java/org/apache/pulsar/client/impl/schema/BytesSchema.java#L50-L53
The return type of method decode is byte[], but the class name in PulsarPrimitiveSchema is Byte[], which will cause type conversion exceptions during task execution.
To Reproduce
Create a source like:
FlinkPulsarSource<Byte[]> source = new FlinkPulsarSource<>(
serviceUrl,
adminUrl,
new PulsarPrimitiveSchema<>(Byte[].class),
properties);
then would receive ClassCastException.