You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2021/11/03 12:48:51 UTC
[GitHub] [pulsar] chlyzzo commented on issue #12596: python read AVRO topic has error
chlyzzo commented on issue #12596:
URL: https://github.com/apache/pulsar/issues/12596#issuecomment-958999972
test send the message:
in scala:
val user = new Person("werewr", 35)
producer.send(user)
in python:
producer.send(Person(name="wtr", age=23)
and python read, in schema/schema_avro.py:
def decode(self, data):
print(data, type(data), )
buffer = io.BytesIO(data2=)
d = fastavro.schemaless_reader(buffer, self._schema)
return self._record_cls(**d)
----------
get result:
from scala send message:
('\x02\x0cscala1F', <type 'str'>)
from python send message:
('\xe2\n\x02\x0cscala1', <type 'str’>)
so, they are not the same, there must has decode and encode,
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org