Skip to content

Commit

Permalink
AVRO-3918: Add support for UUID encoded as fixed[16] (#2672)
Browse files Browse the repository at this point in the history
* AVRO-3918: change spec

* Polish

* Include fixed layout to conform to rfc4122

Co-authored-by: Oscar Westra van Holthe - Kind <[email protected]>

---------

Co-authored-by: Christophe Le Saec <[email protected]>
Co-authored-by: Oscar Westra van Holthe - Kind <[email protected]>
  • Loading branch information
3 people authored Jan 29, 2024
1 parent 87e93a8 commit c27fa40
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions doc/content/en/docs/++version++/Specification/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -825,18 +825,28 @@ _Currently only available in Java and Rust_.
Here, as scale property is stored in value itself it needs more bytes than preceding `decimal` type, but it allows more flexibility.

### UUID

The `uuid` logical type represents a random generated universally unique identifier (UUID).

A `uuid` logical type annotates an Avro `string`. The string has to conform with [RFC-4122](https://www.ietf.org/rfc/rfc4122.txt)
A `uuid` logical type annotates an Avro `string` or `fixed` of length 16. Both the string and `fixed` byte layout have to conform with [RFC-4122](https://www.ietf.org/rfc/rfc4122.txt).

The following schemas represent a uuid:

The following schema represents a uuid:
```json
{
"type": "string",
"logicalType": "uuid"
}
```

```json
{
"type": "fixed",
"size": "16",
"logicalType": "uuid"
}
```

### Date
The `date` logical type represents a date within the calendar, with no reference to a particular time zone or time of day.

Expand Down

0 comments on commit c27fa40

Please sign in to comment.