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

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

Open
@wuzhanpeng

Description

@wuzhanpeng

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions