Open longtengz opened 3 years ago
I got it working with PulsarDeserializationSchema.valueOnley(new AvroRowDeserializationSchema(new String(schemaInfo.getSchema(), StandardCharsets.UTF_8)))
.
Now I'm not sure what's the purpose of PulsarDeserializer
if what I was describing is not a bug.
@longtengz Please tell me the version of the connector you are using~
PulsarDeserializer
is a class that is about to be deprecated, and it is still used sparingly in the basic types of Pulsar. Please use PulsarDeserializationSchema.valueOnley(new AvroRowDeserializationSchema(new String(schemaInfo.getSchema(), StandardCharsets.UTF_8)))
to decode the avro data.
Regarding the problem of org/apache/pulsar/shade/io/netty/buffer/PoolArena$1
, it should be that the same class exists in flink_lib. You can keep any copy. This class is in the pulsar-client-all
package. Also exists in the fat connector jar.
@jianyun8023 I think this is a bug, we should drop the PulsarDeserializer if it's about to be deprecated.
@syhily @longtengz Well, PulsarDeserializer
is the class that should be dropped
Describe the bug
Basicially, I want to use
PulsarDeserializer
to get avro data converted to flink row. But somehow, it keeps telling me NoClassDefFoundError and NPE.The stdout in flink web ui shows the following
which is quite confusing to me, because I checked this class
org/apache/pulsar/shade/io/netty/buffer/PoolArena$1
is in the fat job jar.As for why avro->flink row, I want to process pulsar messages with field names and field positions. Since I have tons of topics and I don't want to have tons of useless classes the whole purpose of which is to do deserialization, that's why
AvroDeser
is no go.To Reproduce
It's very simple code.
Expected behavior
Print flink row.
Log messages
The cli stdout
The flink taskmanager log
Possible cause
In
PulsarDeserializer
,getSchema
returnsnull
https://github.com/streamnative/pulsar-flink/blob/9094562681be84698bf8f159e0ea7c10b87048f7/pulsar-flink-connector/src/main/java/org/apache/flink/streaming/connectors/pulsar/internal/PulsarDeserializer.java#L515
which is causing
ConsumerImpl.schema
to benull
and then this line errors out.https://github.com/apache/pulsar/blob/1926dee082c70f4d5dcad54a94fdee57e197901a/pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConsumerImpl.java#L727