[ 
https://issues.apache.org/jira/browse/AVRO-2864?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Oscar Westra van Holthe - Kind resolved AVRO-2864.
--------------------------------------------------
    Resolution: Information Provided

> IDL does not fully support arbitrary logical types
> --------------------------------------------------
>
>                 Key: AVRO-2864
>                 URL: https://issues.apache.org/jira/browse/AVRO-2864
>             Project: Apache Avro
>          Issue Type: Bug
>            Reporter: Roger
>            Priority: Major
>
> There seems to be no way to specify a logical type other than the ones built 
> in to IDL (decimal, date, time-millis, timestamp-millis) when the type is not 
> used at the top level in a field.
> For example, it is not possible to specify an array of long with logical type 
> timestamp-micros.
> If you do:
> {code:none}
> protocol _ {
>               record R {
>                       @logicalType("timestamp-micros")
>                       array<long> times;
>               }
>       }
> }
> {code}
> the "logicalType" attribute will be associated with the array type and not 
> the element type.
> The resulting AVSC (as converted by the idl2schemata tool) looks like this:
> {code:json}
>     {
>       "type" : "record",
>       "name" : "R",
>       "fields" : [ {
>         "name" : "times",
>         "type" : {
>           "type" : "array",
>           "items" : "long",
>           "logicalType" : "timestamp-micros"
>         }
>       } ]
>     }
> {code}
> I would expect the logical type to be associated with the element type, but 
> even if the tool is changed to do that, it's still not complete, because 
> there's no way to associate a logical type with a member of a union.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to