Uploaded image for project: 'Debezium'
  1. Debezium
  2. DBZ-5923

Cassandra TimeUUID values should be encoded as string

XMLWordPrintable

    • False
    • None
    • False

      Steps to reproduce

      • create cdc-enabled Cassandra table with timeuuid type
      • insert timeuuid value into table

      For example:

      CREATE TABLE IF NOT EXISTS my_keyspace.my_table
          ( my_uuid uuid, my_timeuuid timeuuid, PRIMARY KEY (my_uuid) )
          WITH cdc=true;
      
      INSERT INTO my_keyspace.my_table ( uuid, timeuuid ) VALUES ( uuid(), now() );
      
      SELECT * FROM my_keyspace.my_table
       my_uuid                              | my_timeuuid
      --------------------------------------+--------------------------------------
       44e15b4f-46f4-429d-9622-a310aeeccdc6 | 8380dd80-7854-11ed-85f9-597e5c2eeb62
      

      Kafka will show timeuuid value as base64 encoding of the serialized UUID. e.g:

      {"ts_ms":1670653994604,"op":"i","source":{"version":"2.1.0-SNAPSHOT","connector":"cassandra","name":"debezium.json","ts_ms":1670653989715,"snapshot":"false","db":"NULL","sequence":null,"cluster":"My Cluster","file":"CommitLog-7-1670653704105.log","pos":693798,"keyspace":"my_keyspace","table":"my_table"},"after":{"my_uuid":{"value":"44e15b4f-46f4-429d-9622-a310aeeccdc6","deletion_ts":null,"set":true},"my_timeuuid":{"value":"g4DdgHhUEe2F+Vl+XC7rYg==","deletion_ts":null,"set":true},".range_start":null,".range_end":null}}
      

      Description

      Cassandra TimeUUID types are serialized to Debezium CDC events using Cassandra's UUIDSerializer (org.apache.cassandra.serializers.UUIDSerializer) as a byte array + base64 encoding.

      For example, TimeUUID 8380dd80-7854-11ed-85f9-597e5c2eeb62 is represented as "g4DdgHhUEe2F+Vl+XC7rYg==" 

      Note: in the above example that Cassandra uuid types are deserialized into human readable UUIDs. DBZ 3885 addressed this issue with respect to Cassandra uuid types. However timeuuid types were left unaddressed.

      Is this something that should be addressed via 'timeuuid.handling.mode' / 'uuid.handling.mode' config options, or is the expectation that both uuid and timeuuid types should always be deserialized into human readable strings?

              Unassigned Unassigned
              keriharris Keri Harris (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: