cassandra UUID type

94 views
Skip to first unread message

Anil

unread,
Aug 17, 2021, 1:24:45 PM8/17/21
to debezium
Hi. 
I have a question about the handling of the UUID column type from Cassandra. 
In the kafka payload json field shows as values like "AA4AAFcZEqMAAAAAKDJ9Sg==" for the UUID fields. What format is this? 

It does not appear to be a valid base64 from a string or serialized java.util.UUID. I have tried different versions of the debezium cassandra jar but it makes no difference. I see it logged this way in debezium so it is not a problem on the kafka consumer side.

Thank you.

Anil

unread,
Aug 18, 2021, 8:02:50 AM8/18/21
to debezium
In case this helps someone else new to Cassandra and Debezium, I am posting the solution. The string in the kafka payload is a base 64 encoding of the byte array of the UUID serialized using the Cassandra Serializer (org.apache.cassandra.serializers.UUIDSerializer). So you need to use/replicate the deserialization logic in that class after a base 64 decode.

Gunnar Morling

unread,
Aug 18, 2021, 8:56:57 AM8/18/21
to debezium
Anil,

Great you found your own answer and thanks for sharing it!

That being said, it's surprising to see this base64 based representation for a UUID column, I'm wondering why we don't use a regular string representation like "40e6215d-b5c6-4896-987c-f30f3678f608" as done for UUID for other connectors. Can you log an issue at https://issues.redhat.com/browse/DBZ for getting this adjusted?

@Bingqin: would be curious to learn about your thoughts on this one too. Does anything speak against simply changing this format? Given the connector is in "incubation" status right now, it's not a concern in terms of our general stability promises.

Thanks,

--Gunnar

Anil

unread,
Aug 19, 2021, 9:53:48 AM8/19/21
to debezium
Sure. I created an issue:
Reply all
Reply to author
Forward
0 new messages