Skip to content
This repository has been archived by the owner on Dec 14, 2022. It is now read-only.

[BUG] not match primitive schema of byte array #491

Open
wuzhanpeng opened this issue Dec 28, 2021 · 0 comments · May be fixed by #492
Open

[BUG] not match primitive schema of byte array #491

wuzhanpeng opened this issue Dec 28, 2021 · 0 comments · May be fixed by #492
Labels

Comments

@wuzhanpeng
Copy link
Contributor

wuzhanpeng commented Dec 28, 2021

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.

@wuzhanpeng wuzhanpeng linked a pull request Dec 28, 2021 that will close this issue
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant