[ 
https://issues.apache.org/jira/browse/AVRO-1962?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16240598#comment-16240598
 ] 

Ryan Blue commented on AVRO-1962:
---------------------------------

There is no UUID logical type in the Avro spec, which means that there is no 
interoperability requirement for UUIDs across Avro implementations or 
downstream projects. I suggested adding it to Parquet, but that's because 
Parquet doesn't allow logical types that aren't defined in the spec. Avro, on 
the other hand, allows logical types that are custom and are used to annotate 
data that should be transformed. UUID is an example of a type where we don't 
need interop requirements when storing the value as a String, but it is nice to 
get the result from deserialization as a Java UUID, or be able to pass a UUID 
in to be serialized.

If we want to start storing UUIDs as 16-byte binary, then we should add UUID to 
the spec and define how it should be stored as either a String or as big-endian 
bytes.

> Support UUID logical type
> -------------------------
>
>                 Key: AVRO-1962
>                 URL: https://issues.apache.org/jira/browse/AVRO-1962
>             Project: Avro
>          Issue Type: Bug
>    Affects Versions: 1.8.1
>            Reporter: Tianxiang Xiong
>
> The AVRO-1554 ticket seems to suggest that the issue of representing UUIDs is 
> resolved with [logical 
> types|http://avro.apache.org/docs/1.8.1/spec.html#Logical+Types] in Avro
> 1.8.1. However, there is [no UUID logical type in Avro 
> 1.8.1|https://github.com/apache/avro/blob/release-1.8.1/lang/java/compiler/src/main/javacc/org/apache/avro/compiler/idl/idl.jj#L214-L244].
> The specification offers several examples of using logical types; decimals
> are represented as:
> {code}
> {
>   "type": "bytes",
>   "logicalType": "decimal",
>   "precision": 4,
>   "scale": 2
> }
> {code}
> No examples for UUID are offered, presumably because UUIDs are not supported.
> Thanks to [~Yibing]'s confirmation on the mailing list that this is the case.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to