Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Best way to represent a UUID in Avro?

Tags:

uuid

avro

I am curious to understand the best practice for encoding one very specific type of data within Avro: UUIDs.

like image 810
Alex Dean Avatar asked May 02 '13 13:05

Alex Dean


1 Answers

So far, the only way I found is defining a custom UUID:

{
  "namespace" : "your.namespace",
  "type" : "fixed",
  "name" : "UUID",
  "size" : 16
}

I'm using Scala, so I also defined an implicit conversion between java.util.UUID and my custom UUID, so it's not that much of a hassle to use it.

like image 101
Marius Soutier Avatar answered Oct 23 '22 07:10

Marius Soutier